coupon-admin/app/traits/CouponBillTrait.php

18 lines
303 B
PHP
Raw Normal View History

2021-11-23 09:13:55 +00:00
<?php
namespace app\traits;
use think\Model;
use app\model\CouponBill;
trait CouponBillTrait
{
//消费者 验证优惠券获得的红包总数
public function consumerCouponBillTotal($userCode)
{
return CouponBill::where("user_code",$userCode)->sum("consumer_money");
}
}