123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209 |
- <?php
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- namespace app\admin\controller\setting;
-
- use app\admin\logic\PayConfigLogic;
- use app\common\basics\AdminBase;
- use app\common\server\ConfigServer;
- use app\common\server\JsonServer;
- use think\db\exception\DataNotFoundException;
- use think\db\exception\DbException;
- use think\db\exception\ModelNotFoundException;
-
-
- class PayConfig extends AdminBase
- {
-
-
-
- public function lists()
- {
-
- if ($this->request->isAjax()) {
- return JsonServer::success('', PayConfigLogic::lists());
- }
- return view();
- }
-
-
-
-
- public function editBalance()
- {
-
- if ($this->request->isAjax()) {
- $post = $this->request->post();
- if (empty($post['image']) && $post['status'] == 1) {
- return JsonServer::error('请选择支付图标');
- }
- PayConfigLogic::editBalance($post);
- return JsonServer::success('修改成功');
- }
- return view('', ['info' => PayConfigLogic::info('balance')]);
- }
-
-
-
-
- public function editWechat()
- {
-
- if ($this->request->isAjax()) {
- $post = $this->request->post();
- if ($post['status'] == 1) {
- if (empty($post['image'])) {
- return JsonServer::error('请选择支付图标');
- }
- if ($post['apiclient_cert'] == '' || $post['apiclient_key'] == '') {
- return JsonServer::error('apiclient_cert或apiclient_key不能为空');
- }
- }
- PayConfigLogic::editWechat($post);
- return JsonServer::success('修改成功');
- }
- $domain_name = ConfigServer::get('website', 'domain_name', '');
- return view('', [
- 'domain' => $domain_name ? $domain_name : request()->domain(),
- 'info' => PayConfigLogic::info('wechat')
- ]);
- }
-
-
-
-
- public function editAlipay()
- {
-
- if ($this->request->isAjax()) {
- $post = $this->request->post();
- if (empty($post['image']) && $post['status'] == 1) {
- return JsonServer::error('请选择支付图标');
- }
- PayConfigLogic::editAlipay($post);
- return JsonServer::success('修改成功');
- }
- return view('', ['info' => PayConfigLogic::info('alipay')]);
- }
-
-
-
- function editHfdgWechat()
- {
- if ($this->request->isAjax()) {
- $post = $this->request->post();
- if (empty($post['image']) && $post['status'] == 1) {
- return JsonServer::error('请选择支付图标');
- }
- PayConfigLogic::editHfdgWechat($post);
- return JsonServer::success('修改成功');
- }
-
- return view('', [ 'info' => PayConfigLogic::info('hfdg_wechat') ]);
- }
-
-
-
-
- function editHfdgAlipay()
- {
- if ($this->request->isAjax()) {
- $post = $this->request->post();
- if (empty($post['image']) && $post['status'] == 1) {
- return JsonServer::error('请选择支付图标');
- }
- PayConfigLogic::editHfdgAlipay($post);
- return JsonServer::success('修改成功');
- }
-
- return view('', [ 'info' => PayConfigLogic::info('hfdg_alipay') ]);
- }
-
-
-
-
- public function editOffline()
- {
-
- if ($this->request->isAjax()) {
- $post = $this->request->post();
- if (empty($post['image']) && $post['status'] == 1) {
- return JsonServer::error('请选择支付图标');
- }
- PayConfigLogic::editOffline($post);
- return JsonServer::success('修改成功');
- }
- return view('', ['info' => PayConfigLogic::info('offline')]);
- }
-
- }
|