| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576 |
- <?php
- namespace App\Module\Fund\Models;
- use UCore\ModelCore;
- use App\Module\User\Models\User;
- /**
- * App\Module\Fund\Models\FundTransferModel
- *
- * field start
- * @property int $id 自增
- * @property int $user_id 用户id
- * @property int $to_user_id 转给用户id
- * @property string $remark 备注
- * @property int $amount 钱数
- * @property int $fund_id 来源账户的资金id
- * field end
- */
- class FundTransferModel extends ModelCore
- {
- protected $table = 'fund_transfer';
- // attrlist start
- protected $fillable = [
- 'id',
- 'user_id',
- 'to_user_id',
- 'remark',
- 'amount',
- 'fund_id',
- ];
- // attrlist end
- protected $fillable = [
- 'user_id',
- 'from_fund_id',
- 'to_fund_id',
- 'amount',
- 'status',
- 'remark',
- 'create_time',
- 'create_ip',
- 'update_time',
- 'update_ip',
- 'admin_id',
- 'admin_name'
- ];
- public $timestamps = false;
- /**
- * 获取用户信息
- */
- public function user()
- {
- return $this->belongsTo(User::class, 'id');
- }
- /**
- * 获取来源资金账户
- */
- public function fromFund()
- {
- return $this->belongsTo('App\Module\Fund\Models\FundModel', 'from_fund_id');
- }
- /**
- * 获取目标资金账户
- */
- public function toFund()
- {
- return $this->belongsTo('App\Module\Fund\Models\FundModel', 'to_fund_id');
- }
- }
|