后台更新

This commit is contained in:
入门到放弃 2023-01-26 17:09:29 +08:00
parent 8d2a81c2d6
commit caaa7bd333
27 changed files with 3378 additions and 18 deletions

View File

@ -0,0 +1,86 @@
<?php
namespace app\admin\controller\nk;
use app\admin\BaseController;
use think\exception\ValidateException;
use think\facade\Db;
use app\admin\controller\nk\Article;
use think\facade\View;
/**
* 文章
*
* @icon fa fa-circle-o
*/
class Accommodation extends BaseController
{
public function __construct()
{
$this->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);
}
}

View File

@ -0,0 +1,86 @@
<?php
namespace app\admin\controller\nk;
use app\admin\BaseController;
use think\exception\ValidateException;
use think\facade\Db;
use app\admin\controller\nk\Article;
use think\facade\View;
/**
* 文章
*
* @icon fa fa-circle-o
*/
class Announce extends BaseController
{
public function __construct()
{
$this->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);
}
}

View File

@ -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());

View File

@ -0,0 +1,86 @@
<?php
namespace app\admin\controller\nk;
use app\admin\BaseController;
use think\exception\ValidateException;
use think\facade\Db;
use app\admin\controller\nk\Article;
use think\facade\View;
/**
* 文章
*
* @icon fa fa-circle-o
*/
class Eliminate extends BaseController
{
public function __construct()
{
$this->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);
}
}

View File

@ -0,0 +1,86 @@
<?php
namespace app\admin\controller\nk;
use app\admin\BaseController;
use think\exception\ValidateException;
use think\facade\Db;
use app\admin\controller\nk\Article;
use think\facade\View;
/**
* 文章
*
* @icon fa fa-circle-o
*/
class Farming extends BaseController
{
public function __construct()
{
$this->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);
}
}

View File

@ -0,0 +1,86 @@
<?php
namespace app\admin\controller\nk;
use app\admin\BaseController;
use think\exception\ValidateException;
use think\facade\Db;
use app\admin\controller\nk\Article;
use think\facade\View;
/**
* 文章
*
* @icon fa fa-circle-o
*/
class Feedback extends BaseController
{
public function __construct()
{
$this->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);
}
}

View File

@ -0,0 +1,86 @@
<?php
namespace app\admin\controller\nk;
use app\admin\BaseController;
use think\exception\ValidateException;
use think\facade\Db;
use app\admin\controller\nk\Article;
use think\facade\View;
/**
* 文章
*
* @icon fa fa-circle-o
*/
class Fishing extends BaseController
{
public function __construct()
{
$this->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);
}
}

View File

@ -0,0 +1,86 @@
<?php
namespace app\admin\controller\nk;
use app\admin\BaseController;
use think\exception\ValidateException;
use think\facade\Db;
use app\admin\controller\nk\Article;
use think\facade\View;
/**
* 文章
*
* @icon fa fa-circle-o
*/
class Food extends BaseController
{
public function __construct()
{
$this->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);
}
}

View File

@ -0,0 +1,86 @@
<?php
namespace app\admin\controller\nk;
use app\admin\BaseController;
use think\exception\ValidateException;
use think\facade\Db;
use app\admin\controller\nk\Article;
use think\facade\View;
/**
* 文章
*
* @icon fa fa-circle-o
*/
class Government extends BaseController
{
public function __construct()
{
$this->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);
}
}

View File

@ -0,0 +1,86 @@
<?php
namespace app\admin\controller\nk;
use app\admin\BaseController;
use think\exception\ValidateException;
use think\facade\Db;
use app\admin\controller\nk\Article;
use think\facade\View;
/**
* 文章
*
* @icon fa fa-circle-o
*/
class Heresy extends BaseController
{
public function __construct()
{
$this->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);
}
}

View File

@ -0,0 +1,86 @@
<?php
namespace app\admin\controller\nk;
use app\admin\BaseController;
use think\exception\ValidateException;
use think\facade\Db;
use app\admin\controller\nk\Article;
use think\facade\View;
/**
* 文章
*
* @icon fa fa-circle-o
*/
class Industry extends BaseController
{
public function __construct()
{
$this->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);
}
}

View File

@ -0,0 +1,86 @@
<?php
namespace app\admin\controller\nk;
use app\admin\BaseController;
use think\exception\ValidateException;
use think\facade\Db;
use app\admin\controller\nk\Article;
use think\facade\View;
/**
* 文章
*
* @icon fa fa-circle-o
*/
class Mediation extends BaseController
{
public function __construct()
{
$this->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);
}
}

View File

@ -0,0 +1,86 @@
<?php
namespace app\admin\controller\nk;
use app\admin\BaseController;
use think\exception\ValidateException;
use think\facade\Db;
use app\admin\controller\nk\Article;
use think\facade\View;
/**
* 文章
*
* @icon fa fa-circle-o
*/
class People extends BaseController
{
public function __construct()
{
$this->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);
}
}

View File

@ -0,0 +1,86 @@
<?php
namespace app\admin\controller\nk;
use app\admin\BaseController;
use think\exception\ValidateException;
use think\facade\Db;
use app\admin\controller\nk\Article;
use think\facade\View;
/**
* 文章
*
* @icon fa fa-circle-o
*/
class Recruit extends BaseController
{
public function __construct()
{
$this->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);
}
}

View File

@ -0,0 +1,86 @@
<?php
namespace app\admin\controller\nk;
use app\admin\BaseController;
use think\exception\ValidateException;
use think\facade\Db;
use app\admin\controller\nk\Article;
use think\facade\View;
/**
* 文章
*
* @icon fa fa-circle-o
*/
class Regulation extends BaseController
{
public function __construct()
{
$this->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);
}
}

