作者 刘锟

Merge remote-tracking branch 'origin/master' into akun

@@ -247,7 +247,7 @@ class FetchTicketProjects extends Command @@ -247,7 +247,7 @@ class FetchTicketProjects extends Command
247 // $team_ids 去掉下标 247 // $team_ids 去掉下标
248 $team_ids_in = array_values($team_ids_in); 248 $team_ids_in = array_values($team_ids_in);
249 249
250 - $team_ids = ManageHr::whereIn('manage_id', $team_ids_in)->where('status', 1)->pluck('manage_id') 250 + $team_ids = ManageHr::whereIn('id', $team_ids_in)->where('status', 1)->pluck('manage_id')
251 ->unique() 251 ->unique()
252 ->filter(fn($v) => !is_null($v) && $v !== 0) 252 ->filter(fn($v) => !is_null($v) && $v !== 0)
253 ->values() 253 ->values()
@@ -1283,4 +1283,5 @@ class ProjectController extends BaseController @@ -1283,4 +1283,5 @@ class ProjectController extends BaseController
1283 NoticeLog::createLog(NoticeLog::TYPE_UPDATE_PROJECT_TDK, ['project_id' => $this->param['project_id'],'url'=>$this->param['url']]); 1283 NoticeLog::createLog(NoticeLog::TYPE_UPDATE_PROJECT_TDK, ['project_id' => $this->param['project_id'],'url'=>$this->param['url']]);
1284 $this->response('success',Code::SUCCESS,['url'=>$this->param['url']]); 1284 $this->response('success',Code::SUCCESS,['url'=>$this->param['url']]);
1285 } 1285 }
  1286 +
