From cd2ed33305c6f30733e8fe030715af97f6181a24 Mon Sep 17 00:00:00 2001 From: meimei <102865034@qq.com> Date: Thu, 8 May 2025 10:47:04 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B6=85=E7=AE=A1=E5=90=8E=E5=8F=B0=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../application/admin/controller/Firm.php | 9 +++++ .../admin/controller/Firmbigcategory.php | 1 + .../admin/controller/Firmcustomerorigin.php | 1 + .../application/admin/controller/Firmduty.php | 1 + .../admin/controller/Firmstoreprojectsone.php | 1 + .../application/admin/controller/Firmtags.php | 1 + .../application/admin/controller/Index.php | 16 +++++++- .../Mattertemplatecategorization.php | 1 + superadmin/application/admin/library/Auth.php | 8 +++- .../admin/view/firmbigcategory/add.html | 15 ++++---- .../admin/view/firmbigcategory/edit.html | 14 +++---- .../admin/view/firmcustomer/add.html | 2 +- .../admin/view/firmcustomer/edit.html | 2 +- .../firmcustomerfollowuprecord/newadd.html | 4 +- .../admin/view/firmcustomerorigin/add.html | 15 ++++---- .../admin/view/firmcustomerorigin/edit.html | 14 +++---- .../application/admin/view/firmduty/add.html | 30 ++++++++------- .../application/admin/view/firmduty/edit.html | 28 +++++++------- .../admin/view/firmstoreprojectsone/add.html | 38 ++++++++++--------- .../admin/view/firmstoreprojectsone/edit.html | 36 +++++++++--------- .../admin/view/firmstoreprojectstwo/add.html | 2 +- .../admin/view/firmstoreprojectstwo/edit.html | 2 +- .../application/admin/view/firmtags/add.html | 19 +++++----- .../application/admin/view/firmtags/edit.html | 19 +++++----- .../mattertemplatecategorization/add.html | 15 ++++---- .../mattertemplatecategorization/edit.html | 13 ++++--- .../assets/js/backend/firmbigcategory.js | 2 +- .../assets/js/backend/firmcustomerorigin.js | 2 +- .../public/assets/js/backend/firmduty.js | 4 +- .../assets/js/backend/firmstoreprojectsone.js | 2 +- .../assets/js/backend/firmstoreprojectstwo.js | 2 +- .../public/assets/js/backend/firmtags.js | 2 +- .../backend/mattertemplatecategorization.js | 2 +- 33 files changed, 184 insertions(+), 139 deletions(-) diff --git a/superadmin/application/admin/controller/Firm.php b/superadmin/application/admin/controller/Firm.php index ab0c2d8..212c5a9 100755 --- a/superadmin/application/admin/controller/Firm.php +++ b/superadmin/application/admin/controller/Firm.php @@ -72,6 +72,15 @@ class Firm extends Backend $this->model->validateFailException()->validate($validate); } $result = $this->model->allowField(true)->insertGetId($params); + if (!$result){ + $this->error(__('No rows were inserted')); + Db::rollback(); + } + $firmstoreResult = Db::table('fa_firmstore')->insert(['firm_id'=>$result,'name'=>$params['full_name'].'门店']); + if (!$firmstoreResult){ + $this->error(__('No rows were inserted firmstore')); + Db::rollback(); + } $addaicustomerswrvicelistResult = $this->addaicustomerswrvicelist($params,$result); if (!$addaicustomerswrvicelistResult['res']){ $this->error($addaicustomerswrvicelistResult['text']); diff --git a/superadmin/application/admin/controller/Firmbigcategory.php b/superadmin/application/admin/controller/Firmbigcategory.php index 50b74ea..0db3c96 100755 --- a/superadmin/application/admin/controller/Firmbigcategory.php +++ b/superadmin/application/admin/controller/Firmbigcategory.php @@ -53,6 +53,7 @@ class Firmbigcategory extends Backend $list = $this->model ->with(['firm']) ->where($where) + ->where('firm_id',1) // ->order($sort, $order) ->order('firm_id asc,id desc') ->paginate($limit); diff --git a/superadmin/application/admin/controller/Firmcustomerorigin.php b/superadmin/application/admin/controller/Firmcustomerorigin.php index 2ca9bc2..34739a7 100755 --- a/superadmin/application/admin/controller/Firmcustomerorigin.php +++ b/superadmin/application/admin/controller/Firmcustomerorigin.php @@ -53,6 +53,7 @@ class Firmcustomerorigin extends Backend $list = $this->model ->with(['firm']) ->where($where) + ->where('firm_id',1) // ->order($sort, $order) ->order('firm_id asc,id desc') ->paginate($limit); diff --git a/superadmin/application/admin/controller/Firmduty.php b/superadmin/application/admin/controller/Firmduty.php index 51076e7..a3a4368 100755 --- a/superadmin/application/admin/controller/Firmduty.php +++ b/superadmin/application/admin/controller/Firmduty.php @@ -53,6 +53,7 @@ class Firmduty extends Backend $list = $this->model ->with(['firm','firmstore']) ->where($where) + ->where('firmduty.firm_id',1) // ->order($sort, $order) ->order('firm_id asc,id desc') ->paginate($limit); diff --git a/superadmin/application/admin/controller/Firmstoreprojectsone.php b/superadmin/application/admin/controller/Firmstoreprojectsone.php index 39ffbcc..609b6f0 100755 --- a/superadmin/application/admin/controller/Firmstoreprojectsone.php +++ b/superadmin/application/admin/controller/Firmstoreprojectsone.php @@ -53,6 +53,7 @@ class Firmstoreprojectsone extends Backend $list = $this->model ->with(['firm']) ->where($where) + ->where('firm_id',1) // ->order($sort, $order) ->order('firm_id asc,id desc') ->paginate($limit); diff --git a/superadmin/application/admin/controller/Firmtags.php b/superadmin/application/admin/controller/Firmtags.php index 1f34141..5627386 100755 --- a/superadmin/application/admin/controller/Firmtags.php +++ b/superadmin/application/admin/controller/Firmtags.php @@ -57,6 +57,7 @@ class Firmtags extends Backend $list = $this->model ->with(['firm']) ->where($where) + ->where('firm_id',1) // ->order($sort, $order) ->order('firm_id asc,id desc') ->paginate($limit); diff --git a/superadmin/application/admin/controller/Index.php b/superadmin/application/admin/controller/Index.php index b68ecae..5994ee7 100755 --- a/superadmin/application/admin/controller/Index.php +++ b/superadmin/application/admin/controller/Index.php @@ -39,12 +39,26 @@ class Index extends Backend config('fastadmin.' . $key, $cookieValue); } } + $userRule = ["*","general","category","addon","auth","general/config","general/attachment","general/profile","auth/admin","auth/adminlog","auth/group","auth/rule", + "dashboard/index","dashboard/add","dashboard/del","dashboard/edit","dashboard/multi","general/config/index","general/config/add","general/config/edit","general/config/del","general/config/multi", + "general/attachment/index","general/attachment/select","general/attachment/add","general/attachment/edit","general/attachment/del","general/attachment/multi", + "general/profile/index","general/profile/update","general/profile/add","general/profile/edit","general/profile/del","general/profile/multi", + "category/index","category/add","category/edit","category/del","category/multi","auth/admin/index","auth/admin/add","auth/admin/edit","auth/admin/del", + "auth/adminlog/index","auth/adminlog/detail","auth/adminlog/del","auth/group/index","auth/group/add","auth/group/edit","auth/group/del","auth/rule/index", + "auth/rule/add","auth/rule/edit","auth/rule/del","addon/index","addon/add","addon/edit","addon/del","addon/downloaded","addon/state","addon/config", + "addon/refresh","addon/multi","user","user/user","user/user/index","user/user/edit","user/user/add","user/user/del","user/user/multi", + "user/group","user/group/add","user/group/edit","user/group/index","user/group/del","user/group/multi","user/rule","user/rule/index","user/rule/del","user/rule/add","user/rule/edit","user/rule/multi", + "command","command/index","command/add","command/detail","command/command","command/execute","command/del","command/multi","firm","firm/index","firm/add","firm/edit","firm/del","firm/multi", + "firmbigcategory","firmbigcategory/index","firmbigcategory/add","firmbigcategory/edit","firmbigcategory/del","firmbigcategory/multi","kefuguanli", + "firm","firm/index","firm/add","firm/edit","firm/del","firm/multi","aicustomerservice","aicustomerservice/index","aicustomerservice/add","aicustomerservice/edit","aicustomerservice/del","aicustomerservice/multi", + "mattertemplate","mattertemplate/index","mattertemplate/add","mattertemplate/edit","mattertemplate/del","mattertemplate/multi","jichuguanli","firmcustomerorigin","firmcustomerorigin/index","firmduty","firmduty/index", + "firmstoreprojectsone","firmstoreprojectsone/index","firmtags","firmtags/index","aicustomerservicefirmstorelist","aicustomerservicefirmstorelist/index","mattertemplatecategorization","mattertemplatecategorization/index"]; //左侧菜单 list($menulist, $navlist, $fixedmenu, $referermenu) = $this->auth->getSidebar([ 'dashboard' => 'hot', 'addon' => ['new', 'red', 'badge'], 'auth/rule' => __('Menu'), - ], $this->view->site['fixedpage']); + ], $this->view->site['fixedpage'],$userRule); $action = $this->request->request('action'); if ($this->request->isPost()) { if ($action == 'refreshmenu') { diff --git a/superadmin/application/admin/controller/Mattertemplatecategorization.php b/superadmin/application/admin/controller/Mattertemplatecategorization.php index 5e84855..4c07c7a 100644 --- a/superadmin/application/admin/controller/Mattertemplatecategorization.php +++ b/superadmin/application/admin/controller/Mattertemplatecategorization.php @@ -54,6 +54,7 @@ class Mattertemplatecategorization extends Backend $list = $this->model ->with(['mattertemplate','firmstoreprojectsone','firmstoreprojectstwo','firm']) ->where($where) + ->where('mattertemplatecategorization.firm_id',1) // ->order($sort, $order) ->order('firm_id asc,id desc') ->paginate($limit); diff --git a/superadmin/application/admin/library/Auth.php b/superadmin/application/admin/library/Auth.php index 9332cdb..a87af86 100755 --- a/superadmin/application/admin/library/Auth.php +++ b/superadmin/application/admin/library/Auth.php @@ -430,7 +430,7 @@ class Auth extends \fast\Auth * @param string $fixedPage 默认页 * @return array */ - public function getSidebar($params = [], $fixedPage = 'dashboard') + public function getSidebar($params = [], $fixedPage = 'dashboard',$userRule=[]) { // 边栏开始 Hook::listen("admin_sidebar_begin", $params); @@ -457,7 +457,11 @@ class Auth extends \fast\Auth } // 读取管理员当前拥有的权限节点 - $userRule = $this->getRuleList(); + if (empty($userRule)){ + $userRule = $this->getRuleList(); + } +// dump($userRule);die(); +// dump(implode('","',$userRule));die(); $selected = $referer = []; $refererUrl = Session::get('referer'); // 必须将结果集转换为数组 diff --git a/superadmin/application/admin/view/firmbigcategory/add.html b/superadmin/application/admin/view/firmbigcategory/add.html index bd3bd6d..18b8c4e 100755 --- a/superadmin/application/admin/view/firmbigcategory/add.html +++ b/superadmin/application/admin/view/firmbigcategory/add.html @@ -6,13 +6,14 @@ -
- -
- -
- 不选择为基础模版 -
+ + + + + + + + -
- -
- -
- 不选择为基础模版 -
+ + + + + + +