添加:商户分割为商户、酒道馆、供应商
This commit is contained in:
parent
ee4e2a07ca
commit
b7062fc425
|
|
@ -37,7 +37,11 @@ class MerchantDao extends BaseDao
|
|||
*/
|
||||
public function search(array $where, $is_del = 0)
|
||||
{
|
||||
$merchantType = $where['merchant_type'] ?? 0;
|
||||
$merchantType = in_array((int)$merchantType,[1,2,3]) ? $merchantType : 0;// 类型非法,使用默认类型
|
||||
|
||||
$query = Merchant::getDB()
|
||||
->where('merchant_type', $merchantType)
|
||||
->when($is_del !== null, function ($query) use ($is_del) {
|
||||
$query->where('is_del', $is_del);
|
||||
})
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ class Merchant extends BaseController
|
|||
|
||||
public function count()
|
||||
{
|
||||
$where = $this->request->params(['keyword', 'date', 'status', 'statusTag', 'is_trader', 'category_id', 'type_id']);
|
||||
$where = $this->request->params(['keyword','date','status','statusTag','is_trader','category_id','type_id','merchant_type']);
|
||||
return app('json')->success($this->repository->count($where));
|
||||
}
|
||||
|
||||
|
|
@ -65,7 +65,20 @@ class Merchant extends BaseController
|
|||
public function lst()
|
||||
{
|
||||
[$page, $limit] = $this->getPage();
|
||||
$where = $this->request->params(['mer_id_list','keyword','mer_id', 'date', 'status', 'statusTag', 'is_trader', 'category_id', 'type_id',['order','create_time'],'is_best']);
|
||||
$where = $this->request->params([
|
||||
'mer_id_list',
|
||||
'keyword',
|
||||
'mer_id',
|
||||
'date',
|
||||
'status',
|
||||
'statusTag',
|
||||
'is_trader',
|
||||
'category_id',
|
||||
'type_id',
|
||||
['order','create_time'],
|
||||
'is_best',
|
||||
'merchant_type'
|
||||
]);
|
||||
return app('json')->success($this->repository->lst($where, $page, $limit));
|
||||
}
|
||||
|
||||
|
|
@ -208,6 +221,7 @@ class Merchant extends BaseController
|
|||
['mer_exchange_quota_multiple',0],
|
||||
['avg_consumption',0],
|
||||
'mer_label',
|
||||
['merchant_type',0],
|
||||
]);
|
||||
$data['mer_label'] = str_replace(',',',',$data['mer_label']);
|
||||
if (!$isUpdate) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue