作者 赵彬吉
... ... @@ -106,7 +106,7 @@ class Count extends Command
* @method :post
* @time :2023/6/14 15:40
*/
public function pv_num($yesterday,$domain){
public function pv_num($yesterday){
$pv = DB::connection('custom_mysql')->table('gl_customer_visit_item')->whereDate('updated_date', $yesterday)->count();
return $pv;
}
... ... @@ -117,7 +117,7 @@ class Count extends Command
* @method :post
* @time :2023/6/14 15:40
*/
public function ip_num($yesterday,$domain){
public function ip_num($yesterday){
$ip = DB::connection('custom_mysql')->table('gl_customer_visit')->whereDate('updated_date', $yesterday)->count();
return $ip;
}
... ...
... ... @@ -107,7 +107,7 @@ class CountDate extends Command
* @method :post
* @time :2023/6/14 15:40
*/
public function pv_num($yesterday,$domain){
public function pv_num($yesterday){
$pv = DB::connection('custom_mysql')->table('gl_customer_visit_item')->whereDate('updated_date', $yesterday)->count();
return $pv;
}
... ... @@ -118,7 +118,7 @@ class CountDate extends Command
* @method :post
* @time :2023/6/14 15:40
*/
public function ip_num($yesterday,$domain){
public function ip_num($yesterday){
$ip = DB::connection('custom_mysql')->table('gl_customer_visit')->whereDate('updated_date', $yesterday)->count();
return $ip;
}
... ...
... ... @@ -179,9 +179,9 @@ class RelayInquiry extends Command
foreach ($inquiry as $key=>$val) {
$this->output('询盘ID:' . $val->id);
//询盘时间超过2小时 就不处理了
if(time() - strtotime($val->inquiry_date) > 7200){
if(time() - strtotime($val->inquiry_date) > 259200){
$val->status = ReInquiryForm::STATUS_FORGO;
$val->remark = '超时2小时未处理!';
$val->remark = '超时72小时未处理!';
$val->save();
continue;
}
... ... @@ -355,7 +355,8 @@ class RelayInquiry extends Command
// 推送消息 消息内容小于10个字符, 使用内置询盘内容
$message = $form->message;
$message_id = 0;
if (strlen($message) < 10) {
// 通过字符数量区分, 改成完全获取内置询盘内容
if (true) {
$use_ids = ReInquiryDetail::where(['re_website' => $domain])->where('status', '<>', ReInquiryDetail::STATUS_FAIL)->pluck('text_id')->toArray();
$text = ReInquiryText::whereNotIn('id', $use_ids)->where('status', ReInquiryText::STATUS_USABLE)->inRandomOrder()->first();
$message = $text->content;
... ...
... ... @@ -16,6 +16,7 @@ use App\Models\HomeCount\MonthCount;
use App\Models\Inquiry\InquiryFormData;
use App\Models\Project\Project;
use App\Models\Visit\Visit;
use App\Models\Visit\VisitItem;
use App\Services\ProjectServer;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\DB;
... ... @@ -137,14 +138,12 @@ class MonthAllCount extends Command
* @time :2024/1/8 11:02
*/
public function pv_ip(&$arr,$start,$end,$project_id){
$pv_ip = DB::table('gl_count')
->where(['project_id'=>$project_id])
->where('date','>=',$start.' 00:00:00')
->where('date','<=',$end.' 23:59:59')
->select(DB::raw('SUM(pv_num) as pv_num'), DB::raw('SUM(ip_num) as ip_num'),DB::raw('SUM(inquiry_num) as inquiry_num'))
->first();
$arr['pv'] = $pv_ip->pv_num;
$arr['ip'] = $pv_ip->ip_num;
$arr['pv'] = (new VisitItem())
->where('updated_date','>=',$start.' 00:00:00')
->where('updated_date','<=',$end.' 23:59:59')->count();
$arr['ip'] = (new Visit())
->where('updated_date','>=',$start.' 00:00:00')
->where('updated_date','<=',$end.' 23:59:59')->count();
if($arr['ip'] != 0){
$arr['rate'] = round((($arr['month_total'] ?? 0) / $arr['ip']) * 10,2);
}
... ...
... ... @@ -14,6 +14,8 @@ use App\Models\Com\UpdateOldInfo;
use App\Models\Domain\DomainInfo;
use App\Models\Inquiry\InquiryFormData;
use App\Models\Project\Project;
use App\Models\Visit\Visit;
use App\Models\Visit\VisitItem;
use App\Services\ProjectServer;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\DB;
... ... @@ -159,14 +161,12 @@ class MonthCount extends Command
* @time :2024/1/8 11:02
*/
public function pv_ip(&$arr,$start,$end,$project_id){
$pv_ip = DB::table('gl_count')
->where(['project_id'=>$project_id])
->where('date','>=',$start.' 00:00:00')
->where('date','<=',$end.' 23:59:59')
->select(DB::raw('SUM(pv_num) as pv_num'), DB::raw('SUM(ip_num) as ip_num'),DB::raw('SUM(inquiry_num) as inquiry_num'))
->first();
$arr['pv'] = $pv_ip->pv_num;
$arr['ip'] = $pv_ip->ip_num;
$arr['pv'] = (new VisitItem())
->where('updated_date','>=',$start.' 00:00:00')
->where('updated_date','<=',$end.' 23:59:59')->count();
$arr['ip'] = (new Visit())
->where('updated_date','>=',$start.' 00:00:00')
->where('updated_date','<=',$end.' 23:59:59')->count();
if($arr['ip'] != 0){
$arr['rate'] = round((($arr['month_total'] ?? 0) / $arr['ip']) * 10,2);
}
... ...
... ... @@ -14,6 +14,8 @@ use App\Models\Com\UpdateOldInfo;
use App\Models\Domain\DomainInfo;
use App\Models\Inquiry\InquiryFormData;
use App\Models\Project\Project;
use App\Models\Visit\Visit;
use App\Models\Visit\VisitItem;
use App\Services\ProjectServer;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\DB;
... ... @@ -160,14 +162,12 @@ class MonthCountDate extends Command
* @time :2024/1/8 11:02
*/
public function pv_ip(&$arr,$start,$end,$project_id){
$pv_ip = DB::table('gl_count')
->where(['project_id'=>$project_id])
->where('date','>=',$start.' 00:00:00')
->where('date','<=',$end.' 23:59:59')
->select(DB::raw('SUM(pv_num) as pv_num'), DB::raw('SUM(ip_num) as ip_num'),DB::raw('SUM(inquiry_num) as inquiry_num'))
->first();
$arr['pv'] = $pv_ip->pv_num;
$arr['ip'] = $pv_ip->ip_num;
$arr['pv'] = (new VisitItem())
->where('updated_date','>=',$start.' 00:00:00')
->where('updated_date','<=',$end.' 23:59:59')->count();
$arr['ip'] = (new Visit())
->where('updated_date','>=',$start.' 00:00:00')
->where('updated_date','<=',$end.' 23:59:59')->count();
if($arr['ip'] != 0){
$arr['rate'] = round((($arr['month_total'] ?? 0) / $arr['ip']) * 10,2);
}
... ...
... ... @@ -16,6 +16,7 @@ use App\Models\HomeCount\MonthCount;
use App\Models\Inquiry\InquiryFormData;
use App\Models\Project\Project;
use App\Models\Visit\Visit;
use App\Models\Visit\VisitItem;
use App\Services\ProjectServer;
use Illuminate\Console\Command;
use Illuminate\Support\Carbon;
... ... @@ -133,14 +134,12 @@ class MonthProjectCount extends Command
* @time :2024/1/8 11:02
*/
public function pv_ip(&$arr,$start,$end,$project_id){
$pv_ip = DB::table('gl_count')
->where(['project_id'=>$project_id])
->where('date','>=',$start.' 00:00:00')
->where('date','<=',$end.' 23:59:59')
->select(DB::raw('SUM(pv_num) as pv_num'), DB::raw('SUM(ip_num) as ip_num'),DB::raw('SUM(inquiry_num) as inquiry_num'))
->first();
$arr['pv'] = $pv_ip->pv_num;
$arr['ip'] = $pv_ip->ip_num;
$arr['pv'] = (new VisitItem())
->where('updated_date','>=',$start.' 00:00:00')
->where('updated_date','<=',$end.' 23:59:59')->count();
$arr['ip'] = (new Visit())
->where('updated_date','>=',$start.' 00:00:00')
->where('updated_date','<=',$end.' 23:59:59')->count();
if($arr['ip'] != 0){
$arr['rate'] = round(($arr['month_total'] / $arr['ip']) * 10,2);
}
... ...
... ... @@ -38,6 +38,7 @@ class AdsController extends BaseController
$industry = trim($request->input('industry'));
$ad_id = trim($request->input('ad_id'));
$status = $request->input('status', '');
$page_size = intval($request->input('row', '20'));
$result = ReInquiryTask::when($ad_id, function ($query, $ads_id) {
return $query->where('ad_id', 'like', '%' . $ads_id . '%');
})
... ... @@ -53,7 +54,7 @@ class AdsController extends BaseController
}
})
->orderBy('id', 'desc')
->paginate();
->paginate($page_size);
$relay_site_total = 0;
foreach ($result as $item){
... ... @@ -166,6 +167,7 @@ class AdsController extends BaseController
$ad_name = $request->input('ad_name');
$ad_id = $request->input('ad_id');
$country = $request->input('country');
$page_size = intval($request->input('row', '20'));
$result = ReInquiryForm::when($status, function ($query, $status) {
return $query->where('status', $status);
})
... ... @@ -179,7 +181,7 @@ class AdsController extends BaseController
return $query->where('country', 'like', '%' . $country . '%');
})
->orderBy('inquiry_date', 'desc')
->paginate();
->paginate($page_size);
return $this->response('success', Code::SUCCESS, $result);
}
... ...
... ... @@ -36,7 +36,7 @@ class ServersIpLogic extends BaseLogic
public function infoServersIp(){
$info = $this->model->read(['id'=>$this->param['id']]);
$projectModel = new Project();
$info['project_title'] = $projectModel->formatQuery(['serve_id'=>$info['id']])->pluck('title')->toArray();
$info['project_title'] = $projectModel->formatQuery(['serve_id'=>$info['id'],'delete_status'=>0])->pluck('title')->toArray();
return $this->success($info);
}
... ...
... ... @@ -185,12 +185,12 @@ class CustomTemplateLogic extends BaseLogic
$this->param['html_style'] = "<style id='globalsojs-styles'></style>";
}
}
if($this->param['url'] == 'news' || $this->param['url'] == 'product' || $this->param['url'] == 'blog'){
$this->fail('不允许修改路由为:'.$this->param['url']);
}
$this->param['project_id'] = $this->user['project_id'];
$id = $this->model->addReturnId($this->param);
$route = RouteMap::setRoute($this->param['url'], RouteMap::SOURCE_PAGE, $id, $this->user['project_id']);
if($route == 'news' || $route == 'product' || $route == 'blog'){
$this->fail('不允许修改路由为:'.$this->param['url']);
}
$this->addUpdateNotify(RouteMap::SOURCE_PAGE,$route);
$this->model->edit(['url'=>$route],['id'=>$id]);
}
... ...
... ... @@ -47,6 +47,9 @@ class RankDataLogic extends BaseLogic
$project = (new ProjectLogic())->getProjectInfo($project_id);
$domain_info = (new DomainInfoLogic)->getDomainInfo($project_id);
$rank = RankData::where('project_id', $project_id)->first();
if(empty($rank) && ($project['deploy_optimize']['api_no'] != 0)){
$data['langs_status'] = 1;
}
$rank_week = RankWeek::where('project_id', $project_id)->first();
$recomm_domain = RecommDomain::where('project_id', $project_id)->first();
$external_links = ExternalLinks::where('project_id', $project_id)->first();
... ... @@ -86,9 +89,6 @@ class RankDataLogic extends BaseLogic
//小语种列表
$quanqiusou_api = new QuanqiusouApi();
$lang_data = $quanqiusou_api->getLangRankData($api_no);
if(empty($lang_data)){
$data['langs_status'] = 1;
}
$lang_data = Arr::setValueToKey($lang_data, 'language');
$data['langs'] = [];
$languageModel = new MinorLanguages();
... ...
... ... @@ -334,23 +334,22 @@ class TranslateLogic extends BaseLogic
$page = $arr[1];
$route = $arr[0];
}
if(in_array($route,['products','news','blog'])){
//固定路由
$data['page'] = $page;
$data['is_list'] = 1;
if($route == 'products'){
$data['source'] = 2;
}elseif ($route == 'news'){
$data['source'] = 4;
}else{
$data['source'] = 3;
}
return $this->success($data);
}
$routeModel = new RouteMap();
$routeInfo = $routeModel->read(['route'=>$route]);
if($routeInfo === false){
if(in_array($route,['products','news','blog'])){
//固定路由
$data['page'] = $page;
$data['is_list'] = 1;
if($route == 'products'){
$data['source'] = 2;
}elseif ($route == 'news'){
$data['source'] = 4;
}else{
$data['source'] = 3;
}
return $this->success($data);
}
return $data;
}
$data = $this->resultData($routeInfo,$data);
... ...
... ... @@ -120,6 +120,7 @@ class Project extends Base
13 => 'AI站群',
14 => '未达标',
15 => 'AI案例',
16 => '6.0广告'
];
}
... ...