链街Dcat后台
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

23 lines
511 B

<?php
namespace App\Models\v3;
use Dcat\Admin\Traits\HasDateTimeFormatter;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\DB;
class CouponUse extends Model
{
use HasDateTimeFormatter;
protected $table = 'lanzu_coupon_use';
/**
* 根据条件 获取使用数量
*/
public static function getUseCount($where)
{
$data = self::select(DB::raw(' COUNT(id) as total,coupon_id'))->where($where)->groupBy('coupon_id')->get();
return $data;
}
}