|
@@ -10,9 +10,9 @@ namespace App\Models;
|
|
|
|
|
|
class User extends BaseModel
|
|
class User extends BaseModel
|
|
{
|
|
{
|
|
- public function getCouponNumAttr($value, $data)
|
|
|
|
|
|
+ public function getCouponNumAttribute()
|
|
{
|
|
{
|
|
- return UserCoupon::where('user_id', $data['id'])->where('status', 1)->where('expire_time', '>', time())->count();
|
|
|
|
|
|
+ return UserCoupon::where('user_id', $this->id)->where('status', 1)->where('expire_time', '>', time())->count();
|
|
}
|
|
}
|
|
|
|
|
|
//通过token获取用户信息
|
|
//通过token获取用户信息
|