View File

@ -0,0 +1,86 @@
<?php
namespace app\admin\controller\nk;
use app\admin\BaseController;
use think\exception\ValidateException;
use think\facade\Db;
use app\admin\controller\nk\Article;
use think\facade\View;
/**
* 文章
*
* @icon fa fa-circle-o
*/
class SzxcNotice extends BaseController
{
public function __construct()
{
$this->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);
}
}

View File

@ -0,0 +1,86 @@
<?php
namespace app\admin\controller\nk;
use app\admin\BaseController;
use think\exception\ValidateException;
use think\facade\Db;
use app\admin\controller\nk\Article;
use think\facade\View;
/**
* 文章
*
* @icon fa fa-circle-o
*/
class Travel extends BaseController
{
public function __construct()
{
$this->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);
}
}

View File

@ -0,0 +1,668 @@
<?php
namespace app\admin\controller\nk;
use app\admin\BaseController;
use think\facade\View;
use think\facade\Db;
/**
* 文章
*
* @icon fa fa-circle-o
*/
class User extends BaseController
{
public function __construct()
{
$this->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);
}
}

View File

@ -0,0 +1,26 @@
<?php
/**
* @copyright Copyright (c) 2021 勾股工作室
* @license https://opensource.org/licenses/Apache-2.0
* @link https://www.gougucms.com
*/
namespace app\admin\validate\nk;
use think\Validate;
class ArticleValidate extends Validate
{
protected $rule = [
// 'cate_id' => 'require',
'title' => 'require',
// 'thumb' => 'require',
'content' => 'require',
];
protected $message = [
// 'cate_id.require' => '所属分类不能为空',
'title.require' => '文章标题不能为空',
// 'thumb.require' => '缩略图不能为空',
'content.require' => '文章内容不能为空',
];
}

View File

@ -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'
}
]

View File

@ -0,0 +1,102 @@
{extend name="common/base"/}
{block name="style"}
<style type="text/css">
.editormd-code-toolbar select {display: inline-block}
.editormd li {list-style: inherit;}
</style>
{/block}
<!-- 主体 -->
{block name="body"}
<form class="layui-form p-4">
<h3 class="pb-3">新建文章</h3>
<table class="layui-table layui-table-form">
<tr>
<td class="layui-td-gray">文章标题<font>*</font></td>
<td colspan="7"><input type="text" name="title" lay-verify="required" lay-reqText="请输入文章标题"
autocomplete="off" placeholder="请输入文章标题" class="layui-input"></td>
</tr>
<tr>
<td class="layui-td-gray" style="vertical-align:top;">文章摘要</td>
<td colspan="3">
<textarea name="describe" placeholder="请输入摘要不能超过200个字" class="layui-textarea"></textarea>
</td>
<td class="layui-td-gray" style="vertical-align:top;">缩略图</td>
<td>
<div class="layui-upload">
<button type="button" class="layui-btn layui-btn-sm" id="upload_btn_thumb">上传缩略图(尺寸:640x360)</button>
<div class="layui-upload-list" id="upload_box_thumb" style="width: 120px; height:66px; overflow: hidden;">
<img src="" onerror="javascript:this.src='{__GOUGU__}/gougu/images/nonepic600x360.jpg';this.onerror=null;" width="100" style="max-width: 100%; height:66px;"/>
<input type="hidden" name="image" value="">
</div>
</div>
</td>
</tr>
<tr>
<td colspan="6" class="layui-td-gray" style="text-align:left">文章内容</td>
</tr>
<tr>
<td colspan="6">
<textarea class="layui-textarea" id="container_content"></textarea>
</td>
</tr>
</table>
<div class="pt-3">
<button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="webform">立即提交</button>
<button type="reset" class="layui-btn layui-btn-primary">重置</button>
</div>
</form>
{/block}
<!-- /主体 -->
<!-- 脚本 -->
{block name="script"}
<script>
const editorType = '{$editor}';
var moduleInit = ['tool', 'tagpicker', 'tinymce'];
function gouguInit() {
var form = layui.form, tool = layui.tool,tagspicker = layui.tagpicker;
//上传缩略图
var upload_thumb = layui.upload.render({
elem: '#upload_btn_thumb',
url: '/admin/api/upload',
done: function (res) {
//如果上传失败
if (res.code == 1) {
return layer.msg('上传失败');
}
//上传成功
$('#upload_box_thumb input').attr('value', res.data.filepath);
$('#upload_box_thumb img').attr('src', res.data.filepath);
}
});
var editor = layui.tinymce;
var edit = editor.render({
selector: "#container_content",
height: 500
});
//监听提交
form.on('submit(webform)', function (data) {
data.field.content = tinyMCE.editors['container_content'].getContent();
if (data.field.content == '') {
layer.msg('请先完善文章内容');
return false;
}
let callback = function (e) {
layer.msg(e.msg);
if (e.code == 0) {
tool.tabRefresh(71);
tool.sideClose(1000);
}
}
tool.post('{$url[1]}', data.field, callback);
return false;
});
}
</script>
{/block}
<!-- /脚本 -->

View File

