46 lines
1.3 KiB
PHP
46 lines
1.3 KiB
PHP
<?php
|
|
namespace app\controller\middle;
|
|
|
|
use crmeb\basic\BaseController;
|
|
use think\App;
|
|
use think\facade\Db;
|
|
use app\common\repositories\system\merchant\MerchantRepository;
|
|
|
|
/**
|
|
* Class Auth
|
|
* @package app\controller\api
|
|
* @author xaboy
|
|
* @day 2020-05-06
|
|
*/
|
|
class Merchant extends BaseController
|
|
{
|
|
|
|
protected $repository;
|
|
|
|
public function __construct(App $app, MerchantRepository $repository)
|
|
{
|
|
parent::__construct($app);
|
|
$this->repository = $repository;
|
|
}
|
|
|
|
public function get_area(){
|
|
$city_code = $this->request->param('city_code', '');
|
|
$select = Db::name('geo_area')->where('city_code',$city_code)->field('area_id id,area_code code,area_name name')->select();
|
|
return app('json')->success($select);
|
|
}
|
|
|
|
public function count()
|
|
{
|
|
$where = $this->request->params(['keyword', 'date', 'status', 'statusTag', 'is_trader', 'category_id', 'type_id']);
|
|
return app('json')->success($this->repository->count($where));
|
|
}
|
|
|
|
public function lst()
|
|
{
|
|
[$page, $limit] = $this->getPage();
|
|
$where = $this->request->params(['keyword', 'date', 'status', 'statusTag', 'is_trader', 'category_id', 'type_id', 'area_id', 'street_id']);
|
|
return app('json')->success($this->repository->lst($where, $page, $limit));
|
|
}
|
|
|
|
}
|