|
|
@@ -34,6 +34,7 @@ class Shops extends Base
|
|
|
return $this->success('ok', $shopList->where('platform', $platform_id)->column('name', 'id'));
|
|
|
}
|
|
|
|
|
|
+
|
|
|
|
|
|
//获取规格
|
|
|
public function getSpec(ShopList $shopList){
|
|
|
@@ -47,12 +48,26 @@ class Shops extends Base
|
|
|
return $this->success('ok', $shopList);
|
|
|
}
|
|
|
|
|
|
+
|
|
|
//发货记录
|
|
|
public function delivery(ShopDelivery $shopDelivery){
|
|
|
|
|
|
- $data = $this->request->post();
|
|
|
- $result = $shopDelivery::where($data)->select();
|
|
|
- $this->success();
|
|
|
+ $plat_id = $this->request->post('plat_id/d', 0); //平台
|
|
|
+ $shop_id = $this->request->post('shop_id/d', 0); //店铺
|
|
|
+ $variety_id = $this->request->post('variety_id/d', 0); //品种
|
|
|
+
|
|
|
+ $where['a.user_id'] = $this->userinfo['id'];
|
|
|
+ if($plat_id > 0) $where['a.plat_id'] = $plat_id;
|
|
|
+ if($shop_id > 0) $where['a.shop_id'] = $shop_id;
|
|
|
+ if($variety_id > 0) $where['a.variety_id']= $variety_id;
|
|
|
+ $result = $shopDelivery::alias('a')
|
|
|
+ ->leftjoin('shop_list b', 'a.shop_id = b.id') //店铺
|
|
|
+ ->leftjoin('stock_config c', 'a.variety_id = c.id') //品种
|
|
|
+ ->leftjoin('product_config d', 'a.spec_id = d.id') //规格
|
|
|
+ ->field('a.id,a.num, b.name shop_name,c.title variety_name,d.title spec_name')
|
|
|
+ ->where($where)
|
|
|
+ ->paginate(15);
|
|
|
+ $this->success('ok', $result);
|
|
|
}
|
|
|
|
|
|
|