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

物流单号

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