作者 Your Name
... ... @@ -139,13 +139,15 @@ class AdsController extends BaseController
//是否v6
$domain_info = DomainInfo::where('domain', $domain)->first();
if($domain_info){
$channel = Project::where('id', $domain_info['project_id'])->value('channel');
$data = [
'is_v6' => 1,
'agent' => trim(explode('-', Channel::getChannelText($channel['user_id']??0))[0]),
'domain' => $domain,
];
return $this->response('success', Code::SUCCESS, $data);
$channel = Project::where('id', $domain_info['project_id'])->where('delete_status', 1)->value('channel');
if($channel){
$data = [
'is_v6' => 1,
'agent' => trim(explode('-', Channel::getChannelText($channel['user_id']??0))[0]),
'domain' => $domain,
];
return $this->response('success', Code::SUCCESS, $data);
}
}
$res = (new QuanqiusouApi())->getV5Agent($domain);
if(empty($res['status']) || $res['status'] != 200){
... ... @@ -228,7 +230,8 @@ class AdsController extends BaseController
$domain = trim($request->input('domain'));
$company = trim($request->input('company'));
$operator = trim($request->input('operator'));
$num = trim($request->input('num'));
$num = intval($request->input('num'));
$row = intval($request->input('row', 20));
$result = ReInquiryCount::when($task_id, function ($query, $task_id) {
return $query->WhereRaw("FIND_IN_SET({$task_id}, `task_ids`)");
... ... @@ -243,7 +246,7 @@ class AdsController extends BaseController
return $query->where('num', $operator?:'=', $num);
})
->orderBy('num', 'desc')
->paginate();
->paginate($row);
foreach ($result as $item){
$item->tasks = $item->tasks; //调用访问器
... ...
... ... @@ -15,6 +15,7 @@ use App\Models\RouteMap\RouteMap;
use App\Models\User\ProjectMenu as ProjectMenuModel;
use App\Models\User\ProjectRole as ProjectRoleModel;
use App\Models\User\User;
use Illuminate\Support\Facades\Artisan;
use Illuminate\Support\Facades\Cache;
/***
... ... @@ -398,4 +399,15 @@ class ComController extends BaseController
$this->response('success',Code::SUCCESS,$lists);
}
/**
* @remark :
* @name :month_count
* @author :lyh
* @method :post
* @time :2024/10/28 11:51
*/
public function month_count(){
Artisan::call('month_project '.$this->user['project_id']);
$this->response('重新刷新中,请稍后刷新查询');
}
}
... ...
... ... @@ -128,6 +128,7 @@ class KeywordLogic extends BaseLogic
if(!isset($param['is_video_keyword']) || $param['is_video_keyword'] == null){
$param['is_video_keyword'] = 0;
}
$param['first_word'] = $this->first_word($param['title']);
return $param;
}
... ... @@ -140,9 +141,6 @@ class KeywordLogic extends BaseLogic
*/
public function first_word($title){
$first_title = mb_substr($title, 0, 1);
if (preg_match("/[\x{4e00}-\x{9fa5}]/u", $first_title)) {
$first_title = 'all'; // 如果是中文字符,则置为空
}
//返回对应的键
$keywordModel = new Keyword();
$firstNumWord = $keywordModel->firstNumWord;
... ... @@ -151,7 +149,7 @@ class KeywordLogic extends BaseLogic
return $k;
}
}
return null;
return 27;
}
/**
... ... @@ -174,6 +172,7 @@ class KeywordLogic extends BaseLogic
$param['created_at'] = date('Y-m-d H:i:s');
$param['updated_at'] = $param['created_at'];
$param['title'] = $v;
$param['first_word'] = $this->first_word($param['title']);
$this->model->insertGetId($param);
}
}
... ... @@ -247,7 +246,7 @@ class KeywordLogic extends BaseLogic
if($v){
$keyword_info = $this->model->read(['title'=>$v]);
if(!$keyword_info){
$k_id = $this->model->addReturnId(['title'=>$v,'project_id'=>$project_id]);
$k_id = $this->model->addReturnId(['title'=>$v,'first_word' => $this->first_word($v),'project_id'=>$project_id]);
$route = RouteMap::setRoute($v, RouteMap::SOURCE_PRODUCT_KEYWORD, $k_id, $project_id);
$this->model->edit(['route'=>$route],['id'=>$k_id]);
}else{
... ...