@ -0,0 +1,205 @@
{extend name="common/base"/}
{block name="style"}
<style type="text/css">
.editormd-code-toolbar select {
display: inline-block
}
.editormd li {
list-style: inherit;
}
</style>
{/block}
<!-- 主体 -->
{block name="body"}
<form class="layui-form p-4">
<div class="layui-form-item">
<label class="layui-form-label">用户</label>
<div class="layui-input-block">
<input type="text" value="{$user.nickname}" autocomplete="off" class="layui-input" disabled>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">级别</label>
<div class="layui-input-block">
<select name="auth_range" lay-verify="required">
{volist name='auth_range' id='vo'}
<option value="{$vo.value}" {if $vo.value==$address['auth_range']} selected{/if}>{$vo.name}</option>
{/volist}
</select>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">区县</label>
<div class="layui-input-block">
<select name="area_id" lay-filter="area_id" lay-verify="required">
{volist name='street' id='vo'}
<option value="{$vo.code}">{$vo.name}</option>
{/volist}
</select>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">街道/镇</label>
<div class="layui-input-block">
<div id="demo1"></div>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">村/社区</label>
<div class="layui-input-block">
<div id="demo2"></div>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">大队</label>
<div class="layui-input-block">
<select name="brigade_id" lay-verify="required">
{volist name='brigade' id='vo'}
<option value="{$vo.id}" {if $vo.id==$address['brigade_id']} selected {/if}>{$vo.brigade_name}</option>
{/volist}
</select>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">后台权限</label>
<div class="layui-input-block">
<select name="groupdata" lay-verify="required">
{volist name='groupdata' id='vo'}
<option value="{$vo.id}" {if $vo.id==$address['admin_group']} selected {/if}>{$vo.name}</option>
{/volist}
</select>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">前端权限</label>
<div class="layui-input-block">
<select name="group_id" lay-verify="required">
{volist name='user_group' id='vo'}
<option value="{$vo.id}" {if $vo.id==$address['auth_range']} selected {/if}>{$vo.name}</option>
{/volist}
</select>
</div>
</div>
</div>
<div class="pt-3">
<button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="webform">立即提交</button>
<button type="reset" class="layui-btn layui-btn-primary">重置</button>
</div>
</form>
{/block}
<!-- /主体 -->
<!-- 脚本 -->
{block name="script"}
<script src="/static/assets/js/xm-select.js"></script>
<script>
const editorType = '{$editor}';
var moduleInit = ['tool', 'tagpicker', 'tinymce'];
var area_id = "{$address.area_id}"
var street_id = "{$address.street_id}"
function gouguInit () {
var form = layui.form, tool = layui.tool, tagspicker = layui.tagpicker;
//上传缩略图
var upload_thumb = layui.upload.render({
elem: '#upload_btn_thumb',
url: '/admin/api/upload',
done: function (res) {
//如果上传失败
if (res.code == 1) {
return layer.msg('上传失败');
}
//上传成功
$('#upload_box_thumb input').attr('value', res.data.filepath);
$('#upload_box_thumb img').attr('src', res.data.filepath);
}
});
var editor = layui.tinymce;
var edit = editor.render({
selector: "#container_content",
height: 500
});
if (area_id != 0) {
street(area_id)
}
if (street_id != 0) {
village(street_id)
}
// $('#c-area_id').change(function () {
// //获取option元素上的value值
// var val = $(this).find('option:selected').val();
// if (val != undefined) {
// street(val)
// }
// });
form.on('select(street)', function (data) {
street(data.value)
});
function street (id) {
var demo1 = xmSelect.render({
name: 'street_id',
el: '#demo1',
initValue: [street_id],
prop: {
name: 'name',
value: 'code',
},
data: [],
radio: true,
on: function (data) {
var arr = data.arr;
village(arr[0]['code'])
},
})
$.get('/api/geo/street?pcode=' + id, function (result) {
demo1.update({
data: result.data
})
});
}
function village (id) {
var demo2 = xmSelect.render({
name: 'village_id',
el: '#demo2',
initValue: ["{$address.village_code}"],
prop: {
name: 'name',
value: 'code',
},
data: [],
radio: true,
})
$.get('/api/geo/village?pcode=' + id, function (result) {
demo2.update({
data: result.data
})
});
//监听提交
var editor = layui.tinymce;
var edit = editor.render({
selector: "#container_content",
height: 500
});
form.on('submit(webform)', function (data) {
let callback = function (e) {
layer.msg(e.msg);
if (e.code == 0) {
tool.tabRefresh(71);
tool.sideClose(1000);
}
}
tool.post('{$url[5]}?id={$id}', data.field, callback);
return false;
});
}
}
</script>
{/block}
<!-- /脚本 -->

View File

