作者 lyh

gx

@@ -95,6 +95,7 @@ class ProjectController extends BaseController @@ -95,6 +95,7 @@ class ProjectController extends BaseController
95 'gl_project_deploy_build.dept_id AS dept_id', 95 'gl_project_deploy_build.dept_id AS dept_id',
96 'gl_project_deploy_build.keyword_num AS key', 96 'gl_project_deploy_build.keyword_num AS key',
97 'gl_project_deploy_build.service_duration AS day', 97 'gl_project_deploy_build.service_duration AS day',
  98 + 'gl_project_deploy_build.is_comment AS is_comment',
98 'gl_project_deploy_build.leader_mid AS leader_mid', 99 'gl_project_deploy_build.leader_mid AS leader_mid',
99 'gl_project_deploy_build.manager_mid AS manager_mid', 100 'gl_project_deploy_build.manager_mid AS manager_mid',
100 'gl_project_deploy_build.designer_mid AS designer_mid', 101 'gl_project_deploy_build.designer_mid AS designer_mid',
@@ -246,7 +246,7 @@ class ComController extends BaseController @@ -246,7 +246,7 @@ class ComController extends BaseController
246 * @time :2024/9/14 13:32 246 * @time :2024/9/14 13:32
247 */ 247 */
248 public function getIsComment(){ 248 public function getIsComment(){
249 - return $this->user['is_subscribe'] ?? 0; 249 + return $this->user['is_common'] ?? 0;
250 } 250 }
251 251
252 /** 252 /**
@@ -128,10 +128,37 @@ class KeywordLogic extends BaseLogic @@ -128,10 +128,37 @@ class KeywordLogic extends BaseLogic
128 if(!isset($param['is_video_keyword']) || $param['is_video_keyword'] == null){ 128 if(!isset($param['is_video_keyword']) || $param['is_video_keyword'] == null){
129 $param['is_video_keyword'] = 0; 129 $param['is_video_keyword'] = 0;
130 } 130 }
  131 + $param['first_word'] = mb_substr($param['first_word'], 0, 1);
  132 + if (preg_match("/[\x{4e00}-\x{9fa5}]/u", $param['first_word'])) {
  133 + $param['first_word'] = 'all'; // 如果是中文字符,则置为空
  134 + }
131 return $param; 135 return $param;
132 } 136 }
133 137
134 /** 138 /**
  139 + * @remark :获取字符串首字符
  140 + * @name :first_word
  141 + * @author :lyh
  142 + * @method :post
  143 + * @time :2024/10/28 10:47
  144 + */
  145 + public function first_word($title){
  146 + $first_title = mb_substr($title, 0, 1);
  147 + if (preg_match("/[\x{4e00}-\x{9fa5}]/u", $first_title)) {
  148 + $first_title = 'all'; // 如果是中文字符,则置为空
  149 + }
  150 + //返回对应的键
  151 + $keywordModel = new Keyword();
  152 + $firstNumWord = $keywordModel->firstNumWord;
  153 + foreach($firstNumWord as $k => $v){
  154 + if($v == $first_title){
  155 + return $k;
  156 + }
  157 + }
  158 + return null;
  159 + }
  160 +
  161 + /**
135 * @remark :批量添加关键词任务, 异步处理 162 * @remark :批量添加关键词任务, 异步处理
136 * @name :batchAdd 163 * @name :batchAdd
137 * @author :lyh 164 * @author :lyh
@@ -17,6 +17,38 @@ class Keyword extends Base @@ -17,6 +17,38 @@ class Keyword extends Base
17 protected $connection = 'custom_mysql'; 17 protected $connection = 'custom_mysql';
18 18
19 const STATUS_ACTIVE = 1; 19 const STATUS_ACTIVE = 1;
  20 + //获取字母对应数字
  21 + public $firstNumWord = [
  22 + 0=>"0",
  23 + 1=>"a",
  24 + 2=>"b",
  25 + 3=>"c",
  26 + 4=>"d",
  27 + 5=>"e",
  28 + 6=>"f",
  29 + 7=>"g",
  30 + 8=>"h",
  31 + 9=>"i",
  32 + 10=>"j",
  33 + 11=>"k",
  34 + 12=>"l",
  35 + 13=>"m",
  36 + 14=>"n",
  37 + 15=>"o",
  38 + 16=>"p",
  39 + 17=>"q",
  40 + 18=>"r",
  41 + 19=>"s",
  42 + 20=>"t",
  43 + 21=>"u",
  44 + 22=>"v",
  45 + 23=>"w",
  46 + 24=>"x",
  47 + 25=>"y",
  48 + 26=>"z",
  49 + 27=>"all",
  50 + ];
  51 +
20 /** 52 /**
21 * @remark :视频 53 * @remark :视频
22 * @name :getKeywordVideoAttribute 54 * @name :getKeywordVideoAttribute