shop-php/app/common/model/user/UserBill.php

54 lines
1.4 KiB
PHP
Raw Normal View History

2023-05-10 13:38:51 +08:00
<?php
// +----------------------------------------------------------------------
// | CRMEB [ CRMEB赋能开发者助力企业发展 ]
// +----------------------------------------------------------------------
// | Copyright (c) 2016~2022 https://www.crmeb.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed CRMEB并不是自由软件未经许可不能去掉CRMEB相关版权
// +----------------------------------------------------------------------
// | Author: CRMEB Team <admin@crmeb.com>
// +----------------------------------------------------------------------
namespace app\common\model\user;
use app\common\model\BaseModel;
2024-01-21 14:20:18 +08:00
use app\common\model\store\consumption\StoreConsumptionUser;
2023-05-10 13:38:51 +08:00
class UserBill extends BaseModel
{
/**
* @return string
* @author xaboy
* @day 2020-03-30
*/
public static function tablePk(): string
{
return 'bill_id';
}
/**
* @return string
* @author xaboy
* @day 2020-03-30
*/
public static function tableName(): string
{
return 'user_bill';
}
public function user()
{
return $this->hasOne(User::class, 'uid', 'uid');
}
2024-01-21 14:20:18 +08:00
public function storeConsumptionUser()
{
return $this->hasOne(StoreConsumptionUser::class, 'coupon_user_id', 'link_id')->bind(['order_amount', 'coupon_price']);
}
2023-05-10 13:38:51 +08:00
}