@ -0,0 +1,546 @@
{extend name="common/base"/}
{block name="style"}
<style type="text/css">
.editormd-code-toolbar select {
display: inline-block
}
.editormd li {
list-style: inherit;
}
</style>
{/block}
<!-- 主体 -->
{block name="body"}
<div class="layui-form p-4">
<h3 class="pb-3">用户信息</h3>
<div class="layui-tab layui-tab-card">
<ul class="layui-tab-title">
<li class="layui-this">个人信息</li>
<!-- <li>家庭信息</li> -->
<li>种植信息</li>
<li>保险信息</li>
<li>健康信息</li>
</ul>
<div class="layui-tab-content">
<div class="layui-tab-item layui-show">
<form class="layui-form p-4">
<div class="layui-form-item">
<label class="layui-form-label">用户</label>
<div class="layui-input-block">
<input type="text" value="{$user.name}" autocomplete="off" class="layui-input" disabled>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">民族</label>
<div class="layui-input-block">
<select name="nation" lay-verify="required">
{volist name='all_category' id='vo'}
{if $vo.type == 'nation'}
<option value="{$vo.id}" {if $vo.id==$user['nation']} selected{/if}>{$vo.name}</option>
{/if}
{/volist}
</select>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">婚姻情况</label>
<div class="layui-input-block">
<select name="marital_status" lay-verify="required">
{volist name='all_category' id='vo'}
{if $vo.type == 'marriage'}
<option value="{$vo.id}" {if $vo.id==$user['marital_status']} selected{/if}>{$vo.name}
</option>
{/if}
{/volist}
</select>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">政治面貌</label>
<div class="layui-input-block">
<select name="political_outlook" lay-verify="required">
{volist name='all_category' id='vo'}
{if $vo.type == 'zzmm'}
<option value="{$vo.id}" {if $vo.id==$user['political_outlook']} selected{/if}>
{$vo.name}</option>
{/if}
{/volist}
</select>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">手机号码</label>
<div class="layui-input-block">
<input type="text" name="phone" value="{$user.phone}" autocomplete="off" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">身份证号</label>
<div class="layui-input-block">
<input type="text" name="idcard" value="{$user.idcard}" autocomplete="off" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">性别</label>
<div class="layui-input-block">
<select name="gender" lay-verify="required">
<option value="1" {if 1==$user['gender']} selected{/if}></option>
<option value="2" {if 2==$user['gender']} selected{/if}></option>
</select>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">年龄</label>
<div class="layui-input-block">
<input type="text" value="{$user.age}" name="age" autocomplete="off" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">文化程度</label>
<div class="layui-input-block">
<select name="education" lay-verify="required">
{volist name='all_category' id='vo'}
{if $vo.type == 'education'}
<option value="{$vo.id}" {if $vo.id==$user['education']} selected{/if}>{$vo.name}
</option>
{/if}
{/volist}
</select>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">职业</label>
<div class="layui-input-block">
<select name="occupation" lay-verify="required">
{volist name='all_category' id='vo'}
{if $vo.type == 'occupation'}
<option value="{$vo.id}" {if $vo.id==$user['occupation']} selected{/if}>{$vo.name}
</option>
{/if}
{/volist}
</select>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">房屋情况</label>
<div class="layui-input-block">
<select name="house_msg" lay-verify="required">
{volist name='all_category' id='vo'}
{if $vo.type == 'house'}
<option value="{$vo.id}" {if $vo.id==$user['house_msg']} selected{/if}>{$vo.name}
</option>
{/if}
{/volist}
</select>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">车辆情况</label>
<div class="layui-input-block">
<select name="car_msg" lay-verify="required">
{volist name='all_category' id='vo'}
{if $vo.type == 'car'}
<option value="{$vo.id}" {if $vo.id==$user['car_msg']} selected{/if}>{$vo.name}</option>
{/if}
{/volist}
</select>
</div>
</div>
<div class="pt-3">
<button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="webform1">立即提交</button>
<button type="reset" class="layui-btn layui-btn-primary">重置</button>
</div>
</form>
</div>
<div class="layui-tab-item">
<form class="layui-form p-4">
<div class="layui-form-item">
<label class="layui-form-label">土地外租</label>
<div class="layui-input-block">
<select name="is_wz" class="form-control selectpicker">
<option value=""></option>
<option value="1" {if $planting['is_wz']==1} selected {/if}></option>
<option value="0" {if $planting['is_wz']==0} selected {/if}></option>
</select>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">土地性质</label>
<div class="layui-input-block">
<select name="nature_of_land" class="form-control selectpicker">
<option value=""></option>
{volist name="all_category" id="vo"}
{if $vo.type == 'nature_of_land'}
<option value="{$vo.id}" {if $vo.id eq $planting['nature_of_land']} selected {/if}>{$vo.name}</option>
{/if}
{/volist}
</select>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">土地面积</label>
<div class="layui-input-block">
<input type="text" value="{$planting['land_area']}" autocomplete="off" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">农作物信息</label>
<div id="aa">
<div class="layui-input-inline">
农作物名称 <input type="text" name="like[name]" autocomplete="off" class="layui-input">
</div>
<div class="layui-input-inline">
数量 <input type="text" name="like[num]" autocomplete="off" class="layui-input">
</div>
<div class="layui-input-inline">
面积 <input type="text" name="like[mianji]" autocomplete="off" class="layui-input">
</div>
</div>
<button type="button" class="layui-btn layui-btn-normal" id="b1">添加</button>
</div>
<div class="pt-3">
<button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="webform2">立即提交</button>
<button type="reset" class="layui-btn layui-btn-primary">重置</button>
</div>
</form>
</div>
<div class="layui-tab-item">
<form class="layui-form p-4">
<div class="layui-form-item">
<label class="layui-form-label">养老保险状态</label>
<div class="layui-input-block">
<select name="endowment_insurance_status" class="form-control selectpicker" >
<option value=""></option>
<option value="1" {if $insurancearr.endowment_insurance_status ==1} selected {/if}>已交</option>
<option value="2" {if $insurancearr.endowment_insurance_status ==2} selected {/if}>未交</option>
<option value="3" {if $insurancearr.endowment_insurance_status ==3} selected {/if}>代缴</option>
</select>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">参保类型</label>
<div class="layui-input-block">
<select name="insurance_type" class="form-control selectpicker" >
<option value=""></option>
{foreach name="all_category" item="vo"}
{if $vo.type == 'Medical_insurance_type'}
<option value="{$vo.id}" {if $vo.id eq $insurancearr.insurance_type} selected {/if}>{$vo.name}</option>
{/if}
{/foreach}
</select>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">是否残疾</label>
<div class="layui-input-block">
<select name="whether_disabled" class="form-control selectpicker" >
<option value=""></option>
{foreach name="all_category" item="vo"}
{if $vo.type == 'whether_disabled'}
<option value="{$vo.id}" {if $vo.id eq $insurancearr.whether_disabled} selected {/if}>{$vo.name}</option>
{/if}
{/foreach}
</select>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">残疾证号</label>
<div class="layui-input-block">
<input type="text" value="{$insurancearr['disability_num']}" autocomplete="off" class="layui-input" name="disability_num">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">残疾等级</label>
<div class="layui-input-block">
<select name="disability_type" class="form-control selectpicker" >
<option value=""></option>
{foreach name="all_category" item="vo"}
{if $vo.type == 'grade'}
<option value="{$vo.id}" {if $vo.id eq $insurancearr.disability_level} selected {/if}>{$vo.name}</option>
{/if}
{/foreach}
</select>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">农业保险</label>
<div class="layui-input-block">
<select name="ny_insurance" class="form-control selectpicker" >
<option value=""></option>
{foreach name="all_category" item="vo"}
{if $vo.type == 'Insurance' && $vo.pid == 194}
<option value="{$vo.id}" {if $vo.id eq $insurancearr.ny_insurance} selected {/if}>{$vo.name}</option>
{/if}
{/foreach}
</select>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">商业保险</label>
<div class="layui-input-block">
<select name="sy_insurance" class="form-control selectpicker" >
<option value=""></option>
{foreach name="all_category" item="vo"}
{if $vo.type == 'Insurance' && $vo.pid == 193}
<option value="{$vo.id}" {if $vo.id eq $insurancearr.sy_insurance} selected {/if}>{$vo.name}</option>
{/if}
{/foreach}
</select>
</div>
</div>
<div class="pt-3">
<button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="webform3">立即提交</button>
<button type="reset" class="layui-btn layui-btn-primary">重置</button>
</div>
</form>
</div>
<div class="layui-tab-item">
<form class="layui-form p-4">
<div class="layui-form-item">
<label class="layui-form-label">血型</label>
<div class="layui-input-block">
<select name="blood_type" class="form-control selectpicker" >
<option value=""></option>
{foreach name="all_category" item="vo"}
{if $vo.type == 'blood_type'}
<option value="{$vo.id}" {if $healthyarr.blood_type ==$vo.id} selected {/if} >{$vo.name}</option>
{/if}
{/foreach}
</select>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">药物过敏史</label>
<div class="layui-input-block">
<select name="drug_allergy" class="form-control selectpicker" >
<option value=""></option>
{foreach name="all_category" item="vo"}
{if $vo.type == 'drug_allergy'}
<option value="{$vo.id}" {if $healthyarr.drug_allergy ==$vo.id} selected {/if}>{$vo.name}</option>
{/if}
{/foreach}
</select>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">暴露史</label>
<div class="layui-input-block">
<select name="exposure_history" class="form-control selectpicker" >
<option value=""></option>
{foreach name="all_category" item="vo"}
{if $vo.type == 'drug_allergy'}
<option value="{$vo.id}" {if $healthyarr.exposure_history ==$vo.id} selected {/if}>{$vo.name}</option>
{/if}
{/foreach}
</select>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">疾病史</label>
<div class="layui-input-block">
<select name="history_of_disease" class="form-control selectpicker" >
<option value=""></option>
{foreach name="all_category" item="vo"}
{if $vo.type == 'history_of_disease'}
<option value="{$vo.id}" {if $healthyarr.history_of_disease ==$vo.id} selected {/if}>{$vo.name}</option>
{/if}
{/foreach}
</select>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">手术史</label>
<div class="layui-input-block">
<select name="history_of_surgery" class="form-control selectpicker" >
<option value=""></option>
<option value="1" {if $healthyarr.history_of_surgery ==1} selected {/if}></option>
<option value="0" {if $healthyarr.history_of_surgery ==0} selected {/if}></option>
</select>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">家族史</label>
<div class="layui-input-block">
<select name="family_history" class="form-control selectpicker" >
<option value=""></option>
{foreach name="all_category" item="vo"}
{if $vo.type == 'familyHistory'}
<option value="{$vo.id}" {if $healthyarr.family_history ==$vo.id} selected {/if}>{$vo.name}</option>
{/if}
{/foreach}
</select>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">家族疾病</label>
<div class="layui-input-block">
<select name="familial_diseases" class="form-control selectpicker" >
<option value=""></option>
{foreach name="all_category" item="vo"}
{if $vo.type == 'history_of_disease'}
<option value="{$vo.id}" {if $healthyarr.familial_diseases ==$vo.id} selected {/if}>{$vo.name}</option>
{/if}
{/foreach}
</select>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">遗传病史</label>
<div class="layui-input-block">
<select name="genetic_history" class="form-control selectpicker" >
<option value=""></option>
{foreach name="all_category" item="vo"}
{if $vo.type == 'history_of_disease'}
<option value="{$vo.id}" {if $healthyarr.genetic_history ==$vo.id} selected {/if} >{$vo.name}</option>
{/if}
{/foreach}
</select>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">疾病名称</label>
<div class="layui-input-block">
<select name="genetic_name" class="form-control selectpicker" >
<option value=""></option>
{foreach name="all_category" item="vo"}
{if $vo.type == 'history_of_disease'}
<option value="{$vo.id}" {if $healthyarr.genetic_name ==$vo.id} selected {/if}>{$vo.name}</option>
{/if}
{/foreach}
</select>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">厨房排风设施</label>
<div class="layui-input-block">
<select name="cfpfss" class="form-control selectpicker" >
<option value=""></option>
{foreach name="all_category" item="vo"}
{if $vo.type == 'cfpfss'}
<option value="{$vo.id}" {if $healthyarr.cfpfss ==$vo.id} selected {/if}>{$vo.name}</option>
{/if}
{/foreach}
</select>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">燃料类型</label>
<div class="layui-input-block">
<select name="fuel_type" class="form-control selectpicker" >
<option value=""></option>
{foreach name="all_category" item="vo"}
{if $vo.type == 'fuel_type'}
<option value="{$vo.id}" {if $healthyarr.fuel_type ==$vo.id} selected {/if} >{$vo.name}</option>
{/if}
{/foreach}
</select>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">饮水情况</label>
<div class="layui-input-block">
<select name="drinking_water" class="form-control selectpicker" >
<option value=""></option>
{foreach name="all_category" item="vo"}
{if $vo.type == 'drinking_water'}
<option value="{$vo.id}" {if $healthyarr.drinking_water ==$vo.id} selected {/if}>{$vo.name}</option>
{/if}
{/foreach}
</select>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">厕所情况</label>
<div class="layui-input-block">
<select name="toilet_msg" class="form-control selectpicker" >
<option value=""></option>
{foreach name="all_category" item="vo"}
{if $vo.type == 'toilet_msg'}
<option value="{$vo.id}" {if $healthyarr.toilet_msg ==$vo.id} selected {/if}>{$vo.name}</option>
{/if}
{/foreach}
</select>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">禽畜栏</label>
<div class="layui-input-block">
<select name="poultry_corral" class="form-control selectpicker" >
<option value=""></option>
{foreach name="all_category" item="vo"}
{if $vo.type == 'poultry_corral'}
<option value="{$vo.id}" {if $healthyarr.poultry_corral ==$vo.id} selected {/if}>{$vo.name}</option>
{/if}
{/foreach}
</select>
</div>
</div>
<div class="pt-3">
<button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="webform4">立即提交</button>
<button type="reset" class="layui-btn layui-btn-primary">重置</button>
</div>
</form>
</div>
<div class="layui-tab-item">
5
</div>
</div>
</div>
{/block}
<!-- /主体 -->
<!-- 脚本 -->
{block name="script"}
<script>
var moduleInit = ['tool'];
function gouguInit () {
var form = layui.form, tool = layui.tool;
//监听提交
form.on('submit(webform1)', function (data) {
let callback = function (e) {
layer.msg(e.msg);
if (e.code == 0) {
tool.sideClose(1000);
}
}
tool.post("{$url[6]}?type=1&user_id={$user_id}", data.field, callback);
return false;
});
form.on('submit(webform2)', function (data) {
let callback = function (e) {
layer.msg(e.msg);
if (e.code == 0) {
tool.sideClose(1000);
}
}
tool.post("{$url[6]}?type=2&user_id={$user_id}", data.field, callback);
return false;
});
form.on('submit(webform3)', function (data) {
let callback = function (e) {
layer.msg(e.msg);
if (e.code == 0) {
tool.sideClose(1000);
}
}
tool.post("{$url[6]}?type=3&user_id={$user_id}", data.field, callback);
return false;
});
form.on('submit(webform4)', function (data) {
let callback = function (e) {
layer.msg(e.msg);
if (e.code == 0) {
tool.sideClose(1000);
}
}
tool.post("{$url[6]}?type=4&user_id={$user_id}", data.field, callback);
return false;
});
}
</script>
{/block}
<!-- /脚本 -->

