diff --git a/app/common/dao/store/product/SpuDao.php b/app/common/dao/store/product/SpuDao.php index 46237a44..7545a675 100644 --- a/app/common/dao/store/product/SpuDao.php +++ b/app/common/dao/store/product/SpuDao.php @@ -43,7 +43,6 @@ class SpuDao extends BaseDao $order = 'S.'. (($where['order'] !== '') ?$where['order']: 'star' ).' DESC'; } } - $order .= ',S.create_time DESC'; if(isset($where['order']) && $where['order'] === 'none'){ $order = ''; @@ -53,13 +52,13 @@ class SpuDao extends BaseDao $query->where('P.is_del',$where['is_del']); }) ->when(isset($where['product_id']) && $where['product_id'] !== '',function($query)use($where){ - $query->where('P.product_id','in',$where['product_id']); + // $query->where('P.product_id','in',$where['product_id']); }) ->when(isset($where['mer_id']) && $where['mer_id'] !== '',function($query)use($where){ - $query->where('P.mer_id',$where['mer_id']); + // $query->where('P.mer_id',$where['mer_id']); }) ->when(isset($where['mer_array_id']),function($query)use($where){ - $query->whereIn('P.mer_id',$where['mer_array_id']); + // $query->whereIn('P.mer_id',$where['mer_array_id']); }) ->when(isset($where['mer_ids']) && $where['mer_ids'] !== '',function($query)use($where){ $query->whereIn('P.mer_id',$where['mer_ids']); diff --git a/app/controller/api/Auth.php b/app/controller/api/Auth.php index 4bc88cd9..9219a13a 100644 --- a/app/controller/api/Auth.php +++ b/app/controller/api/Auth.php @@ -1460,10 +1460,10 @@ class Auth extends BaseController 'status' => ($status == 1 ? 1 : 2), 'fail_msg' => $remark ]; - if ($status != 1) { - Db::name('merchant_intention')->where('mer_intention_id', $id)->where('type', 1)->update($updData); + Db::name('merchant_intention')->where('mer_intention_id', $id)->where('type', 1)->update($updData); + if ($status == 1) { + $repository->updateStatus($id, $data); } - $repository->updateStatus($id, $data); } else { //商户交易申请 $updData = [ diff --git a/app/controller/api/store/product/StoreSpu.php b/app/controller/api/store/product/StoreSpu.php index 04538e23..ee1afe55 100644 --- a/app/controller/api/store/product/StoreSpu.php +++ b/app/controller/api/store/product/StoreSpu.php @@ -144,14 +144,15 @@ class StoreSpu extends BaseController ]); if ($where['action']) unset($where['product_type']); $currentMerchant = Db::name('merchant')->where('mer_id',$id)->field('category_id,street_id')->find(); - $typeTownSupplyChainId = Db::name('MerchantType')->where('type_code', Merchant::TypeCode['TypeTownSupplyChain'])->value('mer_type_id'); + $typeSupplyChainId = Db::name('MerchantType')->where('type_code', Merchant::TypeCode['TypeSupplyChain'])->value('mer_type_id'); $merIdArray = Db::name('merchant') ->where('street_id',$currentMerchant['street_id']) ->where('mer_state',1) ->where('status',1) ->where('category_id',$currentMerchant['category_id']) - ->where('type_id', $typeTownSupplyChainId) + ->whereNotIn('type_id', (string)$typeSupplyChainId) ->column('mer_id'); + $where['mer_array_id'] = $merIdArray; $where['mer_rand_id'] = $id; $where['entry_mer_id'] = $id; @@ -170,7 +171,7 @@ class StoreSpu extends BaseController { [$page, $limit] = $this->getPage(); $where = $this->request->params(['common','mer_id']); - $typeTownSupplyChainId = Db::name('MerchantType')->where('type_code', Merchant::TypeCode['TypeTownSupplyChain'])->value('mer_type_id'); + $typeSupplyChainId = Db::name('MerchantType')->where('type_code', Merchant::TypeCode['TypeSupplyChain'])->value('mer_type_id'); $where['is_gift_bag'] = 0; //1:星级 //2:用户收藏 @@ -196,7 +197,7 @@ class StoreSpu extends BaseController } $where['product_type'] = 0; $where['is_stock'] = 1; - $where['mer_ids'] = Merchant::getInstance()->where('type_id', $typeTownSupplyChainId) + $where['mer_ids'] = Merchant::getInstance()->whereNotIn('type_id', (string)$typeSupplyChainId) ->where(['status' => 1, 'mer_state' => 1, 'is_del' => 0])->column('mer_id'); $data = $this->repository->getApiSearch($where, $page, $limit, $this->userInfo); return app('json')->success($data);