wugg 1 vuosi sitten
vanhempi
commit
992649b673

+ 1 - 0
app/admin/controller/Payment.php

@@ -117,6 +117,7 @@ class Payment extends Base
                     `a`.`total_fee` AS `total_fee`,
                     `b`.`apply_name`,
                     `b`.`apply_id`,
+                    `a`.`is_comon`,
                     `a`.`winv_fee` ,
                     `a`.`ainv_fee` ,
                     `a`.`wpay_fee` ,

+ 38 - 1
app/admin/controller/WeChat.php

@@ -3,7 +3,7 @@
 
 namespace app\admin\controller;
 
-use think\App;
+use app\admin\model\WechatUser;use think\App;
 use think\facade\Validate;
 use think\facade\Db;
 class WeChat extends Base {
@@ -75,4 +75,41 @@ class WeChat extends Base {
 		}
 		return app_show(0,"获取成功",$baseconfig);
 	}
+	
+	public function list(){
+		$post =$this->request->only(['mobile'=>'',"nickname"=>"","page"=>1,"size"=>10],'post','trim');
+		$where=[];
+		if($post['mobile']!='')$where[]=["mobile","like","%{$post['mobile']}%"];
+		if($post['nickname']!='')$where[]=["nickname","like","%{$post['nickname']}%"];
+		$list =(new WechatUser())->where($where)->json(['companyArr'])->paginate(["page"=>$post['page'],"list_rows"=>$post['size']]);
+		$this->success("获取成功",["list"=>$list->items(),"count"=>$list->total()]);
+	}
+	
+	public function save(){
+		$post =$this->request->only([
+			"id"=>"",
+			'mobile'=>'',
+			'nickname'=>'',
+			'is_show'=>'',
+			'companyArr'=>[],
+			],'post','trim');
+		$valid =Validate::rule([
+			"id|主键id"=>"require|number",
+			"mobile|手机号"=>"require|mobile",
+			"nickname|名称"=>"require",
+			"is_show|可查看报表"=>"require",
+			"companyArr|可查看企业"=>"require|array"
+			]);
+		if($valid->check($post)==false)$this->error($valid->getError());
+		$model = new WechatUser();
+		$info =$model->findOrEmpty($post['id']);
+		if($info->isEmpty())$this->error("未找到用户数据");
+		$info->mobile = $post['mobile'];
+		$info->nickname = $post['nickname'];
+		$info->is_show = $post['is_show'];
+		$info->companyArr = json_encode($post['companyArr'],JSON_UNESCAPED_UNICODE);
+		$info->save();
+		$this->success('更新成功');
+	}
+	
 }

+ 14 - 0
app/admin/model/WechatUser.php

@@ -0,0 +1,14 @@
+<?php
+declare (strict_types = 1);
+
+namespace app\admin\model;
+
+use think\Model;
+
+/**
+ * @mixin \think\Model
+ */
+class WechatUser extends Model
+{
+    //
+}

+ 2 - 0
app/admin/route/app.php

@@ -268,6 +268,8 @@ route::rule("departtipsadd","admin/DepartTips/departcreate");//网络部录单
 
 route::rule("wechat_getinfo","admin/WeChat/getinfo");//微信授权获取用户信息
 route::rule("wechat_getconfig","admin/WeChat/getConfig");//微信获取页面jssdk配置
+route::rule("wechat_list","admin/WeChat/list");//微信获取页面jssdk配置
+route::rule("wechat_save","admin/WeChat/save");//微信获取页面jssdk配置
 
 route::rule("goodChangeList","admin/GoodChange/list");
 route::rule("goodChangeInfo","admin/GoodChange/info");