From ee79513c579c15abbf1facee086d420a39f13685 Mon Sep 17 00:00:00 2001
From: mkm <727897186@qq.com>
Date: Mon, 6 Feb 2023 14:35:11 +0800
Subject: [PATCH 1/3] =?UTF-8?q?=E6=9B=B4=E6=96=B0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/admin/controller/nk/Community.php | 121 ++++++++++++++++++++++
app/admin/controller/nk/RuralWelfare.php | 83 +++++++++++++++
app/admin/view/nk/community/index.html | 122 +++++++++++++++++++++++
app/admin/view/nk/community/read.html | 29 ++++++
4 files changed, 355 insertions(+)
create mode 100644 app/admin/controller/nk/Community.php
create mode 100644 app/admin/controller/nk/RuralWelfare.php
create mode 100644 app/admin/view/nk/community/index.html
create mode 100644 app/admin/view/nk/community/read.html
diff --git a/app/admin/controller/nk/Community.php b/app/admin/controller/nk/Community.php
new file mode 100644
index 0000000..6f4b190
--- /dev/null
+++ b/app/admin/controller/nk/Community.php
@@ -0,0 +1,121 @@
+adminInfo = get_login_admin();
+ $this->url=[
+ '/admin/nk.community/index',
+ '/admin/nk.community/add',
+ '/admin/nk.community/edit',
+ '/admin/nk.community/del',
+ '/admin/nk.community/read',
+ ];
+ }
+ /**
+ * 数据列表
+ */
+ public function index()
+ {
+ if (request()->isAjax()) {
+ $params= get_params();
+ $where['status']=1;
+ $where = [];
+ if (isset($params['keywords'])){
+// $where[]=['title','like','%'.$params['keywords'].'%'];
+ }
+ 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'] == 2){
+ $where['street_id'] = $user_address['street_id'];
+ }elseif ($user_address['auth_range'] == 3){
+ $where['area_id'] = $user_address['area_id'];
+ }else{
+ $where['village_id'] = $user_address['village_id'];
+ }
+ }else{
+ $where['village_id'] = '';
+ }
+ }
+
+ $total = Db::connect('shop')->name('community_address')
+ ->where($where)
+ ->count();
+ if ($total!=0){
+ $list = Db::connect('shop')->name('community_address')
+ ->where($where)
+ ->page($params['page'])
+ ->limit($params['limit'])
+ ->select();
+ $arr=[];
+ foreach ($list as $k=>$v){
+ $arr[]=$v['community_id'];
+ }
+ $list2=Db::connect('shop')->name('community')->where('community_id','in',$arr)->select();
+ }else{
+ $list2=[];
+ }
+
+ $result = ['total' => $total, 'data' => $list2];
+ return table_assign(0, '', $result);
+ }
+ else{
+ return view('nk/community/index',['url'=>$this->url]);
+ }
+ }
+
+
+ /**
+ * 查看信息
+ */
+ public function read()
+ {
+ $param= get_params();
+ $id = isset($param['id']) ? $param['id'] : 0;
+ $detail = Db::connect('shop')->name('community')->where('community_id',$id)->find();
+ if (!empty($detail)) {
+ View::assign('detail', $detail);
+ return view();
+ }
+ else{
+ throw new \think\exception\HttpException(404, '找不到页面');
+ }
+ }
+ /**
+ * 删除
+ */
+ public function del()
+ {
+ $param= get_params();
+ $id = isset($param['id']) ? $param['id'] : 0;
+ $res = Db::connect('shop')->name('community')->where('community_id',$id)->delete();
+ Db::connect('shop')->name('community_address')->where('community_id',$id)->delete();
+ if ($res){
+ return to_assign();
+ }else{
+ return to_assign(1, '操作失败,原因:'.$res);
+ }
+ }
+
+
+}
diff --git a/app/admin/controller/nk/RuralWelfare.php b/app/admin/controller/nk/RuralWelfare.php
new file mode 100644
index 0000000..711ab66
--- /dev/null
+++ b/app/admin/controller/nk/RuralWelfare.php
@@ -0,0 +1,83 @@
+adminInfo = get_login_admin();
+ $this->category_id=352;
+ $this->url=[
+ '/admin/nk.ruralwelfare/index?category_id='.$this->category_id,
+ '/admin/nk.ruralwelfare/add',
+ '/admin/nk.ruralwelfare/edit',
+ '/admin/nk.ruralwelfare/del',
+ '/admin/nk.ruralwelfare/read',
+ ];
+ }
+ /**
+ * 查看
+ */
+ public function index()
+ {
+ if (request()->isAjax()) {
+ $params= get_params();
+ $params['category_id']=$this->category_id;
+ (new Article())->index($params);
+ }
+ return view('nk/article/index',['url'=>$this->url]);
+ }
+ /**
+ * 添加
+ */
+ public function add()
+ {
+ if (request()->isAjax()) {
+ $params= get_params();
+ $params['category_id']=$this->category_id;
+ (new Article())->add($params);
+ }else{
+ View::assign('editor', get_system_config('other','editor'));
+ View::assign('url', $this->url);
+ return view('nk/article/add');
+ }
+ }
+ /**
+ * 修改
+ */
+ public function edit()
+ {
+ $params= get_params();
+ (new Article())->edit($params);
+ return view('nk/article/edit',['url'=>$this->url]);
+ }
+ /**
+ * 查看信息
+ */
+ public function read()
+ {
+ $params = get_params();
+ (new Article())->read($params);
+
+ return view('nk/article/read',['url'=>$this->url]);
+
+ }
+ /**
+ * 修改
+ */
+ public function del()
+ {
+ $params= get_params();
+ (new Article())->del($params);
+ }
+}
\ No newline at end of file
diff --git a/app/admin/view/nk/community/index.html b/app/admin/view/nk/community/index.html
new file mode 100644
index 0000000..2b9c2e6
--- /dev/null
+++ b/app/admin/view/nk/community/index.html
@@ -0,0 +1,122 @@
+{extend name="common/base"/}
+
+{block name="body"}
+
+
+
+
+
+
+
+
+
+
+{/block}
+
+
+
+{block name="script"}
+
+{/block}
+
\ No newline at end of file
diff --git a/app/admin/view/nk/community/read.html b/app/admin/view/nk/community/read.html
new file mode 100644
index 0000000..6166cf7
--- /dev/null
+++ b/app/admin/view/nk/community/read.html
@@ -0,0 +1,29 @@
+{extend name="common/base"/}
+{block name="style"}
+
+{/block}
+
+{block name="body"}
+
+{/block}
+
\ No newline at end of file
From 4056810d0ed7918e334319732315ecefa7d8b62d Mon Sep 17 00:00:00 2001
From: mkm <727897186@qq.com>
Date: Mon, 6 Feb 2023 17:50:51 +0800
Subject: [PATCH 2/3] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=9D=83=E9=99=90?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/admin/view/nk/user/auths.html | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/admin/view/nk/user/auths.html b/app/admin/view/nk/user/auths.html
index efe25b8..83b0300 100644
--- a/app/admin/view/nk/user/auths.html
+++ b/app/admin/view/nk/user/auths.html
@@ -159,7 +159,7 @@
},
data: [],
radio: true,
- disabled: group_access == 2 ? true : false,
+ disabled: group_access == 2 ||group_access == 4? true : false,
on: function (data) {
var arr = data.arr;
village(arr[0]['code'])
From d1795b0e12b761dcb1acdabad8dd31e4a9a19f48 Mon Sep 17 00:00:00 2001
From: mkm <727897186@qq.com>
Date: Tue, 7 Feb 2023 17:06:28 +0800
Subject: [PATCH 3/3] =?UTF-8?q?=E6=8F=90=E4=BA=A41?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/admin/controller/nk/Merchant.php | 67 +++++++++
app/admin/controller/nk/RegionCommission.php | 62 +++++++++
app/admin/controller/nk/Spread.php | 65 +++++++++
app/admin/view/nk/merchant/index.html | 90 ++++++++++++
app/admin/view/nk/regioncommission/index.html | 104 ++++++++++++++
app/admin/view/nk/spread/index.html | 131 ++++++++++++++++++
app/home/BaseController.php | 1 +
app/home/controller/Index.php | 1 -
8 files changed, 520 insertions(+), 1 deletion(-)
create mode 100644 app/admin/controller/nk/Merchant.php
create mode 100644 app/admin/controller/nk/RegionCommission.php
create mode 100644 app/admin/controller/nk/Spread.php
create mode 100644 app/admin/view/nk/merchant/index.html
create mode 100644 app/admin/view/nk/regioncommission/index.html
create mode 100644 app/admin/view/nk/spread/index.html
diff --git a/app/admin/controller/nk/Merchant.php b/app/admin/controller/nk/Merchant.php
new file mode 100644
index 0000000..7d076b6
--- /dev/null
+++ b/app/admin/controller/nk/Merchant.php
@@ -0,0 +1,67 @@
+adminInfo = get_login_admin();
+ $this->url=[
+ '/admin/nk.merchant/index',
+ ];
+ }
+ /**
+ * 查看
+ */
+ public function index()
+ {
+ $total=0;
+ $list=[];
+ $brokerage_price=0;
+ $find=Db::table('fa_szxc_information_useraddress')->where('user_id',$this->adminInfo['id'])->value('street_id');
+ if (request()->isAjax()) {
+ $params= get_params();
+ if ($find!=0){
+ $total=Db::connect('shop')->name('merchant_address')->where('street_id',$find)
+ ->where('status',1)->count();
+ $merchant_id=Db::connect('shop')->name('merchant_address')->where('street_id',$find)
+ ->where('status',1)
+ ->page($params['page'])
+ ->limit($params['limit'])
+ ->field('mer_id')->select();
+ $arr=[];
+ foreach ($merchant_id as $k=>$v){
+ $arr[]=$v['mer_id'];
+ }
+ $list=Db::connect('shop')->name('merchant')->where('mer_id','in',$arr)->select();
+ }
+ $result = ['total' => $total, 'data' => $list];
+ return table_assign(0, '', $result);
+ }
+ View::assign('brokerage_price', $brokerage_price);
+
+ return view('',['url'=>$this->url]);
+ }
+ /**
+ * 查看信息
+ */
+ public function read()
+ {
+ $params = get_params();
+
+ return view('',['url'=>$this->url]);
+
+ }
+
+}
\ No newline at end of file
diff --git a/app/admin/controller/nk/RegionCommission.php b/app/admin/controller/nk/RegionCommission.php
new file mode 100644
index 0000000..0f68b6f
--- /dev/null
+++ b/app/admin/controller/nk/RegionCommission.php
@@ -0,0 +1,62 @@
+adminInfo = get_login_admin();
+ $this->url=[
+ '/admin/nk.regioncommission/index',
+ ];
+ }
+ /**
+ * 查看
+ */
+ public function index()
+ {
+ $total=0;
+ $list=[];
+ $brokerage_price=0;
+ $find=Db::table('fa_szxc_information_useraddress')->where('user_id',$this->adminInfo['id'])->value('street_id');
+ if ($find!=0) {
+ $brokerage_price=Db::connect('shop')->name('store_order_region_commission')->where('street_id',$find)->sum('commission_rate');
+ }
+ if (request()->isAjax()) {
+ $params= get_params();
+ if ($find!=0){
+ $list=Db::connect('shop')->name('store_order_region_commission')->where('street_id',$find)
+ ->page($params['page'])
+ ->limit($params['limit'])
+ ->select();
+ }
+ $result = ['total' => $total, 'data' => $list];
+ return table_assign(0, '', $result);
+ }
+ View::assign('brokerage_price', $brokerage_price);
+
+ return view('',['url'=>$this->url]);
+ }
+ /**
+ * 查看信息
+ */
+ public function read()
+ {
+ $params = get_params();
+
+ return view('',['url'=>$this->url]);
+
+ }
+
+}
\ No newline at end of file
diff --git a/app/admin/controller/nk/Spread.php b/app/admin/controller/nk/Spread.php
new file mode 100644
index 0000000..3dd4c33
--- /dev/null
+++ b/app/admin/controller/nk/Spread.php
@@ -0,0 +1,65 @@
+adminInfo = get_login_admin();
+ $this->category_id=309;
+ $this->url=[
+ '/admin/nk.spread/index',
+ '/admin/nk.spread/read',
+ ];
+ }
+ /**
+ * 查看
+ */
+ public function index()
+ {
+ $nk_user=Db::connect('shop')->name('nk_user')->where('n_user_id',$this->adminInfo['id'])->value('user_id');
+ $total=0;
+ $list=[];
+ $brokerage_price=Db::connect('shop')->name('user')->where('uid',$nk_user)->value('brokerage_price');
+
+ if (request()->isAjax()) {
+ $params= get_params();
+ if ($nk_user!=0){
+ $list=Db::connect('shop')->name('store_order')->where('spread_uid',$nk_user)
+ ->where('status',3)
+ ->field('uid,order_sn,pay_time,extension_one,extension_two,is_selfbuy')
+ ->page($params['page'])
+ ->limit($params['limit'])
+ ->select();
+ }
+ $result = ['total' => $total, 'data' => $list];
+ return table_assign(0, '', $result);
+ }
+ View::assign('brokerage_price', $brokerage_price);
+ return view('',['url'=>$this->url]);
+ }
+ /**
+ * 查看信息
+ */
+ public function read()
+ {
+ $params = get_params();
+
+ return view('',['url'=>$this->url]);
+
+ }
+
+}
\ No newline at end of file
diff --git a/app/admin/view/nk/merchant/index.html b/app/admin/view/nk/merchant/index.html
new file mode 100644
index 0000000..e9c45cd
--- /dev/null
+++ b/app/admin/view/nk/merchant/index.html
@@ -0,0 +1,90 @@
+{extend name="common/base"/}
+
+{block name="body"}
+
+
+
+{/block}
+
+
+
+{block name="script"}
+
+{/block}
+
\ No newline at end of file
diff --git a/app/admin/view/nk/regioncommission/index.html b/app/admin/view/nk/regioncommission/index.html
new file mode 100644
index 0000000..e8f16b1
--- /dev/null
+++ b/app/admin/view/nk/regioncommission/index.html
@@ -0,0 +1,104 @@
+{extend name="common/base"/}
+
+{block name="body"}
+
+
+
+
+
+
+ {$brokerage_price}
+ 总佣金
+
+
+
+
+
+
+
+
+
+{/block}
+
+
+
+{block name="script"}
+
+{/block}
+
\ No newline at end of file
diff --git a/app/admin/view/nk/spread/index.html b/app/admin/view/nk/spread/index.html
new file mode 100644
index 0000000..6e3723c
--- /dev/null
+++ b/app/admin/view/nk/spread/index.html
@@ -0,0 +1,131 @@
+{extend name="common/base"/}
+
+{block name="body"}
+
+
+
+
+
+
+ {$brokerage_price}
+ 总佣金
+
+
+
+
+
+
+
+
+
+{/block}
+
+
+
+{block name="script"}
+
+{/block}
+
\ No newline at end of file
diff --git a/app/home/BaseController.php b/app/home/BaseController.php
index 9f54cd4..9500b1b 100644
--- a/app/home/BaseController.php
+++ b/app/home/BaseController.php
@@ -52,6 +52,7 @@ abstract class BaseController
$this->app = $app;
$this->request = $this->app->request;
// 控制器初始化
+ return redirect('/admin');
$this->initialize();
}
diff --git a/app/home/controller/Index.php b/app/home/controller/Index.php
index 8f8105e..008f511 100644
--- a/app/home/controller/Index.php
+++ b/app/home/controller/Index.php
@@ -16,7 +16,6 @@ class Index extends BaseController
{
public function index()
{
- return redirect('/admin');
add_user_log('view', '首页');
$count = \think\facade\Db::name('UserLog')->where(array('type' => 'down'))->count();
return View('',['count'=>$count]);