|
|
@@ -626,8 +626,12 @@ class TradeService extends BaseService
|
|
|
$bonusRate = $bonusRate ? $bonusRate : 5;
|
|
|
$bonus = $info['real_price'] * $bonusRate / 100;
|
|
|
|
|
|
+ $profitRate = ConfigService::make()->getConfigByCode('profit_rate');
|
|
|
+ $profitRate = $profitRate ? $profitRate : 0;
|
|
|
+ $profit = $info['real_price'] * $profitRate / 100;
|
|
|
+
|
|
|
if ($bonus > 0) {
|
|
|
- if (!$this->model->where(['id' => $id, 'mark' => 1])->update(['bonus' => $bonus, 'update_time' => time()])) {
|
|
|
+ if (!$this->model->where(['id' => $id, 'mark' => 1])->update(['bonus' => $bonus,'profit'=> $profit, 'update_time' => time()])) {
|
|
|
$this->error = 2051;
|
|
|
DB::rollBack();
|
|
|
return true;
|