|
...
|
...
|
@@ -5,6 +5,8 @@ namespace App\Http\Controllers\Api; |
|
|
|
use App\Enums\Common\Code;
|
|
|
|
use App\Exceptions\InquiryFilterException;
|
|
|
|
use App\Models\Domain\DomainInfo;
|
|
|
|
use App\Models\Product\Category;
|
|
|
|
use App\Models\Product\Product;
|
|
|
|
use App\Models\Project\Project;
|
|
|
|
use App\Models\SyncSubmitTask\SyncSubmitTask;
|
|
|
|
use App\Models\Visit\Visit;
|
|
...
|
...
|
@@ -104,4 +106,32 @@ class InquiryController extends BaseController |
|
|
|
$ipdata = DB::table('gl_xunpan_ipdata')->where($where)->inRandomOrder()->first();
|
|
|
|
return $this->success($ipdata);
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getVisitUrl(Request $request){
|
|
|
|
$domain = $request->input('domain', '');
|
|
|
|
$project = Project::getProjectByDomain($domain);
|
|
|
|
$project_id = $project->id;
|
|
|
|
|
|
|
|
ProjectServer::useProject($project_id);
|
|
|
|
//已发布产品分类页面
|
|
|
|
$data['urls_cats'] = DB::connection('custom_mysql')->table('gl_product_category')
|
|
|
|
->where('project_id', $project_id)->where('status', Category::STATUS_ACTIVE)
|
|
|
|
->whereNull('deleted_at')
|
|
|
|
->pluck('route','id')->toArray();
|
|
|
|
|
|
|
|
//已发布单页面
|
|
|
|
$data['urls_page'] = [];
|
|
|
|
//已发布产品详情页
|
|
|
|
$data['urls_details'] = DB::connection('custom_mysql')->table('gl_product')
|
|
|
|
->where('project_id', $project_id)->where('status', Product::STATUS_ON)
|
|
|
|
->whereNull('deleted_at')
|
|
|
|
->pluck('route', 'id')->toArray();
|
|
|
|
|
|
|
|
$data['urls_cats'] = array_merge($data['urls_cats'], $data['urls_page']);
|
|
|
|
if(empty($data['urls_cats'])){
|
|
|
|
$data['urls_cats'] = $data['urls_details'];
|
|
|
|
}
|
|
|
|
DB::disconnect('custom_mysql');
|
|
|
|
return $this->success($data);
|
|
|
|
}
|
|
|
|
} |
...
|
...
|
|