|
@@ -680,21 +680,27 @@ class OrderService extends BaseService
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 结算商家收益
|
|
// 结算商家收益
|
|
|
- if (SettleService::make()->storeBonus($storeId, $bonus, $info) < 0) {
|
|
|
|
|
|
|
+ $result = SettleService::make()->storeBonus($storeId, $bonus, $info);
|
|
|
|
|
+ if ($result < 0) {
|
|
|
DB::rollBack();
|
|
DB::rollBack();
|
|
|
$this->error = SettleService::make()->getError();
|
|
$this->error = SettleService::make()->getError();
|
|
|
RedisService::clear($cacheLockKey);
|
|
RedisService::clear($cacheLockKey);
|
|
|
|
|
+ $this->saveLog("caches:settle:{$orderNo}:store_{$storeId}_error",SettleService::make()->getError());
|
|
|
return false;
|
|
return false;
|
|
|
}
|
|
}
|
|
|
|
|
+ $this->saveLog("caches:settle:{$orderNo}:store_{$storeId}",$result);
|
|
|
|
|
|
|
|
|
|
|
|
|
// 代理佣金结算
|
|
// 代理佣金结算
|
|
|
- if (SettleService::make()->agentBonus($userId, $recBonus, $info, $recBonusId) < 0) {
|
|
|
|
|
|
|
+ $result = SettleService::make()->agentBonus($userId, $recBonus, $info, $recBonusId);
|
|
|
|
|
+ if ($result < 0) {
|
|
|
DB::rollBack();
|
|
DB::rollBack();
|
|
|
$this->error = SettleService::make()->getError();
|
|
$this->error = SettleService::make()->getError();
|
|
|
RedisService::clear($cacheLockKey);
|
|
RedisService::clear($cacheLockKey);
|
|
|
|
|
+ $this->saveLog("caches:settle:{$orderNo}:agent_{$userId}_error",SettleService::make()->getError());
|
|
|
return false;
|
|
return false;
|
|
|
}
|
|
}
|
|
|
|
|
+ $this->saveLog("caches:settle:{$orderNo}:agent_{$userId}",$result);
|
|
|
|
|
|
|
|
DB::commit();
|
|
DB::commit();
|
|
|
|
|
|
|
@@ -704,6 +710,18 @@ class OrderService extends BaseService
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
|
|
+ * 日志
|
|
|
|
|
+ * @param $key
|
|
|
|
|
+ * @param $data
|
|
|
|
|
+ */
|
|
|
|
|
+ public function saveLog($key, $data)
|
|
|
|
|
+ {
|
|
|
|
|
+ if(env('APP_DEBUG')){
|
|
|
|
|
+ RedisService::set($key,$data,env('DEBUG_EXPIRE',7200));
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
* 售后或退款
|
|
* 售后或退款
|
|
|
* @param $userId
|
|
* @param $userId
|
|
|
* @param $params
|
|
* @param $params
|