|
@@ -5,6 +5,8 @@ namespace App\Http\Controllers\Api; |
|
@@ -5,6 +5,8 @@ namespace App\Http\Controllers\Api; |
|
5
|
use App\Enums\Common\Code;
|
5
|
use App\Enums\Common\Code;
|
|
6
|
use App\Exceptions\InquiryFilterException;
|
6
|
use App\Exceptions\InquiryFilterException;
|
|
7
|
use App\Models\Domain\DomainInfo;
|
7
|
use App\Models\Domain\DomainInfo;
|
|
|
|
8
|
+use App\Models\Product\Category;
|
|
|
|
9
|
+use App\Models\Product\Product;
|
|
8
|
use App\Models\Project\Project;
|
10
|
use App\Models\Project\Project;
|
|
9
|
use App\Models\SyncSubmitTask\SyncSubmitTask;
|
11
|
use App\Models\SyncSubmitTask\SyncSubmitTask;
|
|
10
|
use App\Models\Visit\Visit;
|
12
|
use App\Models\Visit\Visit;
|
|
@@ -104,4 +106,32 @@ class InquiryController extends BaseController |
|
@@ -104,4 +106,32 @@ class InquiryController extends BaseController |
|
104
|
$ipdata = DB::table('gl_xunpan_ipdata')->where($where)->inRandomOrder()->first();
|
106
|
$ipdata = DB::table('gl_xunpan_ipdata')->where($where)->inRandomOrder()->first();
|
|
105
|
return $this->success($ipdata);
|
107
|
return $this->success($ipdata);
|
|
106
|
}
|
108
|
}
|
|
|
|
109
|
+
|
|
|
|
110
|
+ public function getVisitUrl(Request $request){
|
|
|
|
111
|
+ $domain = $request->input('domain', '');
|
|
|
|
112
|
+ $project = Project::getProjectByDomain($domain);
|
|
|
|
113
|
+ $project_id = $project->id;
|
|
|
|
114
|
+
|
|
|
|
115
|
+ ProjectServer::useProject($project_id);
|
|
|
|
116
|
+ //已发布产品分类页面
|
|
|
|
117
|
+ $data['urls_cats'] = DB::connection('custom_mysql')->table('gl_product_category')
|
|
|
|
118
|
+ ->where('project_id', $project_id)->where('status', Category::STATUS_ACTIVE)
|
|
|
|
119
|
+ ->whereNull('deleted_at')
|
|
|
|
120
|
+ ->pluck('route','id')->toArray();
|
|
|
|
121
|
+
|
|
|
|
122
|
+ //已发布单页面
|
|
|
|
123
|
+ $data['urls_page'] = [];
|
|
|
|
124
|
+ //已发布产品详情页
|
|
|
|
125
|
+ $data['urls_details'] = DB::connection('custom_mysql')->table('gl_product')
|
|
|
|
126
|
+ ->where('project_id', $project_id)->where('status', Product::STATUS_ON)
|
|
|
|
127
|
+ ->whereNull('deleted_at')
|
|
|
|
128
|
+ ->pluck('route', 'id')->toArray();
|
|
|
|
129
|
+
|
|
|
|
130
|
+ $data['urls_cats'] = array_merge($data['urls_cats'], $data['urls_page']);
|
|
|
|
131
|
+ if(empty($data['urls_cats'])){
|
|
|
|
132
|
+ $data['urls_cats'] = $data['urls_details'];
|
|
|
|
133
|
+ }
|
|
|
|
134
|
+ DB::disconnect('custom_mysql');
|
|
|
|
135
|
+ return $this->success($data);
|
|
|
|
136
|
+ }
|
|
107
|
} |
137
|
} |