作者 王晓刚
1 个管道 的构建 通过 耗费 1 秒

物流单号

@@ -56,7 +56,6 @@ class Order extends Frontend @@ -56,7 +56,6 @@ class Order extends Frontend
56 }*/ 56 }*/
57 $car_model = new \app\index\model\Car(); 57 $car_model = new \app\index\model\Car();
58 $data = $car_model->field('id,store_id,goods_id,number')->whereIn('id',$car_data)->select(); 58 $data = $car_model->field('id,store_id,goods_id,number')->whereIn('id',$car_data)->select();
59 - dump($data);  
60 if(!$data) { 59 if(!$data) {
61 // 如果不在购物车则为立即购买 60 // 如果不在购物车则为立即购买
62 $data[] = [ 61 $data[] = [
@@ -67,14 +66,12 @@ class Order extends Frontend @@ -67,14 +66,12 @@ class Order extends Frontend
67 } 66 }
68 $goodsModel = new \app\index\model\Goods(); 67 $goodsModel = new \app\index\model\Goods();
69 $store_ids = []; 68 $store_ids = [];
70 - dump($data);exit;  
71 foreach($data as $key1 => $vo){ 69 foreach($data as $key1 => $vo){
72 //获取店铺id 70 //获取店铺id
73 $goods = $goodsModel->findData(['g.id'=>$vo['goods_id']]); 71 $goods = $goodsModel->findData(['g.id'=>$vo['goods_id']]);
74 if(empty($goods)){ 72 if(empty($goods)){
75 $this->error('未查询到该商品'); 73 $this->error('未查询到该商品');
76 } 74 }
77 - dump($goods);exit;  
78 $data[$key1]['store_id'] = $goods['store_id']; 75 $data[$key1]['store_id'] = $goods['store_id'];
79 $store_ids[] = $goods['store_id']; 76 $store_ids[] = $goods['store_id'];
80 } 77 }
@@ -66,9 +66,7 @@ class Goods extends Model @@ -66,9 +66,7 @@ class Goods extends Model
66 ->join('sto_goodstype t','t.id = g.goodstype_id') 66 ->join('sto_goodstype t','t.id = g.goodstype_id')
67 ->join('sto_store s','s.id = g.store_id') 67 ->join('sto_store s','s.id = g.store_id')
68 ->where($where) 68 ->where($where)
69 - ->fetchSql()  
70 ->find(); 69 ->find();
71 - dump($data);exit;  
72 $storeModel = new Store(); 70 $storeModel = new Store();
73 $store = $storeModel->findData(['id'=>$data['store_id']]); 71 $store = $storeModel->findData(['id'=>$data['store_id']]);
74 $data['store_is_vip'] = $store['is_vip']; 72 $data['store_is_vip'] = $store['is_vip'];