<?php
/*
 本代码由 口号帮 创建
 创建时间 2019-05-08 16:22:09
 技术支持 口号帮 
 严禁反编译、逆向等任何形式的侵权行为，违者将追究法律责任
*/

namespace App\Http\Controllers\Admin;use App\Http\Controllers\Controller;use App\Models\PaySetting;use App\Models\Website;use Illuminate\Http\Request;class PayController extends Controller{public function index(){return view('admin.pay.index');}public function data(){$res=PaySetting::paginate(10)->toArray();$P2gAC0=array();$P2gAC0['code']=0;$P2gAC0['msg']='正在请求中...';$P2gAC0['count']=$res['total'];$P2gAC0['data']=$res['data'];$data=$P2gAC0;return response()->json($data);}public function edit($id){$info=PaySetting::find($id);$pay_type=Website::find(1);$setting=$info->setting;$setting=json_decode($setting);$P2g0=$info->type=='weixin';if($P2g0)goto P2gBodyx2;goto P2gNextx2;P2gBodyx2:if($setting)goto P2gBodyx4;goto P2gNextx4;P2gBodyx4:$P2g0=$setting->paySignKey;goto P2gx3;P2gNextx4:$P2g0='';P2gx3:$paySignKey=$P2g0;return view('admin.pay.weixin',compact('info','paySignKey','pay_type'));goto P2gx1;P2gNextx2:if($setting)goto P2gBodyx6;goto P2gNextx6;P2gBodyx6:$P2g0=$setting->private_key;goto P2gx5;P2gNextx6:$P2g0='';P2gx5:$private_key=$P2g0;if($setting)goto P2gBodyx8;goto P2gNextx8;P2gBodyx8:$P2g0=$setting->partner_id;goto P2gx7;P2gNextx8:$P2g0='';P2gx7:$partner_id=$P2g0;return view('admin.pay.alipay',compact('info','private_key','partner_id','pay_type'));P2gx1:}public function update(Request $request,$id){$info=PaySetting::find($id);$website=Website::find(1);$P2g0=$info->type=='weixin';if($P2g0)goto P2gBodyxa;goto P2gNextxa;P2gBodyxa:$P2g0=$website->pay_type=='qrcode';if($P2g0)goto P2gBodyxc;goto P2gNextxc;P2gBodyxc:if($request->qrcode)goto P2gBodyxe;goto P2gNextxe;P2gBodyxe:$P2g0=$request->qrcode;goto P2gxd;P2gNextxe:$P2g0='';P2gxd:$data['qrcode']=$P2g0;goto P2gxb;P2gNextxc:$data['app_id']=$request->app_id;$data['mch_id']=$request->mch_id;$data['secret']=$request->AppSecrect;$data['app_id']=$request->app_id;$P2g0=$request->status=='on';if($P2g0)goto P2gBodyxg;goto P2gNextxg;P2gBodyxg:$P2g1=1;goto P2gxf;P2gNextxg:$P2g1=0;P2gxf:$data['status']=$P2g1;$data['setting']=json_encode(['paySignKey'=>$request->paySignKey]);P2gxb:PaySetting::where(['id'=>$id])->update($data);return redirect()->route('admin.pay');goto P2gx9;P2gNextxa:$P2g0=$info->type=='alipay';if($P2g0)goto P2gBodyxh;goto P2gNextxh;P2gBodyxh:$P2g0=$website->pay_type=='qrcode';if($P2g0)goto P2gBodyxj;goto P2gNextxj;P2gBodyxj:if($request->qrcode)goto P2gBodyxl;goto P2gNextxl;P2gBodyxl:$P2g0=$request->qrcode;goto P2gxk;P2gNextxl:$P2g0='';P2gxk:$data['qrcode']=$P2g0;goto P2gxi;P2gNextxj:$data['app_id']=$request->app_id;$P2g0=$request->status=='on';if($P2g0)goto P2gBodyxn;goto P2gNextxn;P2gBodyxn:$P2g1=1;goto P2gxm;P2gNextxn:$P2g1=0;P2gxm:$data['status']=$P2g1;$data['setting']=json_encode(['private_key'=>$request->private_key,'partner_id'=>$request->partner_id]);P2gxi:PaySetting::where(['id'=>$id])->update($data);return redirect()->route('admin.pay');goto P2gx9;P2gNextxh:return redirect()->route('admin.pay');P2gx9:}}
?>