<?php
/**
 * @package merchant
 *
 * @author xaboy
 * @day 2020/6/23
 *
 * 
 */

namespace app\controller\admin\user;


use app\common\repositories\store\order\AgentOrderRepository;
use crmeb\basic\BaseController;
use think\App;

class AgentList  extends BaseController
{
    protected $repository;

    public function __construct(App $app, AgentOrderRepository $repository)
    {
        parent::__construct($app);
        $this->repository = $repository;
    }

    public function getList()
    {
        [$page, $limit] = $this->getPage();
        $where = $this->request->params(['keyword', 'date', 'type','identity']);
        return app('json')->success($this->repository->getList($where, $page, $limit));
    }

    public function type()
    {
        return app('json')->success($this->repository->type());
    }

    public function agentCount()
    {
        [$page, $limit] = $this->getPage();
        $where = $this->request->params(['keyword', 'date', 'type','identity']);
        return app('json')->success($this->repository->agentCount($where, $page, $limit));
    }
}