|
@@ -56,6 +56,7 @@ class StoreProductController
|
|
|
['store_id', 0, '', 'relation_id'],
|
|
|
['delivery_type', ''],
|
|
|
[['collate_code_id', 'd'], 0], //拼单ID 、桌码ID
|
|
|
+ ['award', -1], //拼单ID 、桌码ID
|
|
|
]);
|
|
|
if ($where['selectId'] && (!$where['sid'] || !$where['cid'])) {
|
|
|
if ($services->value(['id' => $where['selectId']], 'pid')) {
|
|
@@ -64,7 +65,7 @@ class StoreProductController
|
|
|
$where['cid'] = $where['selectId'];
|
|
|
}
|
|
|
}
|
|
|
- $where['ids'] = stringToArray($where['ids']);
|
|
|
+ $where['ids'] = stringToArray($where['ids']);
|
|
|
if (!$where['ids']) {
|
|
|
unset($where['ids']);
|
|
|
}
|
|
@@ -77,20 +78,20 @@ class StoreProductController
|
|
|
$field = ['image'];
|
|
|
}
|
|
|
|
|
|
- if ($where['relation_id']) {//获取定位门店商品
|
|
|
- if ($where['delivery_type'] == 2) {// 获取自提商品
|
|
|
- //验证平台自提开启,门店自提是否开启
|
|
|
- if(!sys_config('store_self_mention', 1) || !$storeServices->value(['id' => $where['relation_id'], 'is_show' => 1, 'is_del' => 0], 'is_store')) {
|
|
|
- return app('json')->success([]);
|
|
|
- }
|
|
|
- }
|
|
|
- $where['type'] = 1;
|
|
|
- $where['show_type'] = [0, 1];
|
|
|
- $list = $this->services->getGoodsList($where, (int)$request->uid());
|
|
|
- return app('json')->successful(get_thumb_water($list, $type, $field));
|
|
|
- } else {
|
|
|
- return app('json')->success([]);
|
|
|
- }
|
|
|
+ if ($where['relation_id']) {//获取定位门店商品
|
|
|
+ if ($where['delivery_type'] == 2) {// 获取自提商品
|
|
|
+ //验证平台自提开启,门店自提是否开启
|
|
|
+ if (!sys_config('store_self_mention', 1) || !$storeServices->value(['id' => $where['relation_id'], 'is_show' => 1, 'is_del' => 0], 'is_store')) {
|
|
|
+ return app('json')->success([]);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ $where['type'] = 1;
|
|
|
+ $where['show_type'] = [0, 1];
|
|
|
+ $list = $this->services->getGoodsList($where, (int)$request->uid());
|
|
|
+ return app('json')->successful(get_thumb_water($list, $type, $field));
|
|
|
+ } else {
|
|
|
+ return app('json')->success([]);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -101,31 +102,31 @@ class StoreProductController
|
|
|
*/
|
|
|
public function brand(Request $request, StoreProductCategoryServices $services)
|
|
|
{
|
|
|
- $where = $request->getMore([
|
|
|
- [['sid', 'd'], 0],
|
|
|
- [['cid', 'd'], 0],
|
|
|
- ['store_id', 0, '', 'relation_id'],
|
|
|
- ['selectId', '']
|
|
|
- ]);
|
|
|
- if ($where['selectId'] && (!$where['sid'] || !$where['cid'])) {
|
|
|
- if ($services->value(['id' => $where['selectId']], 'pid')) {
|
|
|
- $where['sid'] = $where['selectId'];
|
|
|
- } else {
|
|
|
- $where['cid'] = $where['selectId'];
|
|
|
- }
|
|
|
- }
|
|
|
- $cate_id = [];
|
|
|
- if ($where['sid']) {
|
|
|
- $cate_id = [$where['sid']];
|
|
|
- } elseif ($where['cid']) {
|
|
|
- $cate_id = array_merge([$where['cid']], $services->getColumn(['pid' => $where['cid'], 'is_show' => 1], 'id'));
|
|
|
- }
|
|
|
- if ($where['relation_id']) {//获取定位门店商品
|
|
|
- $where['type'] = 1;
|
|
|
- return app('json')->successful($this->services->getBrandList(['cate_id' => $cate_id]));
|
|
|
- } else {
|
|
|
- return app('json')->success([]);
|
|
|
- }
|
|
|
+ $where = $request->getMore([
|
|
|
+ [['sid', 'd'], 0],
|
|
|
+ [['cid', 'd'], 0],
|
|
|
+ ['store_id', 0, '', 'relation_id'],
|
|
|
+ ['selectId', '']
|
|
|
+ ]);
|
|
|
+ if ($where['selectId'] && (!$where['sid'] || !$where['cid'])) {
|
|
|
+ if ($services->value(['id' => $where['selectId']], 'pid')) {
|
|
|
+ $where['sid'] = $where['selectId'];
|
|
|
+ } else {
|
|
|
+ $where['cid'] = $where['selectId'];
|
|
|
+ }
|
|
|
+ }
|
|
|
+ $cate_id = [];
|
|
|
+ if ($where['sid']) {
|
|
|
+ $cate_id = [$where['sid']];
|
|
|
+ } elseif ($where['cid']) {
|
|
|
+ $cate_id = array_merge([$where['cid']], $services->getColumn(['pid' => $where['cid'], 'is_show' => 1], 'id'));
|
|
|
+ }
|
|
|
+ if ($where['relation_id']) {//获取定位门店商品
|
|
|
+ $where['type'] = 1;
|
|
|
+ return app('json')->successful($this->services->getBrandList(['cate_id' => $cate_id]));
|
|
|
+ } else {
|
|
|
+ return app('json')->success([]);
|
|
|
+ }
|
|
|
|
|
|
}
|
|
|
|