View File

@ -0,0 +1,149 @@
{extend name="common/base"/}
<!-- 主体 -->
{block name="body"}
<div class="p-3">
<form class="layui-form gg-form-bar border-t border-x">
<div class="layui-input-inline" style="width:300px;">
<input type="text" name="keywords" placeholder="请输入关键字" class="layui-input" autocomplete="off" />
</div>
<button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="searchform">提交搜索</button>
</form>
<table class="layui-hide" id="article" lay-filter="article"></table>
</div>
<script type="text/html" id="status">
<i class="layui-icon {{# if(d.status == 1){ }}layui-icon-ok{{# } else { }}layui-icon-close{{# } }}"></i>
</script>
<script type="text/html" id="is_home">
<i class="layui-icon {{# if(d.is_home == 1){ }}layui-icon-ok{{# } else { }}layui-icon-close{{# } }}"></i>
</script>
<script type="text/html" id="toolbarDemo">
<div class="layui-btn-container">
<span class="layui-btn layui-btn-sm" lay-event="add" data-title="添加文章表">+ 添加文章表</span>
</div>
</script>
<script type="text/html" id="barDemo">
<div class="layui-btn-group">
<a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="read">用户信息</a>
<a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="auths">权限管理</a>
<a class="layui-btn layui-btn-xs" lay-event="edit">信息维护</a>
<a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a></div>
</script>
{/block}
<!-- /主体 -->
<!-- 脚本 -->
{block name="script"}
<script>
const moduleInit = ['tool'];
function gouguInit() {
var table = layui.table,tool = layui.tool, form = layui.form;
layui.pageTable = table.render({
elem: '#article',
title: '文章表列表',
toolbar: '#toolbarDemo',
url: '{$url[0]}',
page: true,
limit: 20,
cellMinWidth: 300,
cols: [
[
{
fixed: 'left',
field: 'id',
title: '编号',
align: 'center',
},{
field: 'group_name',
title: '角色组',
},{
field: 'name',
title: '姓名',
align: 'center',
},{
field: 'phone',
title: '手机号',
align: 'center',
},{
field: 'avatar',
title: '头像',
align: 'center',
templet: '<div><img src="{{ d.avatar }}" style="width:30px; height:30px;"></div>',
},{
field: 'gender',
title: '性别',
align: 'center',
},{
field: 'count',
title: '家庭成员',
align: 'center',
},{
fixed: 'right',
field: 'right',
title: '操作',
toolbar: '#barDemo',
align: 'center'
}
]
]
});
//监听表头工具栏事件
table.on('toolbar(article)', function(obj){
if (obj.event === 'add') {
tool.side('{$url[1]}');
return false;
}
});
//监听表格行工具事件
table.on('tool(article)', function(obj) {
var data = obj.data;
if (obj.event === 'read') {
tool.side('{$url[4]}?id='+obj.data.id);
}
else if (obj.event === 'edit') {
tool.side('{$url[2]}?id='+obj.data.id);
}
else if (obj.event === 'auths') {
tool.side('/admin/nk.user/auths?id='+obj.data.id);
}
else if (obj.event === 'del') {
layer.confirm('确定要删除该记录吗?', {
icon: 3,
title: '提示'
}, function(index) {
let callback = function (e) {
layer.msg(e.msg);
if (e.code == 0) {
obj.del();
}
}
tool.delete('{$url[3]}', { id: data.id }, callback);
layer.close(index);
});
}
return false;
});
//监听搜索提交
form.on('submit(searchform)', function(data) {
layui.pageTable.reload({
where: {
keywords: data.field.keywords,
cate_id: data.field.cate_id
},
page: {
curr: 1
}
});
return false;
});
}
</script>
{/block}
<!-- /脚本 -->

