|
...
|
...
|
@@ -12,6 +12,7 @@ use App\Http\Logic\Bside\User\UserLoginLogic; |
|
|
|
use App\Models\Ai\AiBlog;
|
|
|
|
use App\Models\Blog\Blog;
|
|
|
|
use App\Models\Domain\DomainInfo;
|
|
|
|
use App\Models\Inquiry\InquiryRelateDomain;
|
|
|
|
use App\Models\News\News;
|
|
|
|
use App\Models\Product\Category;
|
|
|
|
use App\Models\Product\CategoryRelated;
|
|
...
|
...
|
@@ -463,4 +464,31 @@ class PrivateController extends BaseController |
|
|
|
$result = json_decode($json, true) ?: [];
|
|
|
|
return $this->success($result);
|
|
|
|
}
|
|
|
|
|
|
|
|
public function inquiry_relate_domain(Request $request){
|
|
|
|
$this->request->validate([
|
|
|
|
'from_domain' => 'required',
|
|
|
|
'to_domain' => 'required',
|
|
|
|
]);
|
|
|
|
$from_domain = trim($this->param['from_domain']);
|
|
|
|
$to_domain = trim($this->param['to_domain']);
|
|
|
|
|
|
|
|
$from_domain = parse_url($from_domain, PHP_URL_HOST) ?: $from_domain;
|
|
|
|
$to_domain = parse_url($to_domain, PHP_URL_HOST) ?: $to_domain;
|
|
|
|
|
|
|
|
$project = Project::getProjectByDomain($to_domain);
|
|
|
|
if (empty($project)) {
|
|
|
|
return $this->error('未找到被关联域名对应的项目!');
|
|
|
|
}
|
|
|
|
|
|
|
|
$relate = InquiryRelateDomain::where('from_domain', $from_domain)->first();
|
|
|
|
if(!$relate){
|
|
|
|
$relate = new InquiryRelateDomain();
|
|
|
|
}
|
|
|
|
$relate->from_domain = $from_domain;
|
|
|
|
$relate->to_domain = $to_domain;
|
|
|
|
$relate->save();
|
|
|
|
|
|
|
|
return $this->success($relate);
|
|
|
|
}
|
|
|
|
} |
...
|
...
|
|