正在显示
1 个修改的文件
包含
30 行增加
和
1 行删除
| @@ -12,9 +12,11 @@ use App\Models\Project\Project; | @@ -12,9 +12,11 @@ use App\Models\Project\Project; | ||
| 12 | use App\Models\SyncSubmitTask\SyncSubmitTask; | 12 | use App\Models\SyncSubmitTask\SyncSubmitTask; |
| 13 | use App\Models\Visit\Visit; | 13 | use App\Models\Visit\Visit; |
| 14 | use App\Models\WebSetting\WebLanguage; | 14 | use App\Models\WebSetting\WebLanguage; |
| 15 | +use App\Models\WebSetting\WebSettingFormBack; | ||
| 15 | use App\Services\CosService; | 16 | use App\Services\CosService; |
| 16 | use App\Services\ProjectServer; | 17 | use App\Services\ProjectServer; |
| 17 | use Illuminate\Http\Request; | 18 | use Illuminate\Http\Request; |
| 19 | +use Illuminate\Support\Facades\Cache; | ||
| 18 | use Illuminate\Support\Facades\DB; | 20 | use Illuminate\Support\Facades\DB; |
| 19 | 21 | ||
| 20 | /** | 22 | /** |
| @@ -59,7 +61,34 @@ class InquiryController extends BaseController | @@ -59,7 +61,34 @@ class InquiryController extends BaseController | ||
| 59 | if(!SyncSubmitTask::addTask(SyncSubmitTask::TYPE_INQUIRY, $data)){ | 61 | if(!SyncSubmitTask::addTask(SyncSubmitTask::TYPE_INQUIRY, $data)){ |
| 60 | return $this->error(); | 62 | return $this->error(); |
| 61 | } | 63 | } |
| 62 | - return $this->success(); | 64 | + //return $this->success(); |
| 65 | + //新增表单提,返回跳转链接 | ||
| 66 | + return $this->response($this->inquiryResult()); | ||
| 67 | + } | ||
| 68 | + | ||
| 69 | + /** | ||
| 70 | + * 新增表单提交返回跳转链接 | ||
| 71 | + */ | ||
| 72 | + protected function inquiryResult(){ | ||
| 73 | + $domain = request()->getHost(); | ||
| 74 | + $cache_key = 'inquiry_form_back_' . $domain; | ||
| 75 | + $result = Cache::get($cache_key); | ||
| 76 | + if(!$result){ | ||
| 77 | + $result = [ | ||
| 78 | + 'message' => "", | ||
| 79 | + 'url' => "", | ||
| 80 | + 'other' => "" | ||
| 81 | + ]; | ||
| 82 | + $projectDomain = Project::getProjectByDomain($domain); | ||
| 83 | + $webFormBack = WebSettingFormBack::where("project_id", $projectDomain['project_id']??0)->first(); | ||
| 84 | + if (!empty($webFormBack)) { | ||
| 85 | + $result["message"] = $webFormBack->message ?? ""; | ||
| 86 | + $result["url"] = $webFormBack->url ?? ""; | ||
| 87 | + $result["other"] = $webFormBack->other ?? ""; | ||
| 88 | + Cache::put($cache_key, $result, 3600); | ||
| 89 | + } | ||
| 90 | + } | ||
| 91 | + return $result; | ||
| 63 | } | 92 | } |
| 64 | 93 | ||
| 65 | /** | 94 | /** |
-
请 注册 或 登录 后发表评论