修改后台注释

This commit is contained in:
邹景立 2021-09-13 16:31:32 +08:00
parent 26ccb807b8
commit bd6f4fed55
9 changed files with 66 additions and 57 deletions

View File

@ -39,7 +39,7 @@ class Auth extends Controller
*/
public function index()
{
$this->_query(SystemAuth::class)->layTable(function () {
SystemAuth::mQuery()->layTable(function () {
$this->title = '系统权限管理';
}, function (QueryHelper $query) {
$query->dateBetween('create_at')->like('title,desc')->equal('status,utype');
@ -55,7 +55,7 @@ class Auth extends Controller
*/
public function add()
{
$this->_form(SystemAuth::class, 'form');
SystemAuth::mForm('form');
}
/**
@ -67,7 +67,7 @@ class Auth extends Controller
*/
public function edit()
{
$this->_form(SystemAuth::class, 'form');
SystemAuth::mForm('form');
}
/**
@ -77,7 +77,7 @@ class Auth extends Controller
*/
public function state()
{
$this->_save(SystemAuth::class, $this->_vali([
SystemAuth::mSave($this->_vali([
'status.in:0,1' => '状态值范围异常!',
'status.require' => '状态值不能为空!',
]));
@ -90,7 +90,7 @@ class Auth extends Controller
*/
public function remove()
{
$this->_delete(SystemAuth::class);
SystemAuth::mDelete();
}
/**
@ -119,7 +119,7 @@ class Auth extends Controller
sysoplog('系统权限管理', "配置系统权限[{$map['auth']}]授权成功");
$this->success('访问权限修改成功!', 'javascript:history.back()');
} else {
$this->_form(SystemAuth::class, 'apply');
SystemAuth::mForm('apply');
}
}

View File

@ -37,7 +37,7 @@ class Base extends Controller
*/
public function index()
{
$this->_query(SystemBase::class)->layTable(function () {
SystemBase::mQuery()->layTable(function () {
$this->title = '数据字典管理';
$this->types = SystemBase::mk()->types();
$this->type = input('get.type') ?: ($this->types[0] ?? '-');
@ -56,7 +56,7 @@ class Base extends Controller
*/
public function add()
{
$this->_form(SystemBase::class, 'form');
SystemBase::mForm('form');
}
/**
@ -68,7 +68,7 @@ class Base extends Controller
*/
public function edit()
{
$this->_form(SystemBase::class, 'form');
SystemBase::mForm('form');
}
/**
@ -100,7 +100,7 @@ class Base extends Controller
*/
public function state()
{
$this->_save(SystemBase::class);
SystemBase::mSave();
}
/**
@ -110,6 +110,6 @@ class Base extends Controller
*/
public function remove()
{
$this->_delete(SystemBase::class);
SystemBase::mDelete();
}
}

View File

@ -42,7 +42,7 @@ class Menu extends Controller
{
$this->title = '系统菜单管理';
$this->type = input('type', 'index');
$this->_query(SystemMenu::class)->order('sort desc,id asc')->page(false, true);
SystemMenu::mQuery()->order('sort desc,id asc')->page(false, true);
}
/**
@ -82,7 +82,7 @@ class Menu extends Controller
public function add()
{
$this->_applyFormToken();
$this->_form(SystemMenu::class, 'form');
SystemMenu::mForm('form');
}
/**
@ -95,7 +95,7 @@ class Menu extends Controller
public function edit()
{
$this->_applyFormToken();
$this->_form(SystemMenu::class, 'form');
SystemMenu::mForm('form');
}
/**
@ -139,7 +139,7 @@ class Menu extends Controller
public function state()
{
$this->_applyFormToken();
$this->_save(SystemMenu::class, $this->_vali([
SystemMenu::mSave($this->_vali([
'status.in:0,1' => '状态值范围异常!',
'status.require' => '状态值不能为空!',
]));
@ -153,6 +153,6 @@ class Menu extends Controller
public function remove()
{
$this->_applyFormToken();
$this->_delete(SystemMenu::class);
SystemMenu::mDelete();
}
}

View File

@ -38,7 +38,7 @@ class Oplog extends Controller
*/
public function index()
{
$this->_query(SystemOplog::class)->layTable(function () {
SystemOplog::mQuery()->layTable(function () {
$this->title = '系统日志管理';
$this->users = SystemOplog::mk()->distinct(true)->column('username');
$this->actions = SystemOplog::mk()->distinct(true)->column('action');
@ -70,7 +70,7 @@ class Oplog extends Controller
public function clear()
{
try {
$this->_query(SystemOplog::class)->empty();
SystemOplog::mQuery()->empty();
sysoplog('系统运维管理', '成功清理所有日志数据');
$this->success('日志清理成功!');
} catch (HttpResponseException $exception) {
@ -87,6 +87,6 @@ class Oplog extends Controller
*/
public function remove()
{
$this->_delete(SystemOplog::class);
SystemOplog::mDelete();
}
}

View File

@ -41,7 +41,7 @@ class Queue extends Controller
*/
public function index()
{
$this->_query(SystemQueue::class)->layTable(function () {
SystemQueue::mQuery()->layTable(function () {
$this->title = '系统任务管理';
$this->iswin = ProcessService::instance()->iswin();
// 超级管理面板
@ -101,6 +101,6 @@ class Queue extends Controller
*/
public function remove()
{
$this->_delete(SystemQueue::class);
SystemQueue::mDelete();
}
}

View File

@ -42,20 +42,25 @@ class User extends Controller
public function index()
{
$this->type = input('get.type', 'index');
$this->_query(SystemUser::mk()->with([
'userinfo' => function (Relation $relation) {
$relation->field('code,name,content');
},
]))->layTable(function () {
// 创建快捷查询工具
SystemUser::mQuery()->layTable(function () {
$this->title = '系统用户管理';
$this->bases = SystemBase::mk()->items('身份权限');
}, function (QueryHelper $query) {
// 关联用户身份资料
$query->with(['userinfo' => function (Relation $relation) {
$relation->field('code,name,content');
}]);
// 加载对应数据列表
if ($this->type === 'index') {
$query->where(['is_deleted' => 0, 'status' => 1]);
} elseif ($this->type = 'recycle') {
$query->where(['is_deleted' => 0, 'status' => 0]);
}
// 数据列表搜索过滤
$query->equal('status,usertype')->dateBetween('login_at,create_at');
$query->like('username,nickname,contact_phone#phone,contact_mail#mail');
@ -71,7 +76,7 @@ class User extends Controller
*/
public function add()
{
$this->_form(SystemUser::class, 'form');
SystemUser::mForm('form');
}
/**
@ -83,7 +88,7 @@ class User extends Controller
*/
public function edit()
{
$this->_form(SystemUser::class, 'form');
SystemUser::mForm('form');
}
/**
@ -161,7 +166,7 @@ class User extends Controller
public function state()
{
$this->_checkInput();
$this->_save(SystemUser::class, $this->_vali([
SystemUser::mSave($this->_vali([
'status.in:0,1' => '状态值范围异常!',
'status.require' => '状态值不能为空!',
]));
@ -175,7 +180,7 @@ class User extends Controller
public function remove()
{
$this->_checkInput();
$this->_delete(SystemUser::class);
SystemUser::mDelete();
}
/**

View File

@ -2,6 +2,7 @@
namespace app\data\controller\base\postage;
use app\data\model\BasePostageCompany;
use app\data\service\ExpressService;
use think\admin\Controller;
use think\exception\HttpResponseException;
@ -13,12 +14,6 @@ use think\exception\HttpResponseException;
*/
class Company extends Controller
{
/**
* 绑定数据表
* @var string
*/
private $table = 'BasePostageCompany';
/**
* 快递公司管理
* @auth true
@ -30,13 +25,15 @@ class Company extends Controller
public function index()
{
$this->title = '快递公司管理';
$query = $this->_query($this->table);
$query->like('name,code')->equal('status')->dateBetween('craete_at');
$query = BasePostageCompany::mQuery();
// 加载对应数据
$this->type = $this->request->get('type', 'index');
if ($this->type === 'index') $query->where(['status' => 1]);
elseif ($this->type === 'recycle') $query->where(['status' => 0]);
// 列表显示分页
$query->like('name,code')->equal('status')->dateBetween('craete_at');
$query->where(['deleted' => 0])->order('sort desc,id desc')->page();
}
@ -50,7 +47,7 @@ class Company extends Controller
public function add()
{
$this->title = '添加快递公司';
$this->_form($this->table, 'form');
BasePostageCompany::mForm('form');
}
/**
@ -63,7 +60,7 @@ class Company extends Controller
public function edit()
{
$this->title = '编辑快递公司';
$this->_form($this->table, 'form');
BasePostageCompany::mForm('form');
}
/**
@ -73,7 +70,7 @@ class Company extends Controller
*/
public function state()
{
$this->_save($this->table, $this->_vali([
BasePostageCompany::mSave($this->_vali([
'status.in:0,1' => '状态值范围异常!',
'status.require' => '状态值不能为空!',
]));
@ -86,7 +83,7 @@ class Company extends Controller
*/
public function remove()
{
$this->_delete($this->table);
BasePostageCompany::mDelete();
}
/**
@ -98,7 +95,7 @@ class Company extends Controller
try {
$result = ExpressService::instance()->company();
if (empty($result['code'])) $this->error($result['info']);
foreach ($result['data'] as $vo) data_save($this->table, [
foreach ($result['data'] as $vo) data_save(BasePostageCompany::class, [
'code_1' => $vo['code_1'], 'code_2' => $vo['code_2'],
'code_3' => $vo['code_3'], 'name' => $vo['title'], 'deleted' => 0,
], 'code_1');
@ -109,5 +106,4 @@ class Company extends Controller
$this->error('同步快递公司数据失败!');
}
}
}

View File

@ -3,6 +3,7 @@
namespace app\data\controller\base\postage;
use app\data\model\BasePostageRegion;
use app\data\model\BasePostageTemplate;
use app\data\service\ExpressService;
use think\admin\Controller;
use think\admin\extend\CodeExtend;
@ -14,12 +15,6 @@ use think\admin\extend\CodeExtend;
*/
class Template extends Controller
{
/**
* 绑定数据表
* @var string
*/
private $table = 'BasePostageTemplate';
/**
* 快递邮费模板
* @auth true
@ -31,7 +26,7 @@ class Template extends Controller
public function index()
{
$this->title = '快递邮费模板';
$query = $this->_query($this->table);
$query = BasePostageTemplate::mQuery();
$query->like('code,name')->equal('status')->dateBetween('create_at');
$query->where(['deleted' => 0])->order('sort desc,id desc')->page();
}
@ -39,7 +34,6 @@ class Template extends Controller
/**
* 配送区域管理
* @auth true
* @throws \think\db\exception\DbException
*/
public function region()
{
@ -65,7 +59,7 @@ class Template extends Controller
public function add()
{
$this->title = '添加配送邮费模板';
$this->_form($this->table, 'form', 'code');
BasePostageTemplate::mForm('form', 'code');
}
/**
@ -78,7 +72,7 @@ class Template extends Controller
public function edit()
{
$this->title = '编辑配送邮费模板';
$this->_form($this->table, 'form', 'code');
BasePostageTemplate::mForm('form', 'code');
}
/**
@ -113,7 +107,7 @@ class Template extends Controller
*/
public function state()
{
$this->_save($this->table, $this->_vali([
BasePostageTemplate::mSave($this->_vali([
'status.in:0,1' => '状态值范围异常!',
'status.require' => '状态值不能为空!',
]), 'code');
@ -126,7 +120,6 @@ class Template extends Controller
*/
public function remove()
{
$this->_delete($this->table, 'code');
BasePostageTemplate::mDelete('code');
}
}

View File

@ -0,0 +1,15 @@
<?php
namespace app\data\model;
use think\admin\Model;
/**
*
* Class BasePostageTemplate
* @package app\data\model
*/
class BasePostageTemplate extends Model
{
}