Browse Source
			
			
			Merge branch 'develop' of ssh://8.134.10.79:222/Leadfyy.co/hainan into develop
			
			
				develop
			
			
		
		Merge branch 'develop' of ssh://8.134.10.79:222/Leadfyy.co/hainan into develop
	
		
	
			
			
				develop
			
			
		
				 7 changed files with 134 additions and 13 deletions
			
			
		- 
					23app/Admin/Controllers/SettingController.php
 - 
					52app/Admin/Forms/Setting.php
 - 
					3app/Admin/routes.php
 - 
					12app/AdminAgent/Extensions/Grid/AuditRefund.php
 - 
					12app/Http/Controllers/Api/SharePayController.php
 - 
					25app/Http/Controllers/Api/WxpayController.php
 - 
					20app/Models/AdminSetting.php
 
@ -0,0 +1,23 @@ | 
			
		|||||
 | 
				<?php | 
			
		||||
 | 
				
 | 
			
		||||
 | 
				
 | 
			
		||||
 | 
				namespace App\Admin\Controllers; | 
			
		||||
 | 
				use App\Admin\Forms\Setting; | 
			
		||||
 | 
				use Dcat\Admin\Http\Controllers\AdminController; | 
			
		||||
 | 
				use Dcat\Admin\Layout\Content; | 
			
		||||
 | 
				use Dcat\Admin\Widgets\Card; | 
			
		||||
 | 
				
 | 
			
		||||
 | 
				/** | 
			
		||||
 | 
				 * 系统设置 | 
			
		||||
 | 
				 * Class SettingController | 
			
		||||
 | 
				 * @package App\Admin\Controllers | 
			
		||||
 | 
				 */ | 
			
		||||
 | 
				class SettingController extends AdminController | 
			
		||||
 | 
				{ | 
			
		||||
 | 
					public function index(Content $content) | 
			
		||||
 | 
					{ | 
			
		||||
 | 
						return $content | 
			
		||||
 | 
							->title('系统设置') | 
			
		||||
 | 
							->body(new Card(new Setting())); | 
			
		||||
 | 
					} | 
			
		||||
 | 
				} | 
			
		||||
@ -0,0 +1,52 @@ | 
			
		|||||
 | 
				<?php | 
			
		||||
 | 
				
 | 
			
		||||
 | 
				namespace App\Admin\Forms; | 
			
		||||
 | 
				
 | 
			
		||||
 | 
				use Dcat\Admin\Widgets\Form; | 
			
		||||
 | 
				
 | 
			
		||||
 | 
				class Setting extends Form | 
			
		||||
 | 
				{ | 
			
		||||
 | 
				    /** | 
			
		||||
 | 
				     * Handle the form request. | 
			
		||||
 | 
				     * | 
			
		||||
 | 
				     * @param array $input | 
			
		||||
 | 
				     * | 
			
		||||
 | 
				     * @return mixed | 
			
		||||
 | 
				     */ | 
			
		||||
 | 
				    public function handle(array $input) | 
			
		||||
 | 
				    { | 
			
		||||
 | 
				        // dump($input);
 | 
			
		||||
 | 
				
 | 
			
		||||
 | 
				        // return $this->response()->error('Your error message.');
 | 
			
		||||
 | 
						admin_setting($input); | 
			
		||||
 | 
				
 | 
			
		||||
 | 
				        return $this->response()->success('保存成功')->refresh(); | 
			
		||||
 | 
				    } | 
			
		||||
 | 
				
 | 
			
		||||
 | 
				    /** | 
			
		||||
 | 
				     * Build a form here. | 
			
		||||
 | 
				     */ | 
			
		||||
 | 
				    public function form() | 
			
		||||
 | 
				    { | 
			
		||||
 | 
						$this->tab('支付小程序配置', function () { | 
			
		||||
 | 
							$this->text('payee_appid', '收款小程序APPID')->required(); | 
			
		||||
 | 
							$this->text('payee_appsecret', '收款小程序APP_SECRET')->required(); | 
			
		||||
 | 
							$this->text('payee_mchid', '收款小程序MCH_ID')->required(); | 
			
		||||
 | 
							$this->text('payee_mchkey', '收款小程序MCH_KEY')->required(); | 
			
		||||
 | 
						})->tab('小程序服务商配置', function () { | 
			
		||||
 | 
							$this->text('service_appid', '小程序第三方平台APPID'); | 
			
		||||
 | 
							$this->text('service_appsecret', '小程序第三方平台APP_SECRET'); | 
			
		||||
 | 
							$this->text('service_binding_appid', '绑定小程序APPID'); | 
			
		||||
 | 
						}); | 
			
		||||
 | 
				    } | 
			
		||||
 | 
				
 | 
			
		||||
 | 
				    /** | 
			
		||||
 | 
				     * The data of the form. | 
			
		||||
 | 
				     * | 
			
		||||
 | 
				     * @return array | 
			
		||||
 | 
				     */ | 
			
		||||
 | 
				    public function default() | 
			
		||||
 | 
				    { | 
			
		||||
 | 
				        return admin_setting()->toArray(); | 
			
		||||
 | 
				    } | 
			
		||||
 | 
				} | 
			
		||||
@ -0,0 +1,20 @@ | 
			
		|||||
 | 
				<?php | 
			
		||||
 | 
				
 | 
			
		||||
 | 
				namespace App\Models; | 
			
		||||
 | 
				
 | 
			
		||||
 | 
				use Illuminate\Database\Eloquent\Factories\HasFactory; | 
			
		||||
 | 
				use Illuminate\Database\Eloquent\Model; | 
			
		||||
 | 
				
 | 
			
		||||
 | 
				class AdminSetting extends Model | 
			
		||||
 | 
				{ | 
			
		||||
 | 
				    use HasFactory; | 
			
		||||
 | 
				
 | 
			
		||||
 | 
				    public static function val($slug) | 
			
		||||
 | 
					{ | 
			
		||||
 | 
						if (is_array($slug)) { | 
			
		||||
 | 
							return static::query()->whereIn('slug', $slug)->pluck('value', 'slug')->toArray() ?? []; | 
			
		||||
 | 
						} else { | 
			
		||||
 | 
							return static::query()->where('slug', $slug)->value('value') ?? null; | 
			
		||||
 | 
						} | 
			
		||||
 | 
					} | 
			
		||||
 | 
				} | 
			
		||||
						Write
						Preview
					
					
					Loading…
					
					Cancel
						Save
					
		Reference in new issue