This commit is contained in:
mkm 2023-12-04 16:40:55 +08:00
parent b7491efc4a
commit b70ddddbbc

View File

@ -58,21 +58,21 @@ class Merchant extends BaseController
public function lst() public function lst()
{ {
[$page, $limit] = $this->getPage(); [$page, $limit] = $this->getPage();
$where = $this->request->params(['store_category_id','keyword', 'order', 'is_best', 'location', 'category_id', 'type_id', 'type_code', 'is_trader', 'street_id', 'credit_buy']); $where = $this->request->params(['merchant_category_id', 'keyword', 'order', 'is_best', 'location', 'category_id', 'type_id', 'type_code', 'is_trader', 'street_id', 'credit_buy']);
if (empty($where['type_id'])) { if (empty($where['type_id'])) {
$where['type_id'] = [10, 17]; $where['type_id'] = [10, 17];
} }
if($where['store_category_id']>0){ if ($where['merchant_category_id'] > 0) {
$arr= Db::name('store_category')->where(['pid'=>$where['store_category_id'],'mer_id'=>0,'level'=>1,'is_show'=>1])->column('cate_name'); // $arr= Db::name('store_category')->where(['pid'=>$where['store_category_id'],'mer_id'=>0,'level'=>1,'is_show'=>1])->column('cate_name');
if($arr){ // if($arr){
$category_id=Db::name('merchant_category')->whereIn('category_name',$arr)->column('merchant_category_id'); // $category_id=Db::name('merchant_category')->whereIn('category_name',$arr)->column('merchant_category_id');
if($category_id){ // if($category_id){
$where['category_id']=implode(',',$category_id); // $where['category_id']=implode(',',$category_id);
// }
// }
$where['category_id'] = $where['merchant_category_id'];
unset($where['merchant_category_id']);
} }
}
unset($where['store_category_id']);
}
// $where['category_id']=$where['store_category_id']??'';
return app('json')->success($this->repository->getList($where, $page, $limit, $this->userInfo)); return app('json')->success($this->repository->getList($where, $page, $limit, $this->userInfo));
} }
@ -154,8 +154,7 @@ class Merchant extends BaseController
]); ]);
$url = $info['dir']; $url = $info['dir'];
} }
} } else {
else{
$url = $this->repository->wxQrcode(intval($id)); $url = $this->repository->wxQrcode(intval($id));
} }
return app('json')->success(compact('url')); return app('json')->success(compact('url'));
@ -243,7 +242,6 @@ class Merchant extends BaseController
} }
$data['delivery_way'] = $delivery_way; $data['delivery_way'] = $delivery_way;
} else { } else {
$data = $this->request->params(['mer_state']); $data = $this->request->params(['mer_state']);
@ -309,7 +307,8 @@ class Merchant extends BaseController
return app('json')->success($merchantInfo); return app('json')->success($merchantInfo);
} }
public function apply($merId){ public function apply($merId)
{
$merchant = app()->make(MerchantRepository::class)->search(['mer_id' => $merId])->field('uid,mer_id,mer_name,mer_money,financial_bank,financial_wechat,financial_alipay,financial_type')->find(); $merchant = app()->make(MerchantRepository::class)->search(['mer_id' => $merId])->field('uid,mer_id,mer_name,mer_money,financial_bank,financial_wechat,financial_alipay,financial_type')->find();
if (($msg = $this->checkAuth($merchant)) !== true) { if (($msg = $this->checkAuth($merchant)) !== true) {
return app('json')->fail($msg); return app('json')->fail($msg);
@ -374,7 +373,6 @@ class Merchant extends BaseController
$where['mer_id'] = $merId; $where['mer_id'] = $merId;
$data = app()->make(FinancialRepository::class)->getAdminList($where, $page, $limit); $data = app()->make(FinancialRepository::class)->getAdminList($where, $page, $limit);
return app('json')->success($data); return app('json')->success($data);
} }
public function account($merId) public function account($merId)