更新查询

This commit is contained in:
yaooo 2023-09-28 12:37:42 +08:00
parent 027c65321c
commit 7b83e6119d
3 changed files with 11 additions and 11 deletions

View File

@ -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']);

View File

@ -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 = [

View File

@ -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);