1286 } 1287 }
@@ -114,17 +114,24 @@ class RenewProjectController extends BaseController @@ -114,17 +114,24 @@ class RenewProjectController extends BaseController
114 * @time :2023/8/18 14:33 114 * @time :2023/8/18 14:33
115 */ 115 */
116 public function notHaveRenewItems(Project $project){ 116 public function notHaveRenewItems(Project $project){
117 - $this->map['extend_type'] = $project::TYPE_FIVE;//未续费网站 if(!empty($param['search']) && !empty($param['search_type'])){ 117 + $this->map['extend_type'] = $project::TYPE_FIVE;//未续费网站
118 if(!empty($this->map['title'])){ 118 if(!empty($this->map['title'])){
119 $this->map['title'] = ['like', '%'.$this->map['title'].'%']; 119 $this->map['title'] = ['like', '%'.$this->map['title'].'%'];
120 } 120 }
  121 + $domainModel = new DomainInfo();
  122 + if(!empty($this->map['domain'])){
  123 + $parsedUrl = parse_url($this->map['domain']);
  124 + $search_domain = $parsedUrl['host'] ?? $this->map['domain'];
  125 + $projectIds = $domainModel->selectField(['domain'=>['like','%'.$search_domain.'%']],'project_id');
  126 + $this->map['id'] = ['in',$projectIds];
  127 + unset($this->map['domain']);
  128 + }
121 $lists = $project->formatQuery($this->map)->with('payment')->with('deploy_build') 129 $lists = $project->formatQuery($this->map)->with('payment')->with('deploy_build')
122 ->with('deploy_optimize')->with('online_check') 130 ->with('deploy_optimize')->with('online_check')
123 ->with('project_after')->paginate($this->row, ['*'], 'page', $this->page); 131 ->with('project_after')->paginate($this->row, ['*'], 'page', $this->page);
124 if(!empty($lists)){ 132 if(!empty($lists)){
125 $lists = $lists->toArray(); 133 $lists = $lists->toArray();
126 $manageModel = new ManageHr(); 134 $manageModel = new ManageHr();
127 - $domainModel = new DomainInfo();  
128 foreach ($lists['list'] as $k=>$item){ 135 foreach ($lists['list'] as $k=>$item){
129 $item = $this->handleParam($item,$manageModel,$domainModel); 136 $item = $this->handleParam($item,$manageModel,$domainModel);
130 $lists['list'][$k] = $item; 137 $lists['list'][$k] = $item;
@@ -30,7 +30,7 @@ class AuthorityScoreController extends BaseController @@ -30,7 +30,7 @@ class AuthorityScoreController extends BaseController
30 } 30 }
31 31
32 /** 32 /**
33 - * @remark :豹猫数据统计表详情 33 + * @remark :白帽数据统计表详情
34 * @name :whiteHatReportInfo 34 * @name :whiteHatReportInfo
35 * @author :lyh 35 * @author :lyh
36 * @method :post 36 * @method :post
@@ -80,6 +80,8 @@ class KeywordController extends BaseController @@ -80,6 +80,8 @@ class KeywordController extends BaseController
80 public function searchParam($map){ 80 public function searchParam($map){
81 if(!empty($map['title'])){ 81 if(!empty($map['title'])){
82 $map['title'] = ['like','%'.$map['title'].'%']; 82 $map['title'] = ['like','%'.$map['title'].'%'];
  83 + }else{
  84 + unset($map['title']);
83 } 85 }
84 if(!empty($map['keyword_title'])){ 86 if(!empty($map['keyword_title'])){
85 $map['keyword_title'] = ['like','%'.$map['keyword_title'].'%']; 87 $map['keyword_title'] = ['like','%'.$map['keyword_title'].'%'];
@@ -330,7 +330,7 @@ class TranslateController extends BaseController @@ -330,7 +330,7 @@ class TranslateController extends BaseController
330 $this->pageSixList($data,$count,$v,1,15); 330 $this->pageSixList($data,$count,$v,1,15);
331 } 331 }
332 $blogInfo = $routeMapModel->read(['route'=>'blog']); 332 $blogInfo = $routeMapModel->read(['route'=>'blog']);
333 - if($blogInfo === false){ 333 + if($blogInfo === false && ($this->user['is_show_blog'] == 1)){
334 $blogModel = new Blog(); 334 $blogModel = new Blog();
335 $count = $blogModel->formatQuery(['status'=>1])->count(); 335 $count = $blogModel->formatQuery(['status'=>1])->count();
336 $v['route'] = 'blog'; 336 $v['route'] = 'blog';
@@ -738,6 +738,24 @@ class ProjectLogic extends BaseLogic @@ -738,6 +738,24 @@ class ProjectLogic extends BaseLogic
738 //改为异步 738 //改为异步
739 NoticeLog::createLog(NoticeLog::TYPE_INIT_PROJECT, ['project_id' => $param['id']]); 739 NoticeLog::createLog(NoticeLog::TYPE_INIT_PROJECT, ['project_id' => $param['id']]);
740 } 740 }
  741 + //推广续费网站单独处理
  742 + if($param['type'] == Project::TYPE_FOUR){
  743 + // 提取非 null 的 expire_at 字段
  744 + $validDates = array_filter(
  745 + array_column($param['payment']['renewal_record'] ?? [], 'expire_at'),
  746 + fn($date) => !is_null($date)
  747 + );
  748 + // 获取最大日期(如果有)
  749 + $maxExpireAt = $validDates ? max($validDates) : null;
  750 + if(!empty($maxExpireAt)){
  751 + $diff = (strtotime($maxExpireAt) - strtotime($param['uptime'] ?? date('Y-m-d'))) / (60 * 60 * 24);
  752 + if($param['project_type'] == Project::PROJECT_TYPE_SEO){
  753 + $param['deploy_build']['seo_service_duration'] = $diff;
  754 + }else{
  755 + $param['deploy_build']['service_duration'] = $diff;
  756 + }
  757 + }
  758 + }
741 return $this->success($param); 759 return $this->success($param);
742 } 760 }
743 761
@@ -61,7 +61,11 @@ class TranslateLogic extends BaseLogic @@ -61,7 +61,11 @@ class TranslateLogic extends BaseLogic
61 $param['url'] = $this->param['url']; 61 $param['url'] = $this->param['url'];
62 $info = $this->model->with('translate_data')->where($param)->first(); 62 $info = $this->model->with('translate_data')->where($param)->first();
63 //获取当前URl的所有文本内容 63 //获取当前URl的所有文本内容
  64 + try {
64 $text_array = $this->getUrlRead($url); 65 $text_array = $this->getUrlRead($url);
  66 + }catch (\Exception $e){
  67 + $text_array = [];
  68 + }
65 // 原始校对程序 69 // 原始校对程序
66 $old_key = [];//key值组成数据 70 $old_key = [];//key值组成数据
67 $data_read = json_decode($info && $info['translate_data'] ? $info['translate_data']['data'] : '',JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES); 71 $data_read = json_decode($info && $info['translate_data'] ? $info['translate_data']['data'] : '',JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES);