| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 |
- <?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 float $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
- 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');
- }
- }
|