文件
yjyf/server/application/admin/controller/SkillCategory.php
YuanWen 127b606e75 feat(admin): 重构服务管理模块新增增值服务功能
- 新增增值服务管理模块,支持按类目筛选绑定
- 新增工项服务定价和规格独立定价功能
- 优化前端订单页增值服务展示逻辑
- 升级版本号至1.0.19
2026-11-04 16:14:44 +08:00

51 行
1.2 KiB
PHP

<?php
namespace app\admin\controller;
use app\common\controller\Backend;
/**
* 技能分类管理
*
* @icon fa fa-th-large
*/
class SkillCategory extends Backend
{
/**
* SkillCategory模型对象
* @var \app\admin\model\SkillCategory
*/
protected $model = null;
protected $searchFields = 'id,name';
public function _initialize()
{
parent::_initialize();
$this->model = new \app\admin\model\SkillCategory;
$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
->withCount('skills')
->where($where)
->order($sort, $order)
->paginate($limit);
$result = ['total' => $list->total(), 'rows' => $list->items()];
return json($result);
}
}