feat: 新增发票抬头、晒单、钱包日志等模型及后台管理功能
- 新增 invoice_title、showcase、wallet_log 模型及对应语言包 - 新增后台控制器、视图及搜索字段配置 - 修复服务类目删除保护逻辑 - 优化后台登录页面文案及样式 - 新增前端角色切换逻辑及页面拦截 - 新增 SVG 图标及样式变量 - 修复接口权限及下拉框默认值问题
这个提交包含在:
@@ -17,6 +17,7 @@ class Cat extends Backend
|
||||
* @var \app\admin\model\service\Cat
|
||||
*/
|
||||
protected $model = null;
|
||||
protected $searchFields = 'id,name';
|
||||
|
||||
public function _initialize()
|
||||
{
|
||||
@@ -59,4 +60,24 @@ class Cat extends Backend
|
||||
|
||||
return json(['total' => $list->total(), 'rows' => $rows]);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除保护:类目下仍有关联商品时禁止物理删除
|
||||
*/
|
||||
public function del($ids = null)
|
||||
{
|
||||
if (false === $this->request->isPost()) {
|
||||
$this->error(__('Invalid parameters'));
|
||||
}
|
||||
$ids = $ids ?: $this->request->post('ids');
|
||||
$idArr = array_values(array_filter(array_map('intval', explode(',', (string)$ids))));
|
||||
if (!$idArr) {
|
||||
$this->error(__('Parameter %s can not be empty', 'ids'));
|
||||
}
|
||||
$cnt = (int)Db::name('service')->where('cat_id', 'in', $idArr)->count();
|
||||
if ($cnt > 0) {
|
||||
$this->error('所选类目下仍包含 ' . $cnt . ' 种服务商品,请先迁移或删除下属商品后再操作');
|
||||
}
|
||||
return parent::del($ids);
|
||||
}
|
||||
}
|
||||
|
||||
在新工单中引用
屏蔽一个用户