|
@@ -787,7 +787,10 @@ class MemberService extends BaseService
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
DB::beginTransaction();
|
|
DB::beginTransaction();
|
|
|
- if(!$this->model->where(['id'=> $userId])->update(['bonus'=> 0,'score'=> intval($score * $bonus), 'update_time'=> time()])){
|
|
|
|
|
|
|
+ $scoreRate = ConfigService::make()->getConfigByCode('score_rate');
|
|
|
|
|
+ $scoreRate = $scoreRate? $scoreRate : 1;
|
|
|
|
|
+ $switchScore = intval($bonus*$scoreRate);
|
|
|
|
|
+ if(!$this->model->where(['id'=> $userId])->update(['bonus'=> 0,'score'=> intval($score + $switchScore), 'update_time'=> time()])){
|
|
|
DB::rollBack();
|
|
DB::rollBack();
|
|
|
return false;
|
|
return false;
|
|
|
}
|
|
}
|
|
@@ -810,7 +813,7 @@ class MemberService extends BaseService
|
|
|
'shop_id'=> $info['login_shop_id'],
|
|
'shop_id'=> $info['login_shop_id'],
|
|
|
'type'=> 5,
|
|
'type'=> 5,
|
|
|
'coin_type'=> 3,
|
|
'coin_type'=> 3,
|
|
|
- 'money'=> $info['bonus'],
|
|
|
|
|
|
|
+ 'money'=> $switchScore,
|
|
|
'balance'=> $info['score'],
|
|
'balance'=> $info['score'],
|
|
|
'create_time'=>time(),
|
|
'create_time'=>time(),
|
|
|
'update_time'=>time(),
|
|
'update_time'=>time(),
|