52 行
1.3 KiB
PHP
52 行
1.3 KiB
PHP
<?php
|
|
|
|
namespace app\admin\controller;
|
|
|
|
use app\common\controller\Backend;
|
|
|
|
/**
|
|
* 师傅服务技能管理
|
|
*
|
|
* @icon fa fa-certificate
|
|
*/
|
|
class MasterSkill extends Backend
|
|
{
|
|
/**
|
|
* MasterSkill模型对象
|
|
* @var \app\admin\model\MasterSkill
|
|
*/
|
|
protected $model = null;
|
|
protected $relationSearch = true;
|
|
protected $searchFields = 'id,master.realname,master.mobile,cat.name';
|
|
|
|
public function _initialize()
|
|
{
|
|
parent::_initialize();
|
|
$this->model = new \app\admin\model\MasterSkill;
|
|
$this->view->assign("statusList", $this->model->getStatusList());
|
|
}
|
|
|
|
/**
|
|
* 查看
|
|
*/
|
|
public function index()
|
|
{
|
|
$this->request->filter(['strip_tags', 'trim']);
|
|
if (false === $this->request->isAjax()) {
|
|
return $this->view->fetch();
|
|
}
|
|
if ($this->request->request('keyField')) {
|
|
return $this->selectpage();
|
|
}
|
|
[$where, $sort, $order, $offset, $limit] = $this->buildparams();
|
|
$list = $this->model
|
|
->with(['master', 'cat'])
|
|
->where($where)
|
|
->order($sort, $order)
|
|
->paginate($limit);
|
|
|
|
$result = ['total' => $list->total(), 'rows' => $list->items()];
|
|
return json($result);
|
|
}
|
|
}
|