Merge remote-tracking branch 'origin/master' into akun
正在显示
7 个修改的文件
包含
119 行增加
和
3 行删除
| @@ -5,6 +5,7 @@ namespace App\Http\Controllers\Bside\Setting; | @@ -5,6 +5,7 @@ namespace App\Http\Controllers\Bside\Setting; | ||
| 5 | use App\Enums\Common\Code; | 5 | use App\Enums\Common\Code; |
| 6 | use App\Http\Controllers\Bside\BaseController; | 6 | use App\Http\Controllers\Bside\BaseController; |
| 7 | use App\Http\Logic\Bside\Setting\WebSettingFromLogic; | 7 | use App\Http\Logic\Bside\Setting\WebSettingFromLogic; |
| 8 | +use Illuminate\Http\Request; | ||
| 8 | 9 | ||
| 9 | /** | 10 | /** |
| 10 | * @name:表单设置 | 11 | * @name:表单设置 |
| @@ -32,4 +33,28 @@ class WebSettingFromController extends BaseController | @@ -32,4 +33,28 @@ class WebSettingFromController extends BaseController | ||
| 32 | $webSettingFromLogic->setting_from_save(); | 33 | $webSettingFromLogic->setting_from_save(); |
| 33 | $this->response('success'); | 34 | $this->response('success'); |
| 34 | } | 35 | } |
| 36 | + | ||
| 37 | + /** | ||
| 38 | + * 保存询盘请求返回信息 | ||
| 39 | + * @param Request $request | ||
| 40 | + * @param WebSettingFromLogic $webSettingFromLogic | ||
| 41 | + */ | ||
| 42 | + public function saveBack(Request $request, WebSettingFromLogic $webSettingFromLogic) | ||
| 43 | + { | ||
| 44 | + $message = $request->input('message', 'success'); | ||
| 45 | + $url = $request->input('url'); | ||
| 46 | + $webSettingFromLogic->fromBackMsgSet($message, $url); | ||
| 47 | + $this->response('success'); | ||
| 48 | + } | ||
| 49 | + | ||
| 50 | + /** | ||
| 51 | + * 获取询盘请求返回信息 | ||
| 52 | + * @param Request $request | ||
| 53 | + * @param WebSettingFromLogic $webSettingFromLogic | ||
| 54 | + */ | ||
| 55 | + public function getBack(Request $request, WebSettingFromLogic $webSettingFromLogic) | ||
| 56 | + { | ||
| 57 | + $result = $webSettingFromLogic->fromBackMsgGet(); | ||
| 58 | + $this->response('success', Code::SUCCESS, $result); | ||
| 59 | + } | ||
| 35 | } | 60 | } |
| @@ -56,7 +56,7 @@ class ProjectLogic extends BaseLogic | @@ -56,7 +56,7 @@ class ProjectLogic extends BaseLogic | ||
| 56 | $info = $this->model->with('payment')->with('deploy_build')->with('deploy_optimize')->with('online_check') | 56 | $info = $this->model->with('payment')->with('deploy_build')->with('deploy_optimize')->with('online_check') |
| 57 | ->with('project_after')->where(['id'=>$id])->first()->toArray(); | 57 | ->with('project_after')->where(['id'=>$id])->first()->toArray(); |
| 58 | $info['online_check']['name'] = (new Manage())->getName(!empty($info['online_check']['created_manage_id']) ?? ''); | 58 | $info['online_check']['name'] = (new Manage())->getName(!empty($info['online_check']['created_manage_id']) ?? ''); |
| 59 | - $info['deploy_optimize']['minor_keywords'] = json_decode(!empty($info['deploy_optimize']['minor_keywords']) ?? []); | 59 | + $info['deploy_optimize']['minor_keywords'] = !empty($info['deploy_optimize']['minor_keywords']) ? json_decode($info['deploy_optimize']['minor_keywords']) : []; |
| 60 | $info['init_domain'] = $this->getInitDomain($info['serve_id'])['domain']; | 60 | $info['init_domain'] = $this->getInitDomain($info['serve_id'])['domain']; |
| 61 | if($info['extend_type'] != 0){ | 61 | if($info['extend_type'] != 0){ |
| 62 | $info['type'] = $info['extend_type']; | 62 | $info['type'] = $info['extend_type']; |
| @@ -353,8 +353,8 @@ class ProjectLogic extends BaseLogic | @@ -353,8 +353,8 @@ class ProjectLogic extends BaseLogic | ||
| 353 | 'project_id'=>$project_id, | 353 | 'project_id'=>$project_id, |
| 354 | 'name'=>$lead_name, | 354 | 'name'=>$lead_name, |
| 355 | 'type'=>UserModel::TYPE_ONE, | 355 | 'type'=>UserModel::TYPE_ONE, |
| 356 | - 'operator_id'=>$this->manager['id'], | ||
| 357 | - 'create_id'=>$this->manager['id'], | 356 | + 'operator_id'=>$this->manager['id'] ?? 0, |
| 357 | + 'create_id'=>$this->manager['id'] ?? 0, | ||
| 358 | ]; | 358 | ]; |
| 359 | $userModel->add($data); | 359 | $userModel->add($data); |
| 360 | } | 360 | } |
| @@ -4,6 +4,7 @@ namespace App\Http\Logic\Bside\Setting; | @@ -4,6 +4,7 @@ namespace App\Http\Logic\Bside\Setting; | ||
| 4 | 4 | ||
| 5 | use App\Http\Logic\Bside\BaseLogic; | 5 | use App\Http\Logic\Bside\BaseLogic; |
| 6 | use App\Models\WebSetting\WebSettingForm; | 6 | use App\Models\WebSetting\WebSettingForm; |
| 7 | +use App\Models\WebSetting\WebSettingFormBack; | ||
| 7 | 8 | ||
| 8 | class WebSettingFromLogic extends BaseLogic | 9 | class WebSettingFromLogic extends BaseLogic |
| 9 | { | 10 | { |
| @@ -54,4 +55,32 @@ class WebSettingFromLogic extends BaseLogic | @@ -54,4 +55,32 @@ class WebSettingFromLogic extends BaseLogic | ||
| 54 | return $this->success(); | 55 | return $this->success(); |
| 55 | } | 56 | } |
| 56 | 57 | ||
| 58 | + /** | ||
| 59 | + * 保存询盘请求返回信息 | ||
| 60 | + * @param $message | ||
| 61 | + * @param $url | ||
| 62 | + * @return WebSettingFormBack|mixed | ||
| 63 | + */ | ||
| 64 | + public function fromBackMsgSet($message, $url) | ||
| 65 | + { | ||
| 66 | + $project_id = $this->user['project_id']; | ||
| 67 | + $info = WebSettingFormBack::saveBack($project_id, $message, $url); | ||
| 68 | + return $info; | ||
| 69 | + } | ||
| 70 | + | ||
| 71 | + /** | ||
| 72 | + * 获取询盘请求返回信息 | ||
| 73 | + * @return mixed | ||
| 74 | + */ | ||
| 75 | + public function fromBackMsgGet() | ||
| 76 | + { | ||
| 77 | + $project_id = $this->user['project_id']; | ||
| 78 | + $info = WebSettingFormBack::getBack($project_id); | ||
| 79 | + $result = [ | ||
| 80 | + 'message' => $info->message ?? '', | ||
| 81 | + 'url' => $info->url ?? '', | ||
| 82 | + 'other' => $info->other ?? '' | ||
| 83 | + ]; | ||
| 84 | + return $result; | ||
| 85 | + } | ||
| 57 | } | 86 | } |
app/Models/WebSetting/WebSettingFormBack.php
0 → 100644
| 1 | +<?php | ||
| 2 | +/** | ||
| 3 | + * Created by PhpStorm. | ||
| 4 | + * User: zhl | ||
| 5 | + * Date: 2023/10/10 | ||
| 6 | + * Time: 17:01 | ||
| 7 | + */ | ||
| 8 | + | ||
| 9 | +namespace App\Models\WebSetting; | ||
| 10 | + | ||
| 11 | +use App\Models\Base; | ||
| 12 | + | ||
| 13 | +/** | ||
| 14 | + * Class WebSettingFormBack | ||
| 15 | + * @package App\Models\WebSetting | ||
| 16 | + */ | ||
| 17 | +class WebSettingFormBack extends Base | ||
| 18 | +{ | ||
| 19 | + /** | ||
| 20 | + * @var string | ||
| 21 | + */ | ||
| 22 | + protected $table = 'gl_web_setting_form_back'; | ||
| 23 | + | ||
| 24 | + /** | ||
| 25 | + * 保存返回信息 | ||
| 26 | + * @param int $project_id | ||
| 27 | + * @param string $message | ||
| 28 | + * @param string $url | ||
| 29 | + * @param string $other | ||
| 30 | + * @return WebSettingFormBack|mixed | ||
| 31 | + */ | ||
| 32 | + public static function saveBack($project_id = 0, $message = '', $url = '', $other = '') | ||
| 33 | + { | ||
| 34 | + $info = self::getBack($project_id); | ||
| 35 | + if (empty($info)) | ||
| 36 | + $info = new self(); | ||
| 37 | + $info->project_id = $project_id; | ||
| 38 | + $info->message = $message; | ||
| 39 | + $info->url = $url; | ||
| 40 | + $info->other = $other; | ||
| 41 | + $info->save(); | ||
| 42 | + return $info; | ||
| 43 | + } | ||
| 44 | + | ||
| 45 | + /** | ||
| 46 | + * 根据企业获取返回信息设置 | ||
| 47 | + * @param int $project_id | ||
| 48 | + * @return mixed | ||
| 49 | + */ | ||
| 50 | + public static function getBack($project_id = 0) | ||
| 51 | + { | ||
| 52 | + return self::where(['project_id' => $project_id])->first(); | ||
| 53 | + } | ||
| 54 | +} |
| @@ -37,6 +37,9 @@ class ProjectServer extends BaseService | @@ -37,6 +37,9 @@ class ProjectServer extends BaseService | ||
| 37 | config(['database.connections.custom_mysql.database' => $project->databaseName()]); | 37 | config(['database.connections.custom_mysql.database' => $project->databaseName()]); |
| 38 | config(['database.connections.custom_mysql.username' => $project->mysqlConfig->user]); | 38 | config(['database.connections.custom_mysql.username' => $project->mysqlConfig->user]); |
| 39 | config(['database.connections.custom_mysql.password' => $project->mysqlConfig->password]); | 39 | config(['database.connections.custom_mysql.password' => $project->mysqlConfig->password]); |
| 40 | + | ||
| 41 | + //清除现有的数据库连接配置 | ||
| 42 | + DB::purge('custom_mysql'); | ||
| 40 | //重连 | 43 | //重连 |
| 41 | DB::connection('custom_mysql')->reconnect(); | 44 | DB::connection('custom_mysql')->reconnect(); |
| 42 | 45 |
| @@ -134,6 +134,8 @@ Route::middleware(['bloginauth'])->group(function () { | @@ -134,6 +134,8 @@ Route::middleware(['bloginauth'])->group(function () { | ||
| 134 | Route::prefix('from')->group(function () { | 134 | Route::prefix('from')->group(function () { |
| 135 | Route::any('/', [\App\Http\Controllers\Bside\Setting\WebSettingFromController::class, 'info'])->name('web_setting_from_info'); | 135 | Route::any('/', [\App\Http\Controllers\Bside\Setting\WebSettingFromController::class, 'info'])->name('web_setting_from_info'); |
| 136 | Route::any('/save', [\App\Http\Controllers\Bside\Setting\WebSettingFromController::class, 'save'])->name('web_setting_from_info'); | 136 | Route::any('/save', [\App\Http\Controllers\Bside\Setting\WebSettingFromController::class, 'save'])->name('web_setting_from_info'); |
| 137 | + Route::any('/get_back', [\App\Http\Controllers\Bside\Setting\WebSettingFromController::class, 'getBack'])->name('web_get_from_back'); | ||
| 138 | + Route::any('/set_back', [\App\Http\Controllers\Bside\Setting\WebSettingFromController::class, 'saveBack'])->name('web_setting_from_back'); | ||
| 137 | }); | 139 | }); |
| 138 | //多语言设置 | 140 | //多语言设置 |
| 139 | Route::prefix('country')->group(function () { | 141 | Route::prefix('country')->group(function () { |
-
请 注册 或 登录 后发表评论