View File

@ -0,0 +1,265 @@
{extend name="common/base"/}
{block name="style"}
<style>
.content-article img {
max-width: 88% !important;
height: auto !important;
margin: 6px 0 !important;
border-radius: 4px;
}
</style>
{/block}
<!-- 主体 -->
{block name="body"}
<div class="layui-form p-4">
<h3 class="pb-3">用户信息</h3>
<div class="layui-tab layui-tab-card">
<ul class="layui-tab-title">
<li class="layui-this">个人信息</li>
<li>家庭信息</li>
{if $planting.is==1 }
<li>种植信息</li>
{/if}
<li>保险信息</li>
<li>健康信息</li>
</ul>
<div class="layui-tab-content">
<div class="layui-tab-item layui-show">
<table class="layui-table layui-table-form" id="test1">
<tr>
<td class="layui-td-gray">姓名</td>
<td>{$read.name|default='无'}</td>
<td class="layui-td-gray">民族</td>
<td>
{$read.nation|default='无'}
</td>
</tr>
<tr>
<td class="layui-td-gray">婚姻情况</td>
<td>
{$read.marital_status|default='无'}
</td>
<td class="layui-td-gray">政治面貌</td>
<td>
{$read.political_outlook|default='无'}
</td>
</tr>
<tr>
<td class="layui-td-gray">手机号码</td>
<td>{$read.phone|default='无'}</td>
<td class="layui-td-gray">身份证号</td>
<td>
{$read.idcard|default='无'}
</td>
</tr>
<tr>
<td class="layui-td-gray">性别</td>
<td>
{$read.gender|default='无'}
</td>
<td class="layui-td-gray">年龄</td>
<td>
{$read.age|default='无'}
</td>
</tr>
<tr>
<td class="layui-td-gray">文化程度</td>
<td>{$read.education|default='无'}</td>
<td class="layui-td-gray">职业</td>
<td>
{$read.occupation|default='无'}
</td>
</tr>
<tr>
<td class="layui-td-gray">房屋情况</td>
<td>
{$read.house_msg|default='无'}
</td>
<td class="layui-td-gray">车辆情况</td>
<td>
{$read.car_msg|default='无'}
</td>
</tr>
</table>
</div>
<div class="layui-tab-item">
<table class="layui-table layui-table-form" id="test1">
<tr>
<td class="layui-td-gray">户主</td>
<td>{$family.name|default='无'}</td>
<td class="layui-td-gray">关系</td>
<td>
{$family.relation|default='无'}
</td>
</tr>
</table>
<h3 style="padding: 5px;">其他家庭成员</h3>
{volist name="family.list" id="vo"}
<table class="layui-table layui-table-form" id="test1">
<tr>
<td class="layui-td-gray">姓名</td>
<td>
{$vo.name|default='无'}&nbsp;&nbsp;&nbsp;&nbsp;<a href="/admin/nk.user/read?id={$vo.user_id}"
target="_blank">更多详情 点击此跳转</a>
</td>
<td class="layui-td-gray">年龄</td>
<td>
{$vo.age|default='无'}
</td>
</tr>
<tr>
<td class="layui-td-gray">性别</td>
<td>{$vo.gender==1?'男':'女'}</td>
<td class="layui-td-gray">手机号码</td>
<td>
{$vo.phone|default='无'}
</td>
</tr>
{/volist}
</table>
</div>
{if $planting.is==1 }
<div class="layui-tab-item">
<table class="layui-table layui-table-form" id="test1">
<tr>
<td class="layui-td-gray">土地外租</td>
<td>{$planting.list.is_wz|default='无'}</td>
</tr>
<tr>
<td class="layui-td-gray">土地性质</td>
<td>{$planting.list.nature_of_land|default='无'}</td>
</tr>
<tr>
<td class="layui-td-gray">土地面积</td>
<td>{$planting3.list.land_area|default='无'}</td>
</tr>
</table>
<h3 style="padding: 5px;">农作物信息</h3>
<table class="layui-table layui-table-form" id="test1">
{notempty name="planting.list.breed_msg"}
{volist name='planting.list.crops_msg' id='vo' }
<tr>
<td class="layui-td-gray">农作物</td>
<td>{$vo.name}</td>
<td class="layui-td-gray">数量</td>
<td>{$vo.num}</td>
<td class="layui-td-gray">面积</td>
<td>{$vo.mianji}</td>
</tr>
{/volist}
{/notempty}
</table>
<h3 style="padding: 5px;">养殖信息</h3>
<table class="layui-table layui-table-form" id="test1">
{notempty name="planting.list.breed_msg"}
{volist name='planting.list.breed_msg' id='vo' }
<tr>
<td class="layui-td-gray">养殖物</td>
<td>{$vo.name}</td>
<td class="layui-td-gray">数量</td>
<td>{$vo.num}</td>
<td class="layui-td-gray">面积</td>
<td>{$vo.mianji}</td>
</tr>
{/volist}
{/notempty}
</table>
<h3 style="padding: 5px;">农具信息</h3>
<table class="layui-table layui-table-form" id="test1">
{notempty name="planting.list.tools_msg"}
{volist name='planting.list.tools_msg' id='vo' }
<tr>
<td class="layui-td-gray">农具</td>
<td>{$vo.name}</td>
<td class="layui-td-gray">数量</td>
<td>{$vo.num}</td>
</tr>
{/volist}
{/notempty}
</table>
</div>
{/if}
<div class="layui-tab-item">
<table class="layui-table layui-table-form" id="test1">
<tr>
<td class="layui-td-gray">养老保险状态</td>
<td>{$insurancearr.endowment_insurance_status|default='无'}</td>
<td class="layui-td-gray">参保类型</td>
<td>{$insurancearr.insurance_type|default='无'}</td>
</tr>
<tr>
<td class="layui-td-gray">是否残疾</td>
<td>{$insurancearr.whether_disabled|default='无'}</td>
<td class="layui-td-gray">残疾证号</td>
<td>{$insurancearr.disability_num|default='无'}</td>
</tr>
<tr>
<td class="layui-td-gray">残疾等级</td>
<td>{$insurancearr.disability_level|default='无'}</td>
<td class="layui-td-gray">农业保险</td>
<td>{$insurancearr.ny_insurance|default='无'}</td>
</tr>
<tr>
<td class="layui-td-gray">商业保险</td>
<td>{$insurancearr.sy_insurance|default='无'}</td>
</tr>
</table>
</div>
<div class="layui-tab-item">
<table class="layui-table layui-table-form" id="test1">
<tr>
<td class="layui-td-gray">血型</td>
<td>{$healthyarr.blood_type|default='无'}</td>
<td class="layui-td-gray">药物过敏史</td>
<td>{$healthyarr.drug_allergy|default='无'}</td>
</tr>
<tr>
<td class="layui-td-gray">暴露史</td>
<td>{$healthyarr.exposure_history|default='无'}</td>
<td class="layui-td-gray">疾病史</td>
<td>{$healthyarr.history_of_disease|default='无'}</td>
</tr>
<tr>
<td class="layui-td-gray">手术史</td>
<td>{$healthyarr.history_of_surgery|default='无'}</td>
<td class="layui-td-gray">家族史</td>
<td>{$healthyarr.family_history|default='无'}</td>
</tr>
<tr>
<td class="layui-td-gray">家族疾病</td>
<td>{$healthyarr.familial_diseases|default='无'}</td>
<td class="layui-td-gray">遗传病史</td>
<td>{$healthyarr.genetic_history|default='无'}</td>
</tr>
<tr>
<td class="layui-td-gray">遗传病史</td>
<td>{$healthyarr.genetic_name|default='无'}</td>
<td class="layui-td-gray">厨房排风设施</td>
<td>{$healthyarr.cfpfss|default='无'}</td>
</tr>
<tr>
<td class="layui-td-gray">燃料类型</td>
<td>{$healthyarr.fuel_type|default='无'}</td>
<td class="layui-td-gray">饮水情况</td>
<td>{$healthyarr.drinking_water|default='无'}</td>
</tr>
<tr>
<td class="layui-td-gray">厕所情况</td>
<td>{$healthyarr.toilet_msg|default='无'}</td>
<td class="layui-td-gray">禽畜栏</td>
<td>{$healthyarr.poultry_corral|default='无'}</td>
</tr>
</table>
</div>
<div class="layui-tab-item">6</div>
</div>
</div>
</div>
{/block}
<!-- /主体 -->

