From caaa7bd33311cbaabe60792a8be400d7b4c05a8e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=85=A5=E9=97=A8=E5=88=B0=E6=94=BE=E5=BC=83?=
<727897186@qq.com>
Date: Thu, 26 Jan 2023 17:09:29 +0800
Subject: [PATCH 1/4] =?UTF-8?q?=E5=90=8E=E5=8F=B0=E6=9B=B4=E6=96=B0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/admin/controller/nk/Accommodation.php | 86 +++
app/admin/controller/nk/Announce.php | 86 +++
app/admin/controller/nk/Article.php | 6 +-
app/admin/controller/nk/Eliminate.php | 86 +++
app/admin/controller/nk/Farming.php | 86 +++
app/admin/controller/nk/Feedback.php | 86 +++
app/admin/controller/nk/Fishing.php | 86 +++
app/admin/controller/nk/Food.php | 86 +++
app/admin/controller/nk/Government.php | 86 +++
app/admin/controller/nk/Heresy.php | 86 +++
app/admin/controller/nk/Industry.php | 86 +++
app/admin/controller/nk/Mediation.php | 86 +++
app/admin/controller/nk/People.php | 86 +++
app/admin/controller/nk/Recruit.php | 86 +++
app/admin/controller/nk/Regulation.php | 86 +++
app/admin/controller/nk/SzxcNotice.php | 86 +++
app/admin/controller/nk/Travel.php | 86 +++
app/admin/controller/nk/User.php | 668 ++++++++++++++++++++++
app/admin/validate/nk/ArticleValidate.php | 26 +
app/admin/view/nk/article/index.html | 7 -
app/admin/view/nk/user/add.html | 102 ++++
app/admin/view/nk/user/auths.html | 205 +++++++
app/admin/view/nk/user/edit.html | 546 ++++++++++++++++++
app/admin/view/nk/user/index.html | 149 +++++
app/admin/view/nk/user/read.html | 265 +++++++++
config/database.php | 38 +-
public/static/assets/js/xm-select.js | 8 +
27 files changed, 3378 insertions(+), 18 deletions(-)
create mode 100644 app/admin/controller/nk/Accommodation.php
create mode 100644 app/admin/controller/nk/Announce.php
create mode 100644 app/admin/controller/nk/Eliminate.php
create mode 100644 app/admin/controller/nk/Farming.php
create mode 100644 app/admin/controller/nk/Feedback.php
create mode 100644 app/admin/controller/nk/Fishing.php
create mode 100644 app/admin/controller/nk/Food.php
create mode 100644 app/admin/controller/nk/Government.php
create mode 100644 app/admin/controller/nk/Heresy.php
create mode 100644 app/admin/controller/nk/Industry.php
create mode 100644 app/admin/controller/nk/Mediation.php
create mode 100644 app/admin/controller/nk/People.php
create mode 100644 app/admin/controller/nk/Recruit.php
create mode 100644 app/admin/controller/nk/Regulation.php
create mode 100644 app/admin/controller/nk/SzxcNotice.php
create mode 100644 app/admin/controller/nk/Travel.php
create mode 100644 app/admin/controller/nk/User.php
create mode 100644 app/admin/validate/nk/ArticleValidate.php
create mode 100644 app/admin/view/nk/user/add.html
create mode 100644 app/admin/view/nk/user/auths.html
create mode 100644 app/admin/view/nk/user/edit.html
create mode 100644 app/admin/view/nk/user/index.html
create mode 100644 app/admin/view/nk/user/read.html
create mode 100644 public/static/assets/js/xm-select.js
diff --git a/app/admin/controller/nk/Accommodation.php b/app/admin/controller/nk/Accommodation.php
new file mode 100644
index 0000000..a4ae12e
--- /dev/null
+++ b/app/admin/controller/nk/Accommodation.php
@@ -0,0 +1,86 @@
+adminInfo = get_login_admin();
+ $this->category_id=308;
+ $this->url=[
+ '/admin/nk.accommodation/index?category_id='.$this->category_id,
+ '/admin/nk.accommodation/add',
+ '/admin/nk.accommodation/edit',
+ '/admin/nk.accommodation/del',
+ '/admin/nk.accommodation/read',
+ ];
+ }
+ /**
+ * 查看
+ */
+ public function index()
+ {
+ if (request()->isAjax()) {
+ $params= get_params();
+ $params['category_id']=$this->category_id;
+ (new Article())->index($params);
+ }
+ return view('nk/article/index',['url'=>$this->url]);
+ }
+ /**
+ * 添加
+ */
+ public function add()
+ {
+ if (request()->isAjax()) {
+ $params= get_params();
+ $params['category_id']=$this->category_id;
+ (new Article())->add($params);
+ }else{
+ View::assign('editor', get_system_config('other','editor'));
+ View::assign('url', $this->url);
+ return view('nk/article/add');
+ }
+ }
+ /**
+ * 修改
+ */
+ public function edit()
+ {
+ $params= get_params();
+ (new Article())->edit($params);
+ return view('nk/article/edit',['url'=>$this->url]);
+ }
+ /**
+ * 查看信息
+ */
+ public function read()
+ {
+ $params = get_params();
+ (new Article())->read($params);
+
+ return view('nk/article/read',['url'=>$this->url]);
+
+ }
+ /**
+ * 修改
+ */
+ public function del()
+ {
+ $params= get_params();
+ (new Article())->del($params);
+ }
+}
\ No newline at end of file
diff --git a/app/admin/controller/nk/Announce.php b/app/admin/controller/nk/Announce.php
new file mode 100644
index 0000000..7087527
--- /dev/null
+++ b/app/admin/controller/nk/Announce.php
@@ -0,0 +1,86 @@
+adminInfo = get_login_admin();
+ $this->category_id=302;
+ $this->url=[
+ '/admin/nk.announce/index?category_id='.$this->category_id,
+ '/admin/nk.announce/add',
+ '/admin/nk.announce/edit',
+ '/admin/nk.announce/del',
+ '/admin/nk.announce/read',
+ ];
+ }
+ /**
+ * 查看
+ */
+ public function index()
+ {
+ if (request()->isAjax()) {
+ $params= get_params();
+ $params['category_id']=$this->category_id;
+ (new Article())->index($params);
+ }
+ return view('nk/article/index',['url'=>$this->url]);
+ }
+ /**
+ * 添加
+ */
+ public function add()
+ {
+ if (request()->isAjax()) {
+ $params= get_params();
+ $params['category_id']=$this->category_id;
+ (new Article())->add($params);
+ }else{
+ View::assign('editor', get_system_config('other','editor'));
+ View::assign('url', $this->url);
+ return view('nk/article/add');
+ }
+ }
+ /**
+ * 修改
+ */
+ public function edit()
+ {
+ $params= get_params();
+ (new Article())->edit($params);
+ return view('nk/article/edit',['url'=>$this->url]);
+ }
+ /**
+ * 查看信息
+ */
+ public function read()
+ {
+ $params = get_params();
+ (new Article())->read($params);
+
+ return view('nk/article/read',['url'=>$this->url]);
+
+ }
+ /**
+ * 修改
+ */
+ public function del()
+ {
+ $params= get_params();
+ (new Article())->del($params);
+ }
+}
\ No newline at end of file
diff --git a/app/admin/controller/nk/Article.php b/app/admin/controller/nk/Article.php
index 1fd9f6a..22d2126 100644
--- a/app/admin/controller/nk/Article.php
+++ b/app/admin/controller/nk/Article.php
@@ -49,7 +49,7 @@ class Article extends BaseController
$category_id =$params['category_id'];
if($category_id){
- $map[] = ['category_id','in',$category_id];
+ $map[] = ['category_id','=',$category_id];
}else{
$map = [];
}
@@ -86,7 +86,7 @@ class Article extends BaseController
public function add($param){
// 检验完整性
try {
- validate(\app\admin\validate\party\Article::class)->check($param);
+ validate(\app\admin\validate\nk\ArticleValidate::class)->check($param);
} catch (ValidateException $e) {
// 验证失败 输出错误信息
return to_assign(1, $e->getError());
@@ -106,7 +106,7 @@ class Article extends BaseController
public function edit($param){
if (request()->isAjax()) {
try {
- validate(\app\admin\validate\party\Article::class)->check($param);
+ validate(\app\admin\validate\nk\ArticleValidate::class)->check($param);
} catch (ValidateException $e) {
// 验证失败 输出错误信息
return to_assign(1, $e->getError());
diff --git a/app/admin/controller/nk/Eliminate.php b/app/admin/controller/nk/Eliminate.php
new file mode 100644
index 0000000..9eea390
--- /dev/null
+++ b/app/admin/controller/nk/Eliminate.php
@@ -0,0 +1,86 @@
+adminInfo = get_login_admin();
+ $this->category_id=149;
+ $this->url=[
+ '/admin/nk.eliminate/index?category_id='.$this->category_id,
+ '/admin/nk.eliminate/add',
+ '/admin/nk.eliminate/edit',
+ '/admin/nk.eliminate/del',
+ '/admin/nk.eliminate/read',
+ ];
+ }
+ /**
+ * 查看
+ */
+ public function index()
+ {
+ if (request()->isAjax()) {
+ $params= get_params();
+ $params['category_id']=$this->category_id;
+ (new Article())->index($params);
+ }
+ return view('nk/article/index',['url'=>$this->url]);
+ }
+ /**
+ * 添加
+ */
+ public function add()
+ {
+ if (request()->isAjax()) {
+ $params= get_params();
+ $params['category_id']=$this->category_id;
+ (new Article())->add($params);
+ }else{
+ View::assign('editor', get_system_config('other','editor'));
+ View::assign('url', $this->url);
+ return view('nk/article/add');
+ }
+ }
+ /**
+ * 修改
+ */
+ public function edit()
+ {
+ $params= get_params();
+ (new Article())->edit($params);
+ return view('nk/article/edit',['url'=>$this->url]);
+ }
+ /**
+ * 查看信息
+ */
+ public function read()
+ {
+ $params = get_params();
+ (new Article())->read($params);
+
+ return view('nk/article/read',['url'=>$this->url]);
+
+ }
+ /**
+ * 修改
+ */
+ public function del()
+ {
+ $params= get_params();
+ (new Article())->del($params);
+ }
+}
\ No newline at end of file
diff --git a/app/admin/controller/nk/Farming.php b/app/admin/controller/nk/Farming.php
new file mode 100644
index 0000000..6dc61da
--- /dev/null
+++ b/app/admin/controller/nk/Farming.php
@@ -0,0 +1,86 @@
+adminInfo = get_login_admin();
+ $this->category_id=311;
+ $this->url=[
+ '/admin/nk.farming/index?category_id='.$this->category_id,
+ '/admin/nk.farming/add',
+ '/admin/nk.farming/edit',
+ '/admin/nk.farming/del',
+ '/admin/nk.farming/read',
+ ];
+ }
+ /**
+ * 查看
+ */
+ public function index()
+ {
+ if (request()->isAjax()) {
+ $params= get_params();
+ $params['category_id']=$this->category_id;
+ (new Article())->index($params);
+ }
+ return view('nk/article/index',['url'=>$this->url]);
+ }
+ /**
+ * 添加
+ */
+ public function add()
+ {
+ if (request()->isAjax()) {
+ $params= get_params();
+ $params['category_id']=$this->category_id;
+ (new Article())->add($params);
+ }else{
+ View::assign('editor', get_system_config('other','editor'));
+ View::assign('url', $this->url);
+ return view('nk/article/add');
+ }
+ }
+ /**
+ * 修改
+ */
+ public function edit()
+ {
+ $params= get_params();
+ (new Article())->edit($params);
+ return view('nk/article/edit',['url'=>$this->url]);
+ }
+ /**
+ * 查看信息
+ */
+ public function read()
+ {
+ $params = get_params();
+ (new Article())->read($params);
+
+ return view('nk/article/read',['url'=>$this->url]);
+
+ }
+ /**
+ * 修改
+ */
+ public function del()
+ {
+ $params= get_params();
+ (new Article())->del($params);
+ }
+}
\ No newline at end of file
diff --git a/app/admin/controller/nk/Feedback.php b/app/admin/controller/nk/Feedback.php
new file mode 100644
index 0000000..fcefec5
--- /dev/null
+++ b/app/admin/controller/nk/Feedback.php
@@ -0,0 +1,86 @@
+adminInfo = get_login_admin();
+ $this->category_id=165;
+ $this->url=[
+ '/admin/nk.feedback/index?category_id='.$this->category_id,
+ '/admin/nk.feedback/add',
+ '/admin/nk.feedback/edit',
+ '/admin/nk.feedback/del',
+ '/admin/nk.feedback/read',
+ ];
+ }
+ /**
+ * 查看
+ */
+ public function index()
+ {
+ if (request()->isAjax()) {
+ $params= get_params();
+ $params['category_id']=$this->category_id;
+ (new Article())->index($params);
+ }
+ return view('nk/article/index',['url'=>$this->url]);
+ }
+ /**
+ * 添加
+ */
+ public function add()
+ {
+ if (request()->isAjax()) {
+ $params= get_params();
+ $params['category_id']=$this->category_id;
+ (new Article())->add($params);
+ }else{
+ View::assign('editor', get_system_config('other','editor'));
+ View::assign('url', $this->url);
+ return view('nk/article/add');
+ }
+ }
+ /**
+ * 修改
+ */
+ public function edit()
+ {
+ $params= get_params();
+ (new Article())->edit($params);
+ return view('nk/article/edit',['url'=>$this->url]);
+ }
+ /**
+ * 查看信息
+ */
+ public function read()
+ {
+ $params = get_params();
+ (new Article())->read($params);
+
+ return view('nk/article/read',['url'=>$this->url]);
+
+ }
+ /**
+ * 修改
+ */
+ public function del()
+ {
+ $params= get_params();
+ (new Article())->del($params);
+ }
+}
\ No newline at end of file
diff --git a/app/admin/controller/nk/Fishing.php b/app/admin/controller/nk/Fishing.php
new file mode 100644
index 0000000..cc5481f
--- /dev/null
+++ b/app/admin/controller/nk/Fishing.php
@@ -0,0 +1,86 @@
+adminInfo = get_login_admin();
+ $this->category_id=310;
+ $this->url=[
+ '/admin/nk.fishing/index?category_id='.$this->category_id,
+ '/admin/nk.fishing/add',
+ '/admin/nk.fishing/edit',
+ '/admin/nk.fishing/del',
+ '/admin/nk.fishing/read',
+ ];
+ }
+ /**
+ * 查看
+ */
+ public function index()
+ {
+ if (request()->isAjax()) {
+ $params= get_params();
+ $params['category_id']=$this->category_id;
+ (new Article())->index($params);
+ }
+ return view('nk/article/index',['url'=>$this->url]);
+ }
+ /**
+ * 添加
+ */
+ public function add()
+ {
+ if (request()->isAjax()) {
+ $params= get_params();
+ $params['category_id']=$this->category_id;
+ (new Article())->add($params);
+ }else{
+ View::assign('editor', get_system_config('other','editor'));
+ View::assign('url', $this->url);
+ return view('nk/article/add');
+ }
+ }
+ /**
+ * 修改
+ */
+ public function edit()
+ {
+ $params= get_params();
+ (new Article())->edit($params);
+ return view('nk/article/edit',['url'=>$this->url]);
+ }
+ /**
+ * 查看信息
+ */
+ public function read()
+ {
+ $params = get_params();
+ (new Article())->read($params);
+
+ return view('nk/article/read',['url'=>$this->url]);
+
+ }
+ /**
+ * 修改
+ */
+ public function del()
+ {
+ $params= get_params();
+ (new Article())->del($params);
+ }
+}
\ No newline at end of file
diff --git a/app/admin/controller/nk/Food.php b/app/admin/controller/nk/Food.php
new file mode 100644
index 0000000..6f8425e
--- /dev/null
+++ b/app/admin/controller/nk/Food.php
@@ -0,0 +1,86 @@
+adminInfo = get_login_admin();
+ $this->category_id=307;
+ $this->url=[
+ '/admin/nk.food/index?category_id='.$this->category_id,
+ '/admin/nk.food/add',
+ '/admin/nk.food/edit',
+ '/admin/nk.food/del',
+ '/admin/nk.food/read',
+ ];
+ }
+ /**
+ * 查看
+ */
+ public function index()
+ {
+ if (request()->isAjax()) {
+ $params= get_params();
+ $params['category_id']=$this->category_id;
+ (new Article())->index($params);
+ }
+ return view('nk/article/index',['url'=>$this->url]);
+ }
+ /**
+ * 添加
+ */
+ public function add()
+ {
+ if (request()->isAjax()) {
+ $params= get_params();
+ $params['category_id']=$this->category_id;
+ (new Article())->add($params);
+ }else{
+ View::assign('editor', get_system_config('other','editor'));
+ View::assign('url', $this->url);
+ return view('nk/article/add');
+ }
+ }
+ /**
+ * 修改
+ */
+ public function edit()
+ {
+ $params= get_params();
+ (new Article())->edit($params);
+ return view('nk/article/edit',['url'=>$this->url]);
+ }
+ /**
+ * 查看信息
+ */
+ public function read()
+ {
+ $params = get_params();
+ (new Article())->read($params);
+
+ return view('nk/article/read',['url'=>$this->url]);
+
+ }
+ /**
+ * 修改
+ */
+ public function del()
+ {
+ $params= get_params();
+ (new Article())->del($params);
+ }
+}
\ No newline at end of file
diff --git a/app/admin/controller/nk/Government.php b/app/admin/controller/nk/Government.php
new file mode 100644
index 0000000..196eb04
--- /dev/null
+++ b/app/admin/controller/nk/Government.php
@@ -0,0 +1,86 @@
+adminInfo = get_login_admin();
+ $this->category_id=301;
+ $this->url=[
+ '/admin/nk.government/index?category_id='.$this->category_id,
+ '/admin/nk.government/add',
+ '/admin/nk.government/edit',
+ '/admin/nk.government/del',
+ '/admin/nk.government/read',
+ ];
+ }
+ /**
+ * 查看
+ */
+ public function index()
+ {
+ if (request()->isAjax()) {
+ $params= get_params();
+ $params['category_id']=$this->category_id;
+ (new Article())->index($params);
+ }
+ return view('nk/article/index',['url'=>$this->url]);
+ }
+ /**
+ * 添加
+ */
+ public function add()
+ {
+ if (request()->isAjax()) {
+ $params= get_params();
+ $params['category_id']=$this->category_id;
+ (new Article())->add($params);
+ }else{
+ View::assign('editor', get_system_config('other','editor'));
+ View::assign('url', $this->url);
+ return view('nk/article/add');
+ }
+ }
+ /**
+ * 修改
+ */
+ public function edit()
+ {
+ $params= get_params();
+ (new Article())->edit($params);
+ return view('nk/article/edit',['url'=>$this->url]);
+ }
+ /**
+ * 查看信息
+ */
+ public function read()
+ {
+ $params = get_params();
+ (new Article())->read($params);
+
+ return view('nk/article/read',['url'=>$this->url]);
+
+ }
+ /**
+ * 修改
+ */
+ public function del()
+ {
+ $params= get_params();
+ (new Article())->del($params);
+ }
+}
\ No newline at end of file
diff --git a/app/admin/controller/nk/Heresy.php b/app/admin/controller/nk/Heresy.php
new file mode 100644
index 0000000..eb189c3
--- /dev/null
+++ b/app/admin/controller/nk/Heresy.php
@@ -0,0 +1,86 @@
+adminInfo = get_login_admin();
+ $this->category_id=148;
+ $this->url=[
+ '/admin/nk.heresy/index?category_id='.$this->category_id,
+ '/admin/nk.heresy/add',
+ '/admin/nk.heresy/edit',
+ '/admin/nk.heresy/del',
+ '/admin/nk.heresy/read',
+ ];
+ }
+ /**
+ * 查看
+ */
+ public function index()
+ {
+ if (request()->isAjax()) {
+ $params= get_params();
+ $params['category_id']=$this->category_id;
+ (new Article())->index($params);
+ }
+ return view('nk/article/index',['url'=>$this->url]);
+ }
+ /**
+ * 添加
+ */
+ public function add()
+ {
+ if (request()->isAjax()) {
+ $params= get_params();
+ $params['category_id']=$this->category_id;
+ (new Article())->add($params);
+ }else{
+ View::assign('editor', get_system_config('other','editor'));
+ View::assign('url', $this->url);
+ return view('nk/article/add');
+ }
+ }
+ /**
+ * 修改
+ */
+ public function edit()
+ {
+ $params= get_params();
+ (new Article())->edit($params);
+ return view('nk/article/edit',['url'=>$this->url]);
+ }
+ /**
+ * 查看信息
+ */
+ public function read()
+ {
+ $params = get_params();
+ (new Article())->read($params);
+
+ return view('nk/article/read',['url'=>$this->url]);
+
+ }
+ /**
+ * 修改
+ */
+ public function del()
+ {
+ $params= get_params();
+ (new Article())->del($params);
+ }
+}
\ No newline at end of file
diff --git a/app/admin/controller/nk/Industry.php b/app/admin/controller/nk/Industry.php
new file mode 100644
index 0000000..e3ade0b
--- /dev/null
+++ b/app/admin/controller/nk/Industry.php
@@ -0,0 +1,86 @@
+adminInfo = get_login_admin();
+ $this->category_id=312;
+ $this->url=[
+ '/admin/nk.industry/index?category_id='.$this->category_id,
+ '/admin/nk.industry/add',
+ '/admin/nk.industry/edit',
+ '/admin/nk.industry/del',
+ '/admin/nk.industry/read',
+ ];
+ }
+ /**
+ * 查看
+ */
+ public function index()
+ {
+ if (request()->isAjax()) {
+ $params= get_params();
+ $params['category_id']=$this->category_id;
+ (new Article())->index($params);
+ }
+ return view('nk/article/index',['url'=>$this->url]);
+ }
+ /**
+ * 添加
+ */
+ public function add()
+ {
+ if (request()->isAjax()) {
+ $params= get_params();
+ $params['category_id']=$this->category_id;
+ (new Article())->add($params);
+ }else{
+ View::assign('editor', get_system_config('other','editor'));
+ View::assign('url', $this->url);
+ return view('nk/article/add');
+ }
+ }
+ /**
+ * 修改
+ */
+ public function edit()
+ {
+ $params= get_params();
+ (new Article())->edit($params);
+ return view('nk/article/edit',['url'=>$this->url]);
+ }
+ /**
+ * 查看信息
+ */
+ public function read()
+ {
+ $params = get_params();
+ (new Article())->read($params);
+
+ return view('nk/article/read',['url'=>$this->url]);
+
+ }
+ /**
+ * 修改
+ */
+ public function del()
+ {
+ $params= get_params();
+ (new Article())->del($params);
+ }
+}
\ No newline at end of file
diff --git a/app/admin/controller/nk/Mediation.php b/app/admin/controller/nk/Mediation.php
new file mode 100644
index 0000000..b0802e9
--- /dev/null
+++ b/app/admin/controller/nk/Mediation.php
@@ -0,0 +1,86 @@
+adminInfo = get_login_admin();
+ $this->category_id=147;
+ $this->url=[
+ '/admin/nk.mediation/index?category_id='.$this->category_id,
+ '/admin/nk.mediation/add',
+ '/admin/nk.mediation/edit',
+ '/admin/nk.mediation/del',
+ '/admin/nk.mediation/read',
+ ];
+ }
+ /**
+ * 查看
+ */
+ public function index()
+ {
+ if (request()->isAjax()) {
+ $params= get_params();
+ $params['category_id']=$this->category_id;
+ (new Article())->index($params);
+ }
+ return view('nk/article/index',['url'=>$this->url]);
+ }
+ /**
+ * 添加
+ */
+ public function add()
+ {
+ if (request()->isAjax()) {
+ $params= get_params();
+ $params['category_id']=$this->category_id;
+ (new Article())->add($params);
+ }else{
+ View::assign('editor', get_system_config('other','editor'));
+ View::assign('url', $this->url);
+ return view('nk/article/add');
+ }
+ }
+ /**
+ * 修改
+ */
+ public function edit()
+ {
+ $params= get_params();
+ (new Article())->edit($params);
+ return view('nk/article/edit',['url'=>$this->url]);
+ }
+ /**
+ * 查看信息
+ */
+ public function read()
+ {
+ $params = get_params();
+ (new Article())->read($params);
+
+ return view('nk/article/read',['url'=>$this->url]);
+
+ }
+ /**
+ * 修改
+ */
+ public function del()
+ {
+ $params= get_params();
+ (new Article())->del($params);
+ }
+}
\ No newline at end of file
diff --git a/app/admin/controller/nk/People.php b/app/admin/controller/nk/People.php
new file mode 100644
index 0000000..1a477d6
--- /dev/null
+++ b/app/admin/controller/nk/People.php
@@ -0,0 +1,86 @@
+adminInfo = get_login_admin();
+ $this->category_id=152;
+ $this->url=[
+ '/admin/nk.people/index?category_id='.$this->category_id,
+ '/admin/nk.people/add',
+ '/admin/nk.people/edit',
+ '/admin/nk.people/del',
+ '/admin/nk.people/read',
+ ];
+ }
+ /**
+ * 查看
+ */
+ public function index()
+ {
+ if (request()->isAjax()) {
+ $params= get_params();
+ $params['category_id']=$this->category_id;
+ (new Article())->index($params);
+ }
+ return view('nk/article/index',['url'=>$this->url]);
+ }
+ /**
+ * 添加
+ */
+ public function add()
+ {
+ if (request()->isAjax()) {
+ $params= get_params();
+ $params['category_id']=$this->category_id;
+ (new Article())->add($params);
+ }else{
+ View::assign('editor', get_system_config('other','editor'));
+ View::assign('url', $this->url);
+ return view('nk/article/add');
+ }
+ }
+ /**
+ * 修改
+ */
+ public function edit()
+ {
+ $params= get_params();
+ (new Article())->edit($params);
+ return view('nk/article/edit',['url'=>$this->url]);
+ }
+ /**
+ * 查看信息
+ */
+ public function read()
+ {
+ $params = get_params();
+ (new Article())->read($params);
+
+ return view('nk/article/read',['url'=>$this->url]);
+
+ }
+ /**
+ * 修改
+ */
+ public function del()
+ {
+ $params= get_params();
+ (new Article())->del($params);
+ }
+}
\ No newline at end of file
diff --git a/app/admin/controller/nk/Recruit.php b/app/admin/controller/nk/Recruit.php
new file mode 100644
index 0000000..def9ec2
--- /dev/null
+++ b/app/admin/controller/nk/Recruit.php
@@ -0,0 +1,86 @@
+adminInfo = get_login_admin();
+ $this->category_id=316;
+ $this->url=[
+ '/admin/nk.recruit/index?category_id='.$this->category_id,
+ '/admin/nk.recruit/add',
+ '/admin/nk.recruit/edit',
+ '/admin/nk.recruit/del',
+ '/admin/nk.recruit/read',
+ ];
+ }
+ /**
+ * 查看
+ */
+ public function index()
+ {
+ if (request()->isAjax()) {
+ $params= get_params();
+ $params['category_id']=$this->category_id;
+ (new Article())->index($params);
+ }
+ return view('nk/article/index',['url'=>$this->url]);
+ }
+ /**
+ * 添加
+ */
+ public function add()
+ {
+ if (request()->isAjax()) {
+ $params= get_params();
+ $params['category_id']=$this->category_id;
+ (new Article())->add($params);
+ }else{
+ View::assign('editor', get_system_config('other','editor'));
+ View::assign('url', $this->url);
+ return view('nk/article/add');
+ }
+ }
+ /**
+ * 修改
+ */
+ public function edit()
+ {
+ $params= get_params();
+ (new Article())->edit($params);
+ return view('nk/article/edit',['url'=>$this->url]);
+ }
+ /**
+ * 查看信息
+ */
+ public function read()
+ {
+ $params = get_params();
+ (new Article())->read($params);
+
+ return view('nk/article/read',['url'=>$this->url]);
+
+ }
+ /**
+ * 修改
+ */
+ public function del()
+ {
+ $params= get_params();
+ (new Article())->del($params);
+ }
+}
\ No newline at end of file
diff --git a/app/admin/controller/nk/Regulation.php b/app/admin/controller/nk/Regulation.php
new file mode 100644
index 0000000..dc363b7
--- /dev/null
+++ b/app/admin/controller/nk/Regulation.php
@@ -0,0 +1,86 @@
+adminInfo = get_login_admin();
+ $this->category_id=163;
+ $this->url=[
+ '/admin/nk.regulation/index?category_id='.$this->category_id,
+ '/admin/nk.regulation/add',
+ '/admin/nk.regulation/edit',
+ '/admin/nk.regulation/del',
+ '/admin/nk.regulation/read',
+ ];
+ }
+ /**
+ * 查看
+ */
+ public function index()
+ {
+ if (request()->isAjax()) {
+ $params= get_params();
+ $params['category_id']=$this->category_id;
+ (new Article())->index($params);
+ }
+ return view('nk/article/index',['url'=>$this->url]);
+ }
+ /**
+ * 添加
+ */
+ public function add()
+ {
+ if (request()->isAjax()) {
+ $params= get_params();
+ $params['category_id']=$this->category_id;
+ (new Article())->add($params);
+ }else{
+ View::assign('editor', get_system_config('other','editor'));
+ View::assign('url', $this->url);
+ return view('nk/article/add');
+ }
+ }
+ /**
+ * 修改
+ */
+ public function edit()
+ {
+ $params= get_params();
+ (new Article())->edit($params);
+ return view('nk/article/edit',['url'=>$this->url]);
+ }
+ /**
+ * 查看信息
+ */
+ public function read()
+ {
+ $params = get_params();
+ (new Article())->read($params);
+
+ return view('nk/article/read',['url'=>$this->url]);
+
+ }
+ /**
+ * 修改
+ */
+ public function del()
+ {
+ $params= get_params();
+ (new Article())->del($params);
+ }
+}
\ No newline at end of file
diff --git a/app/admin/controller/nk/SzxcNotice.php b/app/admin/controller/nk/SzxcNotice.php
new file mode 100644
index 0000000..762c403
--- /dev/null
+++ b/app/admin/controller/nk/SzxcNotice.php
@@ -0,0 +1,86 @@
+adminInfo = get_login_admin();
+ $this->category_id=164;
+ $this->url=[
+ '/admin/nk.szxc_notice/index?category_id='.$this->category_id,
+ '/admin/nk.szxc_notice/add',
+ '/admin/nk.szxc_notice/edit',
+ '/admin/nk.szxc_notice/del',
+ '/admin/nk.szxc_notice/read',
+ ];
+ }
+ /**
+ * 查看
+ */
+ public function index()
+ {
+ if (request()->isAjax()) {
+ $params= get_params();
+ $params['category_id']=$this->category_id;
+ (new Article())->index($params);
+ }
+ return view('nk/article/index',['url'=>$this->url]);
+ }
+ /**
+ * 添加
+ */
+ public function add()
+ {
+ if (request()->isAjax()) {
+ $params= get_params();
+ $params['category_id']=$this->category_id;
+ (new Article())->add($params);
+ }else{
+ View::assign('editor', get_system_config('other','editor'));
+ View::assign('url', $this->url);
+ return view('nk/article/add');
+ }
+ }
+ /**
+ * 修改
+ */
+ public function edit()
+ {
+ $params= get_params();
+ (new Article())->edit($params);
+ return view('nk/article/edit',['url'=>$this->url]);
+ }
+ /**
+ * 查看信息
+ */
+ public function read()
+ {
+ $params = get_params();
+ (new Article())->read($params);
+
+ return view('nk/article/read',['url'=>$this->url]);
+
+ }
+ /**
+ * 修改
+ */
+ public function del()
+ {
+ $params= get_params();
+ (new Article())->del($params);
+ }
+}
\ No newline at end of file
diff --git a/app/admin/controller/nk/Travel.php b/app/admin/controller/nk/Travel.php
new file mode 100644
index 0000000..1c51040
--- /dev/null
+++ b/app/admin/controller/nk/Travel.php
@@ -0,0 +1,86 @@
+adminInfo = get_login_admin();
+ $this->category_id=309;
+ $this->url=[
+ '/admin/nk.travel/index?category_id='.$this->category_id,
+ '/admin/nk.travel/add',
+ '/admin/nk.travel/edit',
+ '/admin/nk.travel/del',
+ '/admin/nk.travel/read',
+ ];
+ }
+ /**
+ * 查看
+ */
+ public function index()
+ {
+ if (request()->isAjax()) {
+ $params= get_params();
+ $params['category_id']=$this->category_id;
+ (new Article())->index($params);
+ }
+ return view('nk/article/index',['url'=>$this->url]);
+ }
+ /**
+ * 添加
+ */
+ public function add()
+ {
+ if (request()->isAjax()) {
+ $params= get_params();
+ $params['category_id']=$this->category_id;
+ (new Article())->add($params);
+ }else{
+ View::assign('editor', get_system_config('other','editor'));
+ View::assign('url', $this->url);
+ return view('nk/article/add');
+ }
+ }
+ /**
+ * 修改
+ */
+ public function edit()
+ {
+ $params= get_params();
+ (new Article())->edit($params);
+ return view('nk/article/edit',['url'=>$this->url]);
+ }
+ /**
+ * 查看信息
+ */
+ public function read()
+ {
+ $params = get_params();
+ (new Article())->read($params);
+
+ return view('nk/article/read',['url'=>$this->url]);
+
+ }
+ /**
+ * 修改
+ */
+ public function del()
+ {
+ $params= get_params();
+ (new Article())->del($params);
+ }
+}
\ No newline at end of file
diff --git a/app/admin/controller/nk/User.php b/app/admin/controller/nk/User.php
new file mode 100644
index 0000000..20b9dd1
--- /dev/null
+++ b/app/admin/controller/nk/User.php
@@ -0,0 +1,668 @@
+adminInfo = get_login_admin();
+ $this->category_id = 305;
+ $this->url = [
+ '/admin/nk.user/index?category_id=' . $this->category_id,
+ '/admin/nk.user/add',
+ '/admin/nk.user/edit',
+ '/admin/nk.user/del',
+ '/admin/nk.user/read',
+ '/admin/nk.user/auths',
+ '/admin/nk.user/postedit',
+ ];
+ }
+ /**
+ * 查看
+ */
+ public function index()
+ {
+ if (request()->isAjax()) {
+ $mmm = [];
+ $post = get_params();
+ if (!empty($post['filter'])) {
+ $a = json_decode($post['filter'], true);
+ foreach ($a as $k => $v) {
+ if ($k == 'name') {
+ $mmm[] = ['m.name', 'LIKE', '%' . $v . '%'];
+ }
+ if ($k == 'phone') {
+ $mmm[] = ['m.phone', 'LIKE', '%' . $v . '%'];
+ }
+ }
+ }
+ //权限组信息
+ if ($this->adminInfo['position_id'] != 1) {
+ $find = Db::table('fa_szxc_information_useraddress')->where('user_id', $this->adminInfo['id'])->find();
+ if ($find) {
+ if ($find['auth_range'] == 1) {
+ $mmm['village_id'] = $find['village_id'];
+ } elseif ($find['auth_range'] == 2) {
+ $mmm['street_id'] = $find['street_id'];
+ } elseif ($find['auth_range'] == 3) {
+ $mmm['area_id'] = $find['area_id'];
+ }
+ }
+ }
+ if ($post) {
+ if (isset($post['area_id']) && !empty($post['area_id'])) {
+ $mmm['area_id'] = $post['area_id'];
+ }
+ if (isset($post['street_id']) && !empty($post['street_id'])) {
+ $mmm['street_id'] = $post['street_id'][0]['street_code'];
+ }
+ if (isset($post['village_id']) && !empty($post['village_id'])) {
+ $mmm['village_id'] = $post['village_id'][0]['village_id'];
+ }
+ if (isset($post['brigade_id']) && !empty($post['brigade_id'])) {
+ $mmm['brigade_id'] = $post['brigade_id'][0]['id'];
+ }
+ }
+ //权限组信息
+ $total = Db::table('fa_szxc_information_usermsg')
+ ->where($mmm)
+ ->count();
+ $list = Db::table('fa_szxc_information_usermsg')
+ ->alias('m')
+ ->where($mmm)
+ ->join(['fa_user' => 'u'], 'm.user_id=u.id')
+ ->join(['fa_user_group' => 'g'], 'g.id=u.group_id')
+ ->field('u.id,m.name,m.phone,u.avatar,u.group_id,u.status,m.gender,m.age,g.name group_name,m.householder_id')
+ ->withAttr('count', function ($value, $data) {
+ if ($data['householder_id'] != 0) {
+ $count = Db::table('fa_szxc_information_usermsg')->where('householder_id', $data['householder_id'])->count();
+ } else {
+ $count = '未绑定户主无法查询';
+ }
+ return $count;
+ })
+ ->withAttr('gender', function ($value, $data) {
+ if ($value == 1) {
+ return '男';
+ } elseif ($value == 2) {
+ return '女';
+ }
+ })
+ ->order('id DESC')
+ ->page($post['page'])
+ ->limit($post['limit'])
+ ->select();
+
+ $result = ['total' => $total, 'data' => $list];
+ return table_assign(0, '', $result);
+ }
+ //权限组信息
+ if ($this->adminInfo['position_id'] != 1) { //不是超级管理员
+ $www['admin_id'] = $this->adminInfo['id'];
+ $user_address = Db::table('fa_szxc_information_useraddress')->where($www)->find();
+ if ($user_address) {
+ if ($user_address['auth_range'] == 1) {
+ $select = Db::table('fa_geo_area')->where('city_code', '510500')->where('area_code', $user_address['area_id'])->select();
+ } elseif ($user_address['auth_range'] == 2) {
+ $select = Db::table('fa_geo_area')->where('city_code', '510500')->where('area_code', $user_address['area_id'])->select();
+ } elseif ($user_address['auth_range'] == 3) {
+ $select = Db::table('fa_geo_area')->where('city_code', '510500')->where('area_code', $user_address['area_id'])->select();
+ } elseif ($user_address['auth_range'] == 4) {
+ $select = Db::table('fa_geo_area')->where('city_code', '510500')->select();
+ } else {
+ $select = Db::table('fa_geo_area')->where('city_code', '510500')->select();
+ }
+ View::assign('row', $user_address);
+ } else {
+ $user_address['area_id'] = '';
+ $user_address['street_id'] = '';
+ $user_address['village_code'] = '';
+ $user_address['auth_range'] = '1';
+ $select = Db::table('fa_geo_area')->where('city_code', '510500')->select();
+ View::assign('row', $user_address);
+ }
+
+ $is_admin = 0;
+ } else {
+ $user_address['area_id'] = '';
+ $user_address['street_id'] = '';
+ $user_address['village_code'] = '';
+ $user_address['auth_range'] = '';
+ $select = Db::table('fa_geo_area')->where('city_code', '510500')->select();
+ View::assign('row', $user_address);
+ $is_admin = 1;
+ }
+ View::assign('arealist', $select);
+ View::assign('is_admin', $is_admin);
+ View::assign('url', $this->url);
+ return view();
+ }
+ /**
+ * 添加
+ */
+ public function add()
+ {
+ if (request()->isAjax()) {
+ $params = get_params();
+ $params['category_id'] = $this->category_id;
+ (new Article())->add($params);
+ } else {
+ View::assign('editor', get_system_config('other', 'editor'));
+ View::assign('url', $this->url);
+ return view('nk/article/add');
+ }
+ }
+ /**
+ * 修改
+ */
+ public function edit()
+ {
+ $params = get_params();
+ $find = Db::table('fa_szxc_information_usermsg')
+ ->where('user_id', $params['id'])->find();
+ //获取所有分类
+ $www2[] = ['type', 'in', ['Nation', 'Education', 'Occupation', 'Zzmm', 'Family', 'Nature_of_land', 'Blood_type', 'Drug_allergy', 'Exposure_history', 'History_of_disease', 'Whether_disabled', 'Cfpfss', 'Fuel_type', 'Drinking_water', 'Toilet_msg', 'Poultry_corral', 'Insurance_type', 'House', 'Car', 'Grade', 'Insurance', 'Medical_insurance_type', 'FamilyHistory', 'Marriage']];
+ $all_category = Db::table('fa_category')->where($www2)->field('id,type,name,pid')->select();
+ //种植信息
+ $planting = Db::table('fa_szxc_information_planting')->where('user_id', $params['id'])
+ ->find();
+ //保险信息
+ $insurancearr = Db::table('fa_szxc_information_insurance')->where('user_id', $params['id'])->find();
+ //健康信息
+ $healthyarr = Db::table('fa_szxc_information_healthy')->where('user_id', $params['id'])->find();
+ if ($planting == null) {
+ $planting = [
+ "tools_msg" => "",
+ "crops_msg" => "",
+ "land_area" => "",
+ "is_wz" => '',
+ "nature_of_land" => "",
+ ];
+ }
+ if ($insurancearr == null) {
+ $insurancearr = [
+ "endowment_insurance_status" => "",
+ "is_subsidy" => "",
+ "insurance_reason" => "",
+ "medical_insurance_type" => "",
+ "whether_disabled" => "",
+ "disability_num" => "",
+ "disability_type" => "",
+ "disability_level" => "",
+ "insurance_type" => "",
+ "ny_insurance" => "",
+ "sy_insurance" => "",
+ ];
+ }
+ if ($healthyarr == null) {
+ $healthyarr = [
+ "medical_insurance_type" => "",
+ "insurance_type" => "",
+ "blood_type" => "",
+ "drug_allergy" => "",
+ "exposure_history" => "",
+ "history_of_disease" => "",
+ "history_of_surgery" => "",
+ "family_history" => "",
+ "familial_diseases" => "",
+ "genetic_history" => "",
+ "genetic_name" => "",
+ "whether_disabled" => "",
+ "cfpfss" => "",
+ "fuel_type" => "",
+ "drinking_water" => "",
+ "toilet_msg" => "",
+ "poultry_corral" => "",
+ ];
+ }
+ View::assign('user_id', $params['id']);
+ View::assign('healthyarr', $healthyarr);
+ View::assign('insurancearr', $insurancearr);
+ View::assign('planting', $planting);
+ View::assign('all_category', $all_category);
+ View::assign('user', $find);
+ View::assign('url', $this->url);
+ View::assign('editor', get_system_config('other', 'editor'));
+
+ return view();
+ }
+ /**
+ * 提交修改
+ */
+ public function postedit()
+ {
+ $params = get_params();
+ if ($params['type'] == 1) {
+ unset($params['type']);
+ $res = Db::table('fa_szxc_information_usermsg')->where('user_id', $params['user_id'])->update($params);
+ if ($res) {
+ return to_assign(0, '操作成功');
+ } else {
+ return to_assign(1, '操作失败');
+ }
+ }
+ if ($params['type'] == 2) {
+ halt($params);
+ unset($params['type']);
+ $find=Db::table('fa_szxc_information_insurance')->where('user_id', $params['user_id'])->find();
+ if($find){
+ $res = Db::table('fa_szxc_information_insurance')->where('id', $find['id'])->update($params);
+ }else{
+ $res = Db::table('fa_szxc_information_insurance')->where('user_id', $params['user_id'])->insert($params);
+ }
+ if ($res) {
+ return to_assign(0, '操作成功');
+ } else {
+ return to_assign(1, '操作失败');
+ }
+ }
+ if ($params['type'] == 3) {
+ unset($params['type']);
+ $find=Db::table('fa_szxc_information_insurance')->where('user_id', $params['user_id'])->find();
+ if($find){
+ $res = Db::table('fa_szxc_information_insurance')->where('id', $find['id'])->update($params);
+ }else{
+ $res = Db::table('fa_szxc_information_insurance')->where('user_id', $params['user_id'])->insert($params);
+ }
+ if ($res) {
+ return to_assign(0, '操作成功');
+ } else {
+ return to_assign(1, '操作失败');
+ }
+ }
+ if ($params['type'] == 4) {
+ unset($params['type']);
+ $find=Db::table('fa_szxc_information_healthy')->where('user_id', $params['user_id'])->find();
+ if($find){
+ $res = Db::table('fa_szxc_information_healthy')->where('id', $find['id'])->update($params);
+ }else{
+ $res = Db::table('fa_szxc_information_healthy')->where('user_id', $params['user_id'])->insert($params);
+ }
+ if ($res) {
+ return to_assign(0, '操作成功');
+ } else {
+ return to_assign(1, '操作失败');
+ }
+ }
+ }
+ /**
+ * 查看信息
+ */
+ public function read()
+ {
+ $params = get_params();
+ $find = Db::table('fa_szxc_information_usermsg')
+ ->withAttr('gender', function ($value, $data) {
+ if ($value == 1) {
+ return '男';
+ }
+ return '女';
+ })->withAttr('education', function ($value, $data) {
+ return Db::table('fa_category')->where('id', $value)->value('name');
+ })->withAttr('nation', function ($value, $data) {
+ return Db::table('fa_category')->where('id', $value)->value('name');
+ })->withAttr('political_outlook', function ($value, $data) {
+ return Db::table('fa_category')->where('id', $value)->value('name');
+ })->withAttr('house_msg', function ($value, $data) {
+ return Db::table('fa_category')->where('id', $value)->value('name');
+ })->withAttr('car_msg', function ($value, $data) {
+ return Db::table('fa_category')->where('id', $value)->value('name');
+ })->withAttr('marital_status', function ($value, $data) {
+ return Db::table('fa_category')->where('id', $value)->value('name');
+ })
+ ->where('user_id', $params['id'])->find();
+ //家庭信息
+ if ($find == null || $find['householder_id'] == 0) {
+ $family = [];
+ } else {
+ if ($find['householder_id'] == $find['user_id']) {
+ $family['name'] = '本人';
+ } else {
+ $family['name'] = Db::table('fa_szxc_information_usermsg')->where('user_id', $find['householder_id'])->value('name');
+ $family['relation'] = Db::table('fa_category')->where('id', $find['family_relation'])->value('name');
+ }
+ $family['list'] = Db::table('fa_szxc_information_usermsg')->where('householder_id', $find['householder_id'])->where('user_id', '<>', $find['householder_id'])->field('user_id,name,age,gender,phone')->select();
+ }
+ //种植信息
+ if ($find || $find['householder_id'] == $params['id']) {
+ $Planting['is'] = 1;
+ $Planting['list'] = [];
+ $finds = Db::table('fa_szxc_information_planting')->where('user_id', $params['id'])
+ ->withAttr('crops_msg', function ($value, $data) {
+ return json_decode($value, true);
+ })
+ ->withAttr('breed_msg', function ($value, $data) {
+ return json_decode($value, true);
+ })
+ ->withAttr('tools_msg', function ($value, $data) {
+ return json_decode($value, true);
+ })
+ ->withAttr('nature_of_land', function ($value, $data) {
+ return Db::table('fa_category')->where('id', $value)->value('name');
+ })
+ ->withAttr('is_wz', function ($value, $data) {
+ return $value == 0 ? '否' : '是';
+ })
+ ->find();
+ if ($find) {
+ $Planting['list'] = $finds;
+ }
+ } else {
+ $Planting['is'] = 0;
+ }
+ $insurancearr = Db::table('fa_szxc_information_insurance')
+ ->withAttr('endowment_insurance_status', function ($value, $data) {
+ return Db::table('fa_category')->where('id', $value)->value('name');
+ })->withAttr('insurance_type', function ($value, $data) {
+ return Db::table('fa_category')->where('id', $value)->value('name');
+ })->withAttr('whether_disabled', function ($value, $data) {
+ return Db::table('fa_category')->where('id', $value)->value('name');
+ })->withAttr('disability_level', function ($value, $data) {
+ return Db::table('fa_category')->where('id', $value)->value('name');
+ })->withAttr('ny_insurance', function ($value, $data) {
+ return Db::table('fa_category')->where('id', $value)->value('name');
+ })->withAttr('sy_insurance', function ($value, $data) {
+ return Db::table('fa_category')->where('id', $value)->value('name');
+ })
+ ->where('user_id', $params['id'])->find();
+ $healthyarr = Db::table('fa_szxc_information_healthy')
+ ->withAttr('blood_type', function ($value, $data) {
+ return Db::table('fa_category')->where('id', $value)->value('name');
+ })->withAttr('drug_allergy', function ($value, $data) {
+ return Db::table('fa_category')->where('id', $value)->value('name');
+ })->withAttr('exposure_history', function ($value, $data) {
+ return Db::table('fa_category')->where('id', $value)->value('name');
+ })->withAttr('history_of_disease', function ($value, $data) {
+ return Db::table('fa_category')->where('id', $value)->value('name');
+ })->withAttr('history_of_surgery', function ($value, $data) {
+ return Db::table('fa_category')->where('id', $value)->value('name');
+ })->withAttr('family_history', function ($value, $data) {
+ return Db::table('fa_category')->where('id', $value)->value('name');
+ })->withAttr('familial_diseases', function ($value, $data) {
+ return Db::table('fa_category')->where('id', $value)->value('name');
+ })->withAttr('genetic_history', function ($value, $data) {
+ return Db::table('fa_category')->where('id', $value)->value('name');
+ })->withAttr('cfpfss', function ($value, $data) {
+ return Db::table('fa_category')->where('id', $value)->value('name');
+ })->withAttr('fuel_type', function ($value, $data) {
+ return Db::table('fa_category')->where('id', $value)->value('name');
+ })->withAttr('drinking_water', function ($value, $data) {
+ return Db::table('fa_category')->where('id', $value)->value('name');
+ })->withAttr('toilet_msg', function ($value, $data) {
+ return Db::table('fa_category')->where('id', $value)->value('name');
+ })->withAttr('poultry_corral', function ($value, $data) {
+ return Db::table('fa_category')->where('id', $value)->value('name');
+ })->withAttr('genetic_name', function ($value, $data) {
+ return Db::table('fa_category')->where('id', $value)->value('name');
+ })
+ ->where('user_id', $params['id'])->find();
+
+ View::assign('id', $params['id']);
+ View::assign('read', $find);
+ View::assign('family', $family);
+ View::assign('planting', $Planting);
+ View::assign('insurancearr', $insurancearr);
+ View::assign('healthyarr', $healthyarr);
+ return view();
+ }
+
+ public function auths()
+ {
+ $params = get_params();
+ if (request()->isPost()) {
+ $admin = Db::name('Admin')->where('user_id', $params['id'])->find();
+ $user = Db::table('fa_user')->where('id', $params['id'])->find();
+
+ if ($params['village_id'] != '') {
+ $village = Db::table('fa_geo_village')->where('village_code', $params['village_id'])->find();
+ }
+ // 组装地址名
+ if ($params['area_id'] != '') {
+ $area_name = Db::table('fa_geo_area')->where('area_code', $params['area_id'])->value('area_name');
+ }
+ if ($params['street_id'] != '') {
+ $street_name = Db::table('fa_geo_street')->where('street_code', $params['street_id'])->value('street_name');
+ }
+ if ($params['brigade_id'] != '') {
+ $brigade_name = Db::table('fa_geo_brigade')->where('id', $params['brigade_id'])->value('brigade_name');
+ }
+ $address_name = $area_name . $street_name . $village['village_name'] . $brigade_name;
+
+ if ($admin) {
+ Db::startTrans();
+ try {
+ if ($params['groupdata'] == 0) {
+ Db::name('admin_group_access')->where('uid', $admin['id'])->delete();
+ Db::name('Admin')->where('id', $admin['id'])->update(['status' => 0]);
+ } else {
+ $is_have_admin = Db::name('admin_group_access')->where('uid', $admin['id'])->find();
+ if ($is_have_admin) {
+ Db::name('admin_group_access')->where('uid', $admin['id'])->update(['group_id' => $params['groupdata']]);
+ } else {
+ $group_access2 = ['uid' => $admin['id'], 'group_id' => $params['groupdata']];
+ //写入权限组
+ Db::name('admin_group_access')->insert($group_access2);
+ }
+ Db::name('Admin')->where('id', $admin['id'])->update(['status' => 1]);
+ }
+ $useraddress = [
+ 'area_id' => $params['area_id'],
+ 'street_id' => $params['street_id'],
+ 'village_code' => $params['village_id'],
+ 'brigade_id' => $params['brigade_id'],
+ 'auth_range' => $params['auth_range'],
+ 'village_id' => $params['village_id'] != '' ? $village['village_id'] : 0,
+ 'admin_id' => $admin['id'],
+ ];
+ Db::table('fa_szxc_information_useraddress')->where('user_id', $params['id'])->update($useraddress);
+ // 修改user表
+ $ddd['is_admin'] = 1;
+ $ddd['group_id'] = $params['group_id'];
+ Db::table('fa_user')->where('id', $params['id'])->update($ddd);
+
+ // 修改商城关系表
+ $nk_user['n_user_id'] = $params['id'];
+ $is_nk_user = Db::connect('shop')->name('nk_user')->where($nk_user)->find();
+ if ($is_nk_user) {
+ $nk_data['group_id'] = $params['group_id'];
+ Db::connect('shop')->name('nk_user')->where($nk_user)->update($nk_data);
+ }
+
+ // 修改用户详细地址
+ $u_msg['address_name'] = $address_name;
+ $u_msg['area_id'] = $params['area_id'];
+ $u_msg['street_id'] = $params['street_id'];
+ $u_msg['village_id'] = $params['village_id'] != '' ? $village['village_id'] : 0;
+ $u_msg['brigade_id'] = $params['brigade_id'];
+ Db::table('fa_szxc_information_usermsg')->where('user_id', $params['id'])->update($u_msg);
+ // 提交事务
+ Db::commit();
+ } catch (\Exception $e) {
+ // 回滚事务
+ Db::rollback();
+ return to_assign(1, '操作失败,原因:' . $e->getMessage());
+ }
+ return to_assign(0, '操作成功');
+ } else {
+ $salt = set_salt(20);
+ $data = [
+ 'user_id' => $params['id'],
+ 'username' => $user['username'],
+ 'nickname' => $user['nickname'],
+ 'thumb' => 'https://lihai001.oss-cn-chengdu.aliyuncs.com/uploads/20230104/32a639be4ee32349705e947fbbd1e114.png',
+ 'mobile' => 13688888886,
+ 'did' => 1,
+ 'position_id' => 3,
+ 'salt' => $salt,
+ 'pwd' => set_password(123456, $salt),
+ 'email' => '',
+ ];
+ Db::startTrans();
+ try {
+ $w['user_id'] = $params['id'];
+ $is_have = Db::table('fa_szxc_information_useraddress')->where($w)->find();
+ // 创建管理员账号
+ $admin_id = Db::name('Admin')->insertGetId($data);
+ // 写入权限组
+ Db::name('AdminGroupAccess')->strict(false)->field(true)->insert([
+ 'uid' => $admin_id,
+ 'group_id' => $params['group_id'],
+ ]);
+ add_log('add', $this->adminInfo['id'], $params);
+ // Db::table('fa_auth_group_access')->insert($group_access);
+ // 修改user表
+ $ddd['is_admin'] = 1;
+ $ddd['group_id'] = $params['group_id'];
+ Db::table('fa_user')->where('id', $params['id'])->update($ddd);
+
+ // 修改商城关系表
+ $nk_user['n_user_id'] = $params['id'];
+ $is_nk_user = Db::connect('shop')->name('nk_user')->where($nk_user)->find();
+ if ($is_nk_user) {
+ $nk_data['group_id'] = $params['group_id'];
+ Db::connect('shop')->name('nk_user')->where($nk_user)->update($nk_data);
+ }
+
+ if ($is_have) {
+ $useraddress = [
+ 'user_id' => $params['id'],
+ 'admin_id' => $admin_id,
+ 'area_id' => $params['area_id'],
+ 'street_id' => $params['street_id'],
+ 'village_code' => $params['village_id'],
+ 'village_id' => $village['village_id'],
+ 'brigade_id' => $params['brigade_id'],
+ 'auth_range' => $params['auth_range'],
+ ];
+ Db::table('fa_szxc_information_useraddress')->where($w)->update($useraddress);
+ } else {
+ $useraddress = [
+ 'user_id' => $params['id'],
+ 'admin_id' => $admin_id->id,
+ 'area_id' => $params['area_id'],
+ 'street_id' => $params['street_id'],
+ 'village_code' => $params['village_id'],
+ 'village_id' => $village['village_id'],
+ 'brigade_id' => $params['brigade_id'],
+ 'auth_range' => $params['auth_range'],
+ 'createtime' => date('Y-m-d H:i:s')
+ ];
+ Db::table('fa_szxc_information_useraddress')->insert($useraddress);
+ }
+
+ // 修改用户详细地址
+ $u_msg['address_name'] = $address_name;
+ $u_msg['area_id'] = $params['area_id'];
+ $u_msg['street_id'] = $params['street_id'];
+ $u_msg['village_id'] = $params['village_id'] != '' ? $village['village_id'] : 0;
+ $u_msg['brigade_id'] = $params['brigade_id'];
+ Db::table('fa_szxc_information_usermsg')->where('user_id', $params['id'])->update($u_msg);
+
+ // 提交事务
+ Db::commit();
+ } catch (\Exception $e) {
+ // 回滚事务
+ Db::rollback();
+ return to_assign(1, '操作失败,原因:' . $e->getMessage());
+ }
+ return to_assign(0, '操作成功');
+ }
+ }
+
+ $user = Db::table('fa_user')->where('id', $params['id'])->field('id,nickname,group_id')->find();
+
+ // $geo_brigade = Db::table('fa_geo_brigade')->select();
+
+ $useraddress = [
+ 'area_id' => 0,
+ 'street_id' => 0,
+ 'village_id' => 0,
+ 'village_code' => 0,
+ 'brigade_id' => 0,
+ 'admin_group' => 0,
+ 'auth_range' => 1,
+ ];
+ $address = Db::table('fa_szxc_information_useraddress')->where('user_id', $params['id'])->find();
+ if ($address) {
+ $useraddress['area_id'] = $address['area_id'];
+ $useraddress['street_id'] = $address['street_id'];
+ $useraddress['village_id'] = $address['village_id'];
+ $useraddress['brigade_id'] = $address['brigade_id'];
+ $useraddress['village_code'] = $address['village_code'];
+ $useraddress['auth_range'] = $address['auth_range'];
+ $admin = Db::name('admin_group_access')->where('uid', $address['admin_id'])->find();
+ if ($admin) {
+ $useraddress['admin_group'] = $admin['group_id'];
+ }
+ }
+ //权限组信息
+ if ($this->adminInfo['position_id'] != 1) { //不是超级管理员
+ $www['admin_id'] = $this->adminInfo['id'];
+ $user_address = Db::table('fa_szxc_information_useraddress')->where($www)->find();
+ if ($user_address) {
+ if ($user_address['auth_range'] == 1) {
+ $auth_range = [['name' => '村级', 'value' => '1']];
+ }
+ if ($user_address['auth_range'] == 2) {
+ $auth_range = [['name' => '村级', 'value' => '1'], ['name' => '乡镇', 'value' => '2']];
+ }
+ if ($user_address['auth_range'] == 3) {
+ $auth_range = [['name' => '村级', 'value' => '1'], ['name' => '乡镇', 'value' => '2'], ['name' => '区县', 'value' => '3']];
+ }
+ if ($user_address['auth_range'] == 4) {
+ $auth_range = [['name' => '村级', 'value' => '1'], ['name' => '乡镇', 'value' => '2'], ['name' => '区县', 'value' => '3'], ['name' => '市级', 'value' => '4']];
+ }
+ }
+ } else {
+ $auth_range = [['name' => '村级', 'value' => '1'], ['name' => '乡镇', 'value' => '2'], ['name' => '区县', 'value' => '3'], ['name' => '市级', 'value' => '4']];
+ }
+ $street = Db::table('fa_geo_area')->where(['switch' => 1, 'city_code' => '510500'])
+ ->field('area_id id,area_code code,area_name name')
+ ->select();
+ $brigade = Db::table('fa_geo_brigade')
+ ->limit(30)
+ ->select();
+
+ //后端权限
+ $groupdata = Db::table('fa_auth_group')
+ ->where('id', '<>', 1)
+ ->limit(30)
+ ->select();
+ $groupdata[] = ['id' => 0, 'name' => '无后台权限'];
+ //前端权限
+ $user_group = Db::table('fa_user_group')
+ ->limit(30)
+ ->select();
+ View::assign('id', $params['id']);
+ View::assign('user_group', $user_group);
+ View::assign('groupdata', $groupdata);
+ View::assign('street', $street);
+ View::assign('brigade', $brigade);
+ View::assign('auth_range', $auth_range);
+ View::assign('user', $user);
+ View::assign('address', $useraddress);
+ View::assign('url', $this->url);
+ View::assign('editor', get_system_config('other', 'editor'));
+
+ return view();
+ }
+ /**
+ * 修改
+ */
+ public function del()
+ {
+ $params = get_params();
+ (new Article())->del($params);
+ }
+}
diff --git a/app/admin/validate/nk/ArticleValidate.php b/app/admin/validate/nk/ArticleValidate.php
new file mode 100644
index 0000000..c13f934
--- /dev/null
+++ b/app/admin/validate/nk/ArticleValidate.php
@@ -0,0 +1,26 @@
+ 'require',
+ 'title' => 'require',
+ // 'thumb' => 'require',
+ 'content' => 'require',
+];
+
+ protected $message = [
+ // 'cate_id.require' => '所属分类不能为空',
+ 'title.require' => '文章标题不能为空',
+ // 'thumb.require' => '缩略图不能为空',
+ 'content.require' => '文章内容不能为空',
+];
+}
\ No newline at end of file
diff --git a/app/admin/view/nk/article/index.html b/app/admin/view/nk/article/index.html
index a79a04f..01497d7 100644
--- a/app/admin/view/nk/article/index.html
+++ b/app/admin/view/nk/article/index.html
@@ -53,7 +53,6 @@
field: 'id',
title: '编号',
align: 'center',
- width: 80
},{
field: 'title',
title: '文章标题',
@@ -61,33 +60,27 @@
field: 'nickname',
title: '用户',
align: 'center',
- width: 90
},{
field: 'area',
title: '区县',
align: 'center',
- width: 90
},{
field: 'street',
title: '乡镇',
align: 'center',
- width: 90
},{
field: 'village',
title: '街道/村',
align: 'center',
- width: 90
},{
field: 'view_time',
title: '发布时间',
align: 'center',
- width: 160
},{
fixed: 'right',
field: 'right',
title: '操作',
toolbar: '#barDemo',
- width: 136,
align: 'center'
}
]
diff --git a/app/admin/view/nk/user/add.html b/app/admin/view/nk/user/add.html
new file mode 100644
index 0000000..b2ce05d
--- /dev/null
+++ b/app/admin/view/nk/user/add.html
@@ -0,0 +1,102 @@
+{extend name="common/base"/}
+{block name="style"}
+
+{/block}
+
+{block name="body"}
+
+{/block}
+
+
+
+{block name="script"}
+
+{/block}
+
\ No newline at end of file
diff --git a/app/admin/view/nk/user/auths.html b/app/admin/view/nk/user/auths.html
new file mode 100644
index 0000000..6e7f8de
--- /dev/null
+++ b/app/admin/view/nk/user/auths.html
@@ -0,0 +1,205 @@
+{extend name="common/base"/}
+{block name="style"}
+
+{/block}
+
+{block name="body"}
+
+{/block}
+
+
+
+{block name="script"}
+
+
+{/block}
+
\ No newline at end of file
diff --git a/app/admin/view/nk/user/edit.html b/app/admin/view/nk/user/edit.html
new file mode 100644
index 0000000..1343292
--- /dev/null
+++ b/app/admin/view/nk/user/edit.html
@@ -0,0 +1,546 @@
+{extend name="common/base"/}
+{block name="style"}
+
+{/block}
+
+{block name="body"}
+