update 商户列表
This commit is contained in:
parent
ece5b572cf
commit
7e33d707a4
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
namespace app\controller\api\dataview;
|
namespace app\controller\api\dataview;
|
||||||
|
|
||||||
|
use app\common\dao\system\merchant\MerchantDao;
|
||||||
use app\common\model\store\order\StoreOrderProduct;
|
use app\common\model\store\order\StoreOrderProduct;
|
||||||
use app\common\model\store\product\Product as model;
|
use app\common\model\store\product\Product as model;
|
||||||
use app\common\model\user\UserVisit;
|
use app\common\model\user\UserVisit;
|
||||||
@ -45,7 +46,28 @@ class Merchant extends BaseController
|
|||||||
{
|
{
|
||||||
[$page, $limit] = $this->getPage();
|
[$page, $limit] = $this->getPage();
|
||||||
$where = $this->request->params([ 'status', 'statusTag', 'is_trader', 'category_id', 'type_id', 'area_id', 'street_id']);
|
$where = $this->request->params([ 'status', 'statusTag', 'is_trader', 'category_id', 'type_id', 'area_id', 'street_id']);
|
||||||
return app('json')->success($this->repository->lst($where, $page, $limit));
|
$dao = new MerchantDao();
|
||||||
|
$query = $dao->search($where);
|
||||||
|
$count = $query->count($dao->getPk());
|
||||||
|
$list = $query->page($page, $limit)->setOption('field', [])
|
||||||
|
->where(function ($query) {
|
||||||
|
if ($this->streetCode != '') {
|
||||||
|
$query->where('street_id', $this->streetCode);
|
||||||
|
} else {
|
||||||
|
$query->where('area_id', $this->areaCode);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
->with([
|
||||||
|
'admin' => function ($query) {
|
||||||
|
$query->field('mer_id,account');
|
||||||
|
},
|
||||||
|
'merchantCategory',
|
||||||
|
'merchantType'
|
||||||
|
])
|
||||||
|
->order('mer_id','desc')
|
||||||
|
->field('sort, mer_id, mer_name, real_name, mer_phone, mer_address, mark, status, create_time,is_best,is_trader,type_id,category_id,copy_product_num,export_dump_num,is_margin,margin,mer_avatar')->select();
|
||||||
|
|
||||||
|
return app('json')->success(compact('count', 'list'));
|
||||||
}
|
}
|
||||||
|
|
||||||
// 商户统计
|
// 商户统计
|
||||||
|
Loading…
x
Reference in New Issue
Block a user