APPLE преди 3 години
родител
ревизия
f20bd2227a
променени са 2 файла, в които са добавени 3 реда и са изтрити 9 реда
  1. 3 8
      app/Services/Common/GoodsService.php
  2. 0 1
      app/Services/Common/TradeService.php

+ 3 - 8
app/Services/Common/GoodsService.php

@@ -490,8 +490,8 @@ class GoodsService extends BaseService
             $this->error = 2063;
             $this->error = 2063;
             return false;
             return false;
         }
         }
-        $goodsList = $this->model->whereIn('id', $ids)->where(['mark' => 1])->first();
-        if (empty($goodsList)) {
+        $tradeList = TradeModel::whereIn('id', $ids)->where(['mark' => 1])->first();
+        if (empty($tradeList)) {
             $this->error = 2061;
             $this->error = 2061;
             return false;
             return false;
         }
         }
@@ -503,12 +503,7 @@ class GoodsService extends BaseService
         }
         }
 
 
         DB::beginTransaction();
         DB::beginTransaction();
-        if (!$this->model->whereIn('id', $ids)->update(['user_id' => $userId, 'update_time' => time(), 'remark' => '商品转会员'])) {
-            DB::rollBack();
-            return true;
-        }
-
-        if(!TradeModel::whereIn('goods_id', $ids)->update(['is_out'=>1,'update_time'=> time(),'remark'=>'转会员'])){
+        if (!TradeModel::whereIn('id', $ids)->update(['user_id' => $userId, 'update_time' => time(), 'remark' => '商品转会员'])) {
             DB::rollBack();
             DB::rollBack();
             return true;
             return true;
         }
         }

+ 0 - 1
app/Services/Common/TradeService.php

@@ -213,7 +213,6 @@ class TradeService extends BaseService
             $where['a.user_id'] = $userId;
             $where['a.user_id'] = $userId;
         }
         }
 
 
-        $type = isset($params['type']) ? $params['type'] : 0;
         $list = $this->model->from('trade as a')
         $list = $this->model->from('trade as a')
             ->leftJoin('member as b', 'b.id', '=', 'a.sell_uid')
             ->leftJoin('member as b', 'b.id', '=', 'a.sell_uid')
             ->leftJoin('shop as c', 'c.id', '=', 'a.shop_id')
             ->leftJoin('shop as c', 'c.id', '=', 'a.shop_id')