链街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

  1. <?php
  2. namespace App\Models\v3;
  3. use Dcat\Admin\Traits\HasDateTimeFormatter;
  4. use Illuminate\Database\Eloquent\Model;
  5. use Illuminate\Support\Facades\DB;
  6. class CouponUse extends Model
  7. {
  8. use HasDateTimeFormatter;
  9. protected $table = 'lanzu_coupon_use';
  10. /**
  11. * 根据条件 获取使用数量
  12. */
  13. public static function getUseCount($where)
  14. {
  15. $data = self::select(DB::raw(' COUNT(id) as total,coupon_id'))->where($where)->groupBy('coupon_id')->get();
  16. return $data;
  17. }
  18. }