|
@@ -27,7 +27,37 @@ class Sys extends BaseController
|
|
|
*/
|
|
|
public function index(){
|
|
|
$sys = (new SysModel)->where("id", 1)->find();
|
|
|
- return app('json')->success($sys->toArray());
|
|
|
+ $data = $sys->toArray();
|
|
|
+
|
|
|
+ if(empty($data["wxconfig"])){
|
|
|
+ $data["wxconfig"]=[
|
|
|
+ "appid"=>"",
|
|
|
+ "secret"=>"",
|
|
|
+ "mchid"=>"",
|
|
|
+ "apiv2key"=>"",
|
|
|
+ "apiclient_key"=>"",
|
|
|
+ "apiclient_cert"=>"",
|
|
|
+ "notify_url"=>""
|
|
|
+ ];
|
|
|
+ }else{
|
|
|
+ $data["wxconfig"] = unserialize($data["wxconfig"]);
|
|
|
+ }
|
|
|
+ return app('json')->success($data->toArray());
|
|
|
+ }
|
|
|
+ public function wxsave(){
|
|
|
+ $post = UtilService::getMore([
|
|
|
+ ['appid', ''],
|
|
|
+ ['secret', ''],
|
|
|
+ ['mchid', ''],
|
|
|
+ ['apiv2key', ''],
|
|
|
+ ['apiclient_key', ''],
|
|
|
+ ['apiclient_cert', ''],
|
|
|
+ ['notify_url', ''],
|
|
|
+ ], $request);
|
|
|
+ $save=[];
|
|
|
+ $save['wxconfig']= serialize($post);
|
|
|
+ (new SysModel())->saveSys($save);
|
|
|
+ return app('json')->success("数据保存成功");
|
|
|
}
|
|
|
|
|
|
* 编辑用户条款
|