'拆分活动的校验权限,分为发券和核券。'

This commit is contained in:
2020-08-21 13:16:29 +08:00
parent 3dfd677017
commit 1f2c1c0055
15 changed files with 210 additions and 48 deletions

View File

@@ -16,14 +16,12 @@ class User extends Authenticatable
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $guarded = [];
/**
* The attributes that should be hidden for arrays.
*
* @var array
*/
protected $hidden = [
@@ -91,7 +89,7 @@ class User extends Authenticatable
/**
* Notes: 密码加密
* @Author: <C.Jason>
* @Date: 2019/9/6 11:37
* @Date : 2019/9/6 11:37
* @param $password
*/
protected function setPasswordAttribute($password)
@@ -129,12 +127,12 @@ class User extends Authenticatable
public function getCouponCount($type, $date = '')
{
return $this->coupons()
->whereIn('status', [2])
->where('thirdPartyGoodsId', $type)
->when($date, function ($q) {
$q->whereDate('created_at', now()->format('Y-m-d'));
})
->count();
->whereIn('status', [2])
->where('thirdPartyGoodsId', $type)
->when($date, function ($q) {
$q->whereDate('created_at', now()->format('Y-m-d'));
})
->count();
}
}