作者 赵彬吉
... ... @@ -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{
... ...