更新2
This commit is contained in:
parent
caaa7bd333
commit
ee0f1a6ac6
@ -50,6 +50,8 @@ class Login
|
||||
'login_num' => $admin['login_num'] + 1,
|
||||
];
|
||||
Db::name('admin')->where(['id' => $admin['id']])->update($data);
|
||||
$group_access=Db::name('admin_group_access')->where(['uid' => $admin['id']])->find();
|
||||
$admin['group_access']=$group_access['group_id'];
|
||||
$session_admin = get_config('app.session_admin');
|
||||
Session::set($session_admin, $admin);
|
||||
$token = make_token();
|
||||
|
@ -23,9 +23,7 @@ class Article extends BaseController
|
||||
|
||||
public function index($params)
|
||||
{
|
||||
$where=[
|
||||
'status'=>1
|
||||
];
|
||||
$where[]=['status','=',1];
|
||||
if (isset($params['keywords'])){
|
||||
$where[]=['title','like','%'.$params['keywords'].'%'];
|
||||
}
|
||||
@ -75,6 +73,7 @@ class Article extends BaseController
|
||||
->where($map)
|
||||
->page($params['page'])
|
||||
->limit($params['limit'])
|
||||
->order('id desc')
|
||||
->field('id,title,user_id,county,township,village,image,view_time')
|
||||
|
||||
->select();
|
||||
|
86
app/admin/controller/nk/Classroom.php
Normal file
86
app/admin/controller/nk/Classroom.php
Normal 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 Classroom extends BaseController
|
||||
{
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->adminInfo = get_login_admin();
|
||||
$this->category_id=298;
|
||||
$this->url=[
|
||||
'/admin/nk.classroom/index?category_id='.$this->category_id,
|
||||
'/admin/nk.classroom/add',
|
||||
'/admin/nk.classroom/edit',
|
||||
'/admin/nk.classroom/del',
|
||||
'/admin/nk.classroom/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);
|
||||
}
|
||||
}
|
86
app/admin/controller/nk/Education.php
Normal file
86
app/admin/controller/nk/Education.php
Normal 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 Education extends BaseController
|
||||
{
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->adminInfo = get_login_admin();
|
||||
$this->category_id=299;
|
||||
$this->url=[
|
||||
'/admin/nk.education/index?category_id='.$this->category_id,
|
||||
'/admin/nk.education/add',
|
||||
'/admin/nk.education/edit',
|
||||
'/admin/nk.education/del',
|
||||
'/admin/nk.education/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);
|
||||
}
|
||||
}
|
86
app/admin/controller/nk/Profile.php
Normal file
86
app/admin/controller/nk/Profile.php
Normal 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 Profile extends BaseController
|
||||
{
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->adminInfo = get_login_admin();
|
||||
$this->category_id=296;
|
||||
$this->url=[
|
||||
'/admin/nk.profile/index?category_id='.$this->category_id,
|
||||
'/admin/nk.profile/add',
|
||||
'/admin/nk.profile/edit',
|
||||
'/admin/nk.profile/del',
|
||||
'/admin/nk.profile/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);
|
||||
}
|
||||
}
|
86
app/admin/controller/nk/System.php
Normal file
86
app/admin/controller/nk/System.php
Normal 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 System extends BaseController
|
||||
{
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->adminInfo = get_login_admin();
|
||||
$this->category_id=297;
|
||||
$this->url=[
|
||||
'/admin/nk.system/index?category_id='.$this->category_id,
|
||||
'/admin/nk.system/add',
|
||||
'/admin/nk.system/edit',
|
||||
'/admin/nk.system/del',
|
||||
'/admin/nk.system/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);
|
||||
}
|
||||
}
|
@ -36,17 +36,14 @@ class User extends BaseController
|
||||
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 (!empty($post['keywords'])) {
|
||||
$mmm[] = ['m.name', 'LIKE', '%' . $post['keywords'] . '%'];
|
||||
}
|
||||
if (!empty($post['phone'])) {
|
||||
|
||||
$mmm[] = ['m.phone', 'LIKE', '%' . $post['phone'] . '%'];
|
||||
}
|
||||
|
||||
//权限组信息
|
||||
if ($this->adminInfo['position_id'] != 1) {
|
||||
$find = Db::table('fa_szxc_information_useraddress')->where('user_id', $this->adminInfo['id'])->find();
|
||||
@ -65,17 +62,18 @@ class User extends BaseController
|
||||
$mmm['area_id'] = $post['area_id'];
|
||||
}
|
||||
if (isset($post['street_id']) && !empty($post['street_id'])) {
|
||||
$mmm['street_id'] = $post['street_id'][0]['street_code'];
|
||||
$mmm['street_id'] = $post['street_id'];
|
||||
}
|
||||
if (isset($post['village_id']) && !empty($post['village_id'])) {
|
||||
$mmm['village_id'] = $post['village_id'][0]['village_id'];
|
||||
$mmm['village_id'] = $post['village_id'];
|
||||
}
|
||||
if (isset($post['brigade_id']) && !empty($post['brigade_id'])) {
|
||||
$mmm['brigade_id'] = $post['brigade_id'][0]['id'];
|
||||
$mmm['brigade_id'] = $post['brigade_id'];
|
||||
}
|
||||
}
|
||||
//权限组信息
|
||||
$total = Db::table('fa_szxc_information_usermsg')
|
||||
->alias('m')
|
||||
->where($mmm)
|
||||
->count();
|
||||
$list = Db::table('fa_szxc_information_usermsg')
|
||||
@ -177,6 +175,18 @@ class User extends BaseController
|
||||
//种植信息
|
||||
$planting = Db::table('fa_szxc_information_planting')->where('user_id', $params['id'])
|
||||
->find();
|
||||
$strlen = strlen($planting['breed_msg']);
|
||||
if ($strlen != 0 || $strlen > 10) {
|
||||
$planting['breed_msg'] = json_decode($planting['breed_msg'], true);
|
||||
}
|
||||
$strlen1 = strlen($planting['crops_msg']);
|
||||
if ($strlen1 != 0 || $strlen1 > 10) {
|
||||
$planting['crops_msg'] = json_decode($planting['crops_msg'], true);
|
||||
}
|
||||
$strlen2 = strlen($planting['tools_msg']);
|
||||
if ($strlen2 != 0 || $strlen2 > 10) {
|
||||
$planting['tools_msg'] = json_decode($planting['tools_msg'], true);
|
||||
}
|
||||
//保险信息
|
||||
$insurancearr = Db::table('fa_szxc_information_insurance')->where('user_id', $params['id'])->find();
|
||||
//健康信息
|
||||
@ -243,6 +253,7 @@ class User extends BaseController
|
||||
public function postedit()
|
||||
{
|
||||
$params = get_params();
|
||||
halt($params);
|
||||
if ($params['type'] == 1) {
|
||||
unset($params['type']);
|
||||
$res = Db::table('fa_szxc_information_usermsg')->where('user_id', $params['user_id'])->update($params);
|
||||
@ -255,10 +266,10 @@ class User extends BaseController
|
||||
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){
|
||||
$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{
|
||||
} else {
|
||||
$res = Db::table('fa_szxc_information_insurance')->where('user_id', $params['user_id'])->insert($params);
|
||||
}
|
||||
if ($res) {
|
||||
@ -269,10 +280,10 @@ class User extends BaseController
|
||||
}
|
||||
if ($params['type'] == 3) {
|
||||
unset($params['type']);
|
||||
$find=Db::table('fa_szxc_information_insurance')->where('user_id', $params['user_id'])->find();
|
||||
if($find){
|
||||
$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{
|
||||
} else {
|
||||
$res = Db::table('fa_szxc_information_insurance')->where('user_id', $params['user_id'])->insert($params);
|
||||
}
|
||||
if ($res) {
|
||||
@ -283,10 +294,10 @@ class User extends BaseController
|
||||
}
|
||||
if ($params['type'] == 4) {
|
||||
unset($params['type']);
|
||||
$find=Db::table('fa_szxc_information_healthy')->where('user_id', $params['user_id'])->find();
|
||||
if($find){
|
||||
$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{
|
||||
} else {
|
||||
$res = Db::table('fa_szxc_information_healthy')->where('user_id', $params['user_id'])->insert($params);
|
||||
}
|
||||
if ($res) {
|
||||
@ -607,23 +618,25 @@ class User extends BaseController
|
||||
}
|
||||
}
|
||||
//权限组信息
|
||||
$groupwhere[] = ['id', 'in', 2, 4];
|
||||
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']];
|
||||
}
|
||||
// $www['admin_id'] = $this->adminInfo['id'];
|
||||
// $user_address = Db::table('fa_szxc_information_useraddress')->where($www)->find();
|
||||
// if ($user_address) {
|
||||
if ($this->adminInfo['group_access'] == 2) {
|
||||
$auth_range = [['name' => '村级', 'value' => '1']];
|
||||
$groupwhere[] = ['id', 'in', 2];
|
||||
}
|
||||
if ($this->adminInfo['group_access'] == 4) {
|
||||
$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']];
|
||||
}
|
||||
@ -633,13 +646,12 @@ class User extends BaseController
|
||||
$brigade = Db::table('fa_geo_brigade')
|
||||
->limit(30)
|
||||
->select();
|
||||
|
||||
//后端权限
|
||||
$groupdata = Db::table('fa_auth_group')
|
||||
->where('id', '<>', 1)
|
||||
$groupdata = Db::name('admin_group')
|
||||
->where($groupwhere)
|
||||
->limit(30)
|
||||
->select();
|
||||
$groupdata[] = ['id' => 0, 'name' => '无后台权限'];
|
||||
$groupdata[] = ['id' => 0, 'title' => '无后台权限'];
|
||||
//前端权限
|
||||
$user_group = Db::table('fa_user_group')
|
||||
->limit(30)
|
||||
@ -657,6 +669,92 @@ class User extends BaseController
|
||||
|
||||
return view();
|
||||
}
|
||||
public function tongji()
|
||||
{
|
||||
$post = get_params();
|
||||
$where = [];
|
||||
//权限组信息
|
||||
$find = Db::table('fa_szxc_information_useraddress')->where('user_id', $this->adminInfo['user_id'])->find();
|
||||
if ($find) {
|
||||
if ($find['auth_range'] == 1) {
|
||||
$where['village_id'] = $find['village_id'];
|
||||
} elseif ($find['auth_range'] == 2) {
|
||||
$where['street_id'] = $find['street_id'];
|
||||
} elseif ($find['auth_range'] == 3) {
|
||||
$where['area_id'] = $find['area_id'];
|
||||
}
|
||||
}
|
||||
|
||||
if ($post['village_id'] != '') {
|
||||
$where['village_id'] = $post['village_id'];
|
||||
}
|
||||
if ($post['brigade_id'] != '') {
|
||||
$where['brigade_id'] = $post['brigade_id'];
|
||||
}
|
||||
if ($post['street_id'] != '') {
|
||||
$where['street_id'] = $post['street_id'];
|
||||
}
|
||||
$where['area_id'] = $post['area_id'];
|
||||
// 大于60岁人数
|
||||
$old_num = Db::table('fa_szxc_information_usermsg')->where($where)->whereAge('>=', 60)->count();
|
||||
// 儿童人数
|
||||
$children_num = Db::table('fa_szxc_information_usermsg')->where($where)->whereAge('<', 15)->count();
|
||||
// 未婚男
|
||||
$unmarried_man_num = Db::table('fa_szxc_information_usermsg')->where($where)->where([['gender', '=', 1], ['marital_status', '=', 169]])->count();
|
||||
// 未婚女
|
||||
$unmarried_woman_num = Db::table('fa_szxc_information_usermsg')->where($where)->where([['gender', '=', 2], ['marital_status', '=', 169]])->count();
|
||||
|
||||
$land_area_num = Db::table('fa_szxc_information_useraddress')
|
||||
->alias('u')
|
||||
->where($where)
|
||||
->join(['fa_szxc_information_planting'=>'p'], 'u.user_id = p.user_id')->sum('p.land_area');
|
||||
|
||||
$sum_218 = Db::table('fa_szxc_information_useraddress')
|
||||
->alias('u')
|
||||
->where($where)
|
||||
->join(['fa_szxc_information_planting'=>'p'], 'u.user_id = p.user_id and p.nature_of_land=218')->sum('p.land_area');
|
||||
$sum_217 = Db::table('fa_szxc_information_useraddress')
|
||||
->alias('u')
|
||||
->where($where)
|
||||
->join(['fa_szxc_information_planting'=>'p'], 'u.user_id = p.user_id and p.nature_of_land=217')->sum('p.land_area');
|
||||
$sum_216 = Db::table('fa_szxc_information_useraddress')
|
||||
->alias('u')
|
||||
->where($where)
|
||||
->join(['fa_szxc_information_planting'=>'p'], 'u.user_id = p.user_id and p.nature_of_land=216')->sum('p.land_area');
|
||||
$sum_215 = Db::table('fa_szxc_information_useraddress')
|
||||
->alias('u')
|
||||
->where($where)
|
||||
->join(['fa_szxc_information_planting'=>'p'], 'u.user_id = p.user_id and p.nature_of_land=215')->sum('p.land_area');
|
||||
$sum_214 = Db::table('fa_szxc_information_useraddress')
|
||||
->alias('u')
|
||||
->where($where)
|
||||
->join(['fa_szxc_information_planting'=>'p'], 'u.user_id = p.user_id and p.nature_of_land=214')->sum('p.land_area');
|
||||
$sum_70 = Db::table('fa_szxc_information_useraddress')
|
||||
->alias('u')
|
||||
->where($where)
|
||||
->join(['fa_szxc_information_planting'=>'p'], 'u.user_id = p.user_id and p.nature_of_land=70')->sum('p.land_area');
|
||||
$sum_69 = Db::table('fa_szxc_information_useraddress')
|
||||
->alias('u')
|
||||
->where($where)
|
||||
->join(['fa_szxc_information_planting'=>'p'], 'u.user_id = p.user_id and p.nature_of_land=69')->sum('p.land_area');
|
||||
$result = [
|
||||
'old_num' => $old_num,
|
||||
'children_num' => $children_num,
|
||||
'unmarried_man_num' => $unmarried_man_num,
|
||||
'unmarried_woman_num' => $unmarried_woman_num,
|
||||
'land_area_num' => $land_area_num,
|
||||
'sum_218' => $sum_218,
|
||||
'sum_217' => $sum_217,
|
||||
'sum_216' => $sum_216,
|
||||
'sum_215' => $sum_215,
|
||||
'sum_214' => $sum_214,
|
||||
'sum_70' => $sum_70,
|
||||
'sum_69' => $sum_69,
|
||||
|
||||
];
|
||||
$result = ['total' => 0, 'data' => $result];
|
||||
return table_assign(0, '', $result);
|
||||
}
|
||||
/**
|
||||
* 修改
|
||||
*/
|
||||
|
@ -5,7 +5,7 @@
|
||||
<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" />
|
||||
<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>
|
||||
@ -21,7 +21,7 @@
|
||||
|
||||
<script type="text/html" id="toolbarDemo">
|
||||
<div class="layui-btn-container">
|
||||
<span class="layui-btn layui-btn-sm" lay-event="add" data-title="添加文章表">+ 添加文章表</span>
|
||||
<span class="layui-btn layui-btn-sm" lay-event="add" data-title="添加内容">+ 添加内容</span>
|
||||
</div>
|
||||
</script>
|
||||
|
||||
@ -53,6 +53,22 @@
|
||||
field: 'id',
|
||||
title: '编号',
|
||||
align: 'center',
|
||||
width:120,
|
||||
},{
|
||||
field: 'area',
|
||||
title: '区县',
|
||||
align: 'center',
|
||||
width:120,
|
||||
},{
|
||||
field: 'street',
|
||||
title: '乡镇',
|
||||
align: 'center',
|
||||
width:120,
|
||||
},{
|
||||
field: 'village',
|
||||
title: '街道/村',
|
||||
align: 'center',
|
||||
width:120,
|
||||
},{
|
||||
field: 'title',
|
||||
title: '文章标题',
|
||||
@ -60,18 +76,6 @@
|
||||
field: 'nickname',
|
||||
title: '用户',
|
||||
align: 'center',
|
||||
},{
|
||||
field: 'area',
|
||||
title: '区县',
|
||||
align: 'center',
|
||||
},{
|
||||
field: 'street',
|
||||
title: '乡镇',
|
||||
align: 'center',
|
||||
},{
|
||||
field: 'village',
|
||||
title: '街道/村',
|
||||
align: 'center',
|
||||
},{
|
||||
field: 'view_time',
|
||||
title: '发布时间',
|
||||
|
@ -32,11 +32,19 @@
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">区县</label>
|
||||
<div class="layui-input-block">
|
||||
{if {:session('gougu_admin')['group_access']==1}
|
||||
<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>
|
||||
{else /}
|
||||
{volist name='street' id='vo'}
|
||||
{if $address.area_id==$vo.code}
|
||||
<input type="text" value="{$vo.name}" autocomplete="off" class="layui-input" disabled>
|
||||
{/if}
|
||||
{/volist}
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
@ -54,7 +62,7 @@
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">大队</label>
|
||||
<div class="layui-input-block">
|
||||
<select name="brigade_id" lay-verify="required">
|
||||
<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}
|
||||
@ -64,9 +72,9 @@
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">后台权限</label>
|
||||
<div class="layui-input-block">
|
||||
<select name="groupdata" lay-verify="required">
|
||||
<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>
|
||||
<option value="{$vo.id}" {if $vo.id==$address['admin_group']} selected {/if}>{$vo.title}</option>
|
||||
{/volist}
|
||||
</select>
|
||||
</div>
|
||||
@ -74,7 +82,7 @@
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">前端权限</label>
|
||||
<div class="layui-input-block">
|
||||
<select name="group_id" lay-verify="required">
|
||||
<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}
|
||||
@ -94,6 +102,7 @@
|
||||
{block name="script"}
|
||||
<script src="/static/assets/js/xm-select.js"></script>
|
||||
<script>
|
||||
var group_access = "{:session('gougu_admin')['group_access']}"
|
||||
const editorType = '{$editor}';
|
||||
var moduleInit = ['tool', 'tagpicker', 'tinymce'];
|
||||
var area_id = "{$address.area_id}"
|
||||
@ -136,7 +145,7 @@
|
||||
// street(val)
|
||||
// }
|
||||
// });
|
||||
form.on('select(street)', function (data) {
|
||||
form.on('select(area_id)', function (data) {
|
||||
street(data.value)
|
||||
});
|
||||
function street (id) {
|
||||
@ -150,6 +159,7 @@
|
||||
},
|
||||
data: [],
|
||||
radio: true,
|
||||
disabled: group_access == 2 ? true : false,
|
||||
on: function (data) {
|
||||
var arr = data.arr;
|
||||
village(arr[0]['code'])
|
||||
@ -172,33 +182,35 @@
|
||||
},
|
||||
data: [],
|
||||
radio: true,
|
||||
|
||||
disabled: group_access == 2 ? true : false,
|
||||
})
|
||||
$.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;
|
||||
});
|
||||
|
||||
}
|
||||
//监听提交
|
||||
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);
|
||||
}
|
||||
}
|
||||
data.field['area_id'] = "{$address.area_id}"
|
||||
tool.post('{$url[5]}?id={$id}', data.field, callback);
|
||||
return false;
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
{/block}
|
||||
|
@ -186,19 +186,21 @@
|
||||
</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>
|
||||
{volist name="planting.crops_msg" id="vo"}
|
||||
<div class="aa" style="display: inline-block;">
|
||||
<div class="layui-input-inline">
|
||||
农作物名称 <input type="text" name="crops_msg[0][name]" autocomplete="off" class="layui-input" value="{$vo.name}">
|
||||
</div>
|
||||
<div class="layui-input-inline">
|
||||
数量 <input type="text" name="crops_msg[0][num]" autocomplete="off" class="layui-input" value="{$vo.num}">
|
||||
</div>
|
||||
<div class="layui-input-inline">
|
||||
面积 <input type="text" name="crops_msg[0][mianji]" autocomplete="off" class="layui-input" value="{$vo.mianji}">
|
||||
</div>
|
||||
</div>
|
||||
{/volist}
|
||||
|
||||
<button type="button" class="layui-btn layui-btn-normal" id="b1">添加</button>
|
||||
<button type="button" class="layui-btn layui-btn-normal" id="a1" style="display: block; margin-left: 100px;">添加</button>
|
||||
|
||||
</div>
|
||||
<div class="pt-3">
|
||||
@ -496,9 +498,27 @@
|
||||
{block name="script"}
|
||||
<script>
|
||||
var moduleInit = ['tool'];
|
||||
var htmlid=1;
|
||||
function gouguInit () {
|
||||
var form = layui.form, tool = layui.tool;
|
||||
|
||||
$("#a1").on("click", function(e) {
|
||||
var html=`
|
||||
<div class="aa" style="display: inline-block;
|
||||
margin-left: 100px;">
|
||||
<div class="layui-input-inline">
|
||||
农作物名称 <input type="text" name="crops_msg[`+htmlid+`][name]" autocomplete="off" class="layui-input">
|
||||
</div>
|
||||
<div class="layui-input-inline">
|
||||
数量 <input type="text" name="crops_msg[`+htmlid+`][num]" autocomplete="off" class="layui-input">
|
||||
</div>
|
||||
<div class="layui-input-inline">
|
||||
面积 <input type="text" name="crops_msg[`+htmlid+`][mianji]" autocomplete="off" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
`
|
||||
$(".aa").after(html)
|
||||
++htmlid
|
||||
})
|
||||
//监听提交
|
||||
form.on('submit(webform1)', function (data) {
|
||||
let callback = function (e) {
|
||||
|
@ -1,14 +1,88 @@
|
||||
{extend name="common/base"/}
|
||||
<!-- 主体 -->
|
||||
{block name="body"}
|
||||
<style>
|
||||
.sm-st {
|
||||
background: #fff;
|
||||
padding: 20px;
|
||||
border-radius: 3px;
|
||||
margin-bottom: 20px;
|
||||
box-shadow: 0 1px 0px rgba(0, 0, 0, 0.05);
|
||||
}
|
||||
|
||||
.sm-st-icon {
|
||||
width: 60px;
|
||||
height: 60px;
|
||||
display: inline-block;
|
||||
line-height: 60px;
|
||||
text-align: center;
|
||||
font-size: 30px;
|
||||
background: #eee;
|
||||
border-radius: 5px;
|
||||
float: left;
|
||||
margin-right: 10px;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.sm-st-info {
|
||||
font-size: 12px;
|
||||
padding-top: 2px;
|
||||
}
|
||||
|
||||
.sm-st-info span {
|
||||
display: block;
|
||||
font-size: 24px;
|
||||
font-weight: 600;
|
||||
}
|
||||
.col-sm-2{
|
||||
width: 16%;
|
||||
display: inline-block;
|
||||
}
|
||||
.panel{
|
||||
background-color: #fff;
|
||||
}
|
||||
</style>
|
||||
<div class="p-3">
|
||||
<form class="layui-form gg-form-bar border-t border-x">
|
||||
<form class="layui-form gg-form-bar border-t border-x" style="display: inline-block;">
|
||||
<div class="layui-input-inline" style="width:300px;">
|
||||
<input type="text" name="keywords" placeholder="请输入关键字" class="layui-input" autocomplete="off" />
|
||||
<select name="area_id" class="form-control selectpicker" lay-filter="area_id">
|
||||
<option value=""></option>
|
||||
{volist name="arealist" id="vo"}
|
||||
<option value="{$vo.area_code}">{$vo.area_name}</option>
|
||||
{/volist}
|
||||
</select>
|
||||
</div>
|
||||
<div class="layui-input-inline" style="width:300px;">
|
||||
<label class="layui-form-label">街道/镇</label>
|
||||
<div class="layui-input-block">
|
||||
<div id="demo1"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-input-inline" style="width:300px;">
|
||||
<label class="layui-form-label">村/社区</label>
|
||||
<div class="layui-input-block">
|
||||
<div id="demo2"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-input-inline" style="width:300px;">
|
||||
<label class="layui-form-label">大队</label>
|
||||
<div class="layui-input-block">
|
||||
<div id="demo3"></div>
|
||||
</div>
|
||||
</div>
|
||||
<button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="searcharea">提交</button>
|
||||
</form>
|
||||
<form class="layui-form gg-form-bar border-t border-x" style="display: inline-block;">
|
||||
<div class="layui-input-inline" style="width:300px;">
|
||||
<input type="text" name="keywords" placeholder="请输入姓名" class="layui-input" autocomplete="off" />
|
||||
</div>
|
||||
<div class="layui-input-inline" style="width:300px;">
|
||||
<input type="text" name="phone" placeholder="请输入手机" class="layui-input" autocomplete="off" />
|
||||
</div>
|
||||
<button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="searchform">提交搜索</button>
|
||||
</form>
|
||||
<div class="panel" id="search_box">
|
||||
</div>
|
||||
<table class="layui-hide" id="article" lay-filter="article"></table>
|
||||
</div>
|
||||
|
||||
@ -19,18 +93,14 @@
|
||||
<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>
|
||||
{if {:session('gougu_admin')['group_access']==1}
|
||||
<a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a></div>
|
||||
{/if}
|
||||
</script>
|
||||
|
||||
{/block}
|
||||
@ -38,8 +108,10 @@
|
||||
|
||||
<!-- 脚本 -->
|
||||
{block name="script"}
|
||||
<script src="/static/assets/js/xm-select.js"></script>
|
||||
<script>
|
||||
const moduleInit = ['tool'];
|
||||
var group_access = "{:session('gougu_admin')['group_access']}"
|
||||
function gouguInit() {
|
||||
var table = layui.table,tool = layui.tool, form = layui.form;
|
||||
layui.pageTable = table.render({
|
||||
@ -129,7 +201,65 @@
|
||||
}
|
||||
return false;
|
||||
});
|
||||
|
||||
form.on('select(area_id)', function (data) {
|
||||
street(data.value)
|
||||
});
|
||||
function street (id) {
|
||||
var demo1 = xmSelect.render({
|
||||
name: 'street_id',
|
||||
el: '#demo1',
|
||||
prop: {
|
||||
name: 'name',
|
||||
value: 'code',
|
||||
},
|
||||
data: [],
|
||||
radio: true,
|
||||
disabled: group_access == 2 ? true : false,
|
||||
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',
|
||||
prop: {
|
||||
name: 'name',
|
||||
value: 'code',
|
||||
},
|
||||
data: [],
|
||||
radio: true,
|
||||
disabled: group_access == 2 ? true : false,
|
||||
})
|
||||
var demo3 = xmSelect.render({
|
||||
name: 'brigade_id',
|
||||
el: '#demo3',
|
||||
prop: {
|
||||
name: 'brigade_name',
|
||||
value: 'id',
|
||||
},
|
||||
data: [],
|
||||
radio: true,
|
||||
disabled: group_access == 2 ? true : false,
|
||||
})
|
||||
$.get('/api/geo/village?pcode=' + id, function (result) {
|
||||
demo2.update({
|
||||
data: result.data
|
||||
})
|
||||
});
|
||||
$.get('/api/geo/brigade', function (result) {
|
||||
demo3.update({
|
||||
data: result.data
|
||||
})
|
||||
});
|
||||
}
|
||||
//监听搜索提交
|
||||
form.on('submit(searchform)', function(data) {
|
||||
layui.pageTable.reload({
|
||||
@ -143,6 +273,126 @@
|
||||
});
|
||||
return false;
|
||||
});
|
||||
form.on('submit(searcharea)', function(data) {
|
||||
layui.pageTable.reload({
|
||||
where: {
|
||||
area_id: data.field.area_id,
|
||||
street_id: data.field.street_id,
|
||||
village_id:data.field.village_id,
|
||||
brigade_id:data.field.brigade_id
|
||||
},
|
||||
page: {
|
||||
curr: 1
|
||||
}
|
||||
});
|
||||
tool.get("/admin/nk.user/tongji", data.field, function (res) {
|
||||
let data = res.data;
|
||||
var html=`
|
||||
<div class="col-sm-2 col-xs-6">
|
||||
<div class="sm-st clearfix">
|
||||
<div class="sm-st-info">
|
||||
<span id="old_num">`+data.old_num+`</span>
|
||||
老人人数
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-2 col-xs-6">
|
||||
<div class="sm-st clearfix">
|
||||
<div class="sm-st-info">
|
||||
<span id="children_num">`+data.children_num+`</span>
|
||||
儿童人数
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-2 col-xs-6">
|
||||
<div class="sm-st clearfix">
|
||||
<div class="sm-st-info">
|
||||
<span id="unmarried_man_num">`+data.unmarried_man_num+`</span>
|
||||
未婚男
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-2 col-xs-6">
|
||||
<div class="sm-st clearfix">
|
||||
<div class="sm-st-info">
|
||||
<span id="unmarried_woman_num">`+data.unmarried_woman_num+`</span>
|
||||
未婚女
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-2 col-xs-6">
|
||||
<div class="sm-st clearfix">
|
||||
<div class="sm-st-info">
|
||||
<span id="land_area_num">`+data.land_area_num+`</span>
|
||||
土地总面积
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-sm-2 col-xs-6">
|
||||
<div class="sm-st clearfix">
|
||||
<div class="sm-st-info">
|
||||
<span id="sum_218">`+data.sum_218+`</span>
|
||||
农田水利
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-2 col-xs-6">
|
||||
<div class="sm-st clearfix">
|
||||
<div class="sm-st-info">
|
||||
<span id="sum_217">`+data.sum_217+`</span>
|
||||
坑塘
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-2 col-xs-6">
|
||||
<div class="sm-st clearfix">
|
||||
<div class="sm-st-info">
|
||||
<span id="sum_216">`+data.sum_216+`</span>
|
||||
养殖
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-2 col-xs-6">
|
||||
<div class="sm-st clearfix">
|
||||
<div class="sm-st-info">
|
||||
<span id="sum_215">`+data.sum_215+`</span>
|
||||
牧草地
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-sm-2 col-xs-6">
|
||||
<div class="sm-st clearfix">
|
||||
<div class="sm-st-info">
|
||||
<span id="sum_214">`+data.sum_214+`</span>
|
||||
林地
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-2 col-xs-6">
|
||||
<div class="sm-st clearfix">
|
||||
<div class="sm-st-info">
|
||||
<span id="sum_70">`+data.sum_70+`</span>
|
||||
耕地
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-2 col-xs-6">
|
||||
<div class="sm-st clearfix">
|
||||
<div class="sm-st-info">
|
||||
<span id="sum_69">`+data.sum_69+`</span>
|
||||
园地
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
`
|
||||
$("#search_box").html(html)
|
||||
|
||||
});
|
||||
return false;
|
||||
});
|
||||
|
||||
}
|
||||
</script>
|
||||
{/block}
|
||||
|
Loading…
x
Reference in New Issue
Block a user