View File

@ -1,4 +1,6 @@
<?php
use think\facade\Env;
return [
// 默认使用的数据库连接配置
'default' => 'mysql',
@ -14,23 +16,23 @@ return [
'connections' => [
'mysql' => [
// 数据库类型
'type' => 'mysql',
'type' => Env::get('database.type', 'mysql'),
// 服务器地址
'hostname' => '127.0.0.1',
'hostname' => Env::get('database.hostname', '127.0.0.1'),
// 数据库名
'database' => 'gougucms',
'database' => Env::get('database.database', ''),
// 用户名
'username' => 'root',
'username' => Env::get('database.username', 'root'),
// 密码
'password' => '123456',
'password' => Env::get('database.password', ''),
// 端口
'hostport' => '3306',
'hostport' => Env::get('database.hostport', '3306'),
// 数据库表前缀
'prefix' => 'cms_',
'prefix' => Env::get('database.prefix', ''),
// 数据库连接参数
'params' => [],
// 数据库编码默认采用utf8mb4
'charset' => 'utf8mb4',
'charset' => Env::get('database.charset', 'utf8'),
// 数据库调试模式
'debug' => false,
// 数据库部署方式:0 集中式(单一服务器),1 分布式(主从服务器)
@ -50,5 +52,25 @@ return [
// 开启字段缓存
'fields_cache' => false,
],
'shop' => [
// 数据库类型
'type' => Env::get('databaseshop.type', 'mysql'),
// 服务器地址
'hostname' => Env::get('databaseshop.hostname', '127.0.0.1'),
// 数据库名
'database' => Env::get('databaseshop.database', ''),
// 用户名
'username' => Env::get('databaseshop.username', 'root'),
// 密码
'password' => Env::get('databaseshop.password', ''),
// 端口
'hostport' => Env::get('databaseshop.hostport', '3306'),
// 数据库连接参数
'params' => [],
// 数据库编码默认采用utf8
'charset' => Env::get('databaseshop.charset', 'utf8'),
// 数据库表前缀
'prefix' => Env::get('databaseshop.prefix', ''),
],
],
];

File diff suppressed because one or more lines are too long