|
|
@@ -105,9 +105,9 @@ class TradeService extends BaseService
|
|
|
->where(function ($query) use ($userId,$sellUid, $status) {
|
|
|
|
|
|
if ($sellUid && $userId) {
|
|
|
- $query->where(function($query) use($userId, $sellUid){
|
|
|
- $query->where('a.user_id', $userId)->orWhere('a.sell_uid', $sellUid);
|
|
|
- })->where('a.status','<=', 2);
|
|
|
+ $query->where('a.user_id', $userId)->where(function($query) use($sellUid){
|
|
|
+ $query->where('a.sell_uid', $sellUid)->whereIn('a.status', [1,2]);
|
|
|
+ });
|
|
|
}else if($userId){
|
|
|
$query->where('a.user_id', '=', $userId);
|
|
|
}else if($sellUid){
|
|
|
@@ -222,7 +222,7 @@ class TradeService extends BaseService
|
|
|
$serviceRate = ConfigService::make()->getConfigByCode('service_fee_rate');
|
|
|
$serviceRate = $serviceRate ? $serviceRate : 8;
|
|
|
$counts['service_fee'] = intval($counts['total'] * $serviceRate / 100);
|
|
|
-
|
|
|
+
|
|
|
|
|
|
return $counts;
|
|
|
}
|
|
|
@@ -540,7 +540,7 @@ class TradeService extends BaseService
|
|
|
// }
|
|
|
|
|
|
DB::beginTransaction();
|
|
|
- $data = ['confirm_time' => time(), 'status' => 3, 'update_time' => time()];
|
|
|
+ $data = ['confirm_time' => time(),'is_pay'=>1, 'status' => 3, 'update_time' => time()];
|
|
|
if (!$this->model->where(['id' => $id, 'mark' => 1])->update($data)) {
|
|
|
$this->error = 2050;
|
|
|
DB::rollBack();
|