作者 赵彬吉
@@ -91,6 +91,13 @@ class ProjectUpdate extends Command @@ -91,6 +91,13 @@ class ProjectUpdate extends Command
91 if ($data_language) { 91 if ($data_language) {
92 $language_list = array_column($data_language, 'short'); 92 $language_list = array_column($data_language, 'short');
93 } 93 }
  94 + //获取所有页面
  95 + $page_list = [];
  96 + $url_page = 'https://' . $domain_arr['host'] . '/wp-content/cache/pages_list.json';
  97 + $data_page = http_get($url_page, ['charset' => 'UTF-8']);
  98 + if ($data_page) {
  99 + $page_list = array_column($data_page, 'path');
  100 + }
94 101
95 //设置数据库 102 //设置数据库
96 $project = ProjectServer::useProject($project_id); 103 $project = ProjectServer::useProject($project_id);
@@ -142,7 +149,7 @@ class ProjectUpdate extends Command @@ -142,7 +149,7 @@ class ProjectUpdate extends Command
142 $id = $keyword['id']; 149 $id = $keyword['id'];
143 } 150 }
144 151
145 - CollectTask::_insert($item['url'], $project_id, RouteMap::SOURCE_PRODUCT_KEYWORD, $id, $link_type, $language_list); 152 + CollectTask::_insert($item['url'], $project_id, RouteMap::SOURCE_PRODUCT_KEYWORD, $id, $link_type, $language_list, $page_list);
146 } 153 }
147 } 154 }
148 } 155 }
@@ -274,7 +281,7 @@ class ProjectUpdate extends Command @@ -274,7 +281,7 @@ class ProjectUpdate extends Command
274 $id = $product['id']; 281 $id = $product['id'];
275 } 282 }
276 283
277 - CollectTask::_insert($item['url'], $project_id, RouteMap::SOURCE_PRODUCT, $id, $link_type, $language_list); 284 + CollectTask::_insert($item['url'], $project_id, RouteMap::SOURCE_PRODUCT, $id, $link_type, $language_list, $page_list);
278 } 285 }
279 } 286 }
280 } 287 }
@@ -328,7 +335,7 @@ class ProjectUpdate extends Command @@ -328,7 +335,7 @@ class ProjectUpdate extends Command
328 $id = $news['id']; 335 $id = $news['id'];
329 } 336 }
330 337
331 - CollectTask::_insert($item['url'], $project_id, $api_type == 'news' ? RouteMap::SOURCE_NEWS : RouteMap::SOURCE_BLOG, $id, $link_type, $language_list); 338 + CollectTask::_insert($item['url'], $project_id, $api_type == 'news' ? RouteMap::SOURCE_NEWS : RouteMap::SOURCE_BLOG, $id, $link_type, $language_list, $page_list);
332 } 339 }
333 } 340 }
334 } 341 }
@@ -376,7 +383,7 @@ class ProjectUpdate extends Command @@ -376,7 +383,7 @@ class ProjectUpdate extends Command
376 $id = $custom['id']; 383 $id = $custom['id'];
377 } 384 }
378 385
379 - CollectTask::_insert($item['url'], $project_id, RouteMap::SOURCE_PAGE, $id, $link_type, $language_list); 386 + CollectTask::_insert($item['url'], $project_id, RouteMap::SOURCE_PAGE, $id, $link_type, $language_list, $page_list);
380 } 387 }
381 } 388 }
382 } 389 }
@@ -13,6 +13,7 @@ use App\Enums\Common\Code; @@ -13,6 +13,7 @@ use App\Enums\Common\Code;
13 use App\Http\Controllers\Aside\BaseController; 13 use App\Http\Controllers\Aside\BaseController;
14 use App\Models\ASide\APublicModel; 14 use App\Models\ASide\APublicModel;
15 use App\Models\Channel\Channel; 15 use App\Models\Channel\Channel;
  16 +use App\Models\Domain\DomainInfo;
16 use App\Models\Manage\Manage; 17 use App\Models\Manage\Manage;
17 use App\Models\Project\OnlineCheck; 18 use App\Models\Project\OnlineCheck;
18 use App\Models\Project\Project; 19 use App\Models\Project\Project;
@@ -82,7 +83,6 @@ class OnlineController extends BaseController @@ -82,7 +83,6 @@ class OnlineController extends BaseController
82 'gl_project_deploy_optimize.assist_mid AS optimize_assist_mid', 83 'gl_project_deploy_optimize.assist_mid AS optimize_assist_mid',
83 'gl_project_deploy_optimize.tech_mid AS optimize_tech_mid', 84 'gl_project_deploy_optimize.tech_mid AS optimize_tech_mid',
84 'gl_project_deploy_optimize.domain AS domain', 85 'gl_project_deploy_optimize.domain AS domain',
85 - 'gl_project_payment.amount AS amount',  
86 ]; 86 ];
87 return $select; 87 return $select;
88 } 88 }
@@ -127,9 +127,14 @@ class OnlineController extends BaseController @@ -127,9 +127,14 @@ class OnlineController extends BaseController
127 * @time :2023/8/18 10:58 127 * @time :2023/8/18 10:58
128 */ 128 */
129 public function searchParam(&$query){ 129 public function searchParam(&$query){
130 - //搜索条件处理  
131 - if(isset($this->map['title'])){  
132 - $query = $query->where('gl_project.title','like','%'.$this->map['title'].'%'); 130 + if(!empty($this->map['search']) && !empty($this->map['search_type'])){
  131 + // 搜索域名
  132 + if($this->map['search_type'] == 'test_domain'){
  133 + $query->where('gl_project_deploy_build.test_domain','like','%'.$this->map['search'].'%');
  134 + } else {
  135 + // 搜索名称
  136 + $query->where('gl_project.title', 'like', '%' . $this->map['search'] . '%');
  137 + }
133 } 138 }
134 $query = $query->where('gl_project.status',1);//TODO::已提交审核 139 $query = $query->where('gl_project.status',1);//TODO::已提交审核
135 return $query; 140 return $query;
@@ -206,6 +206,9 @@ class ProjectController extends BaseController @@ -206,6 +206,9 @@ class ProjectController extends BaseController
206 if(isset($this->map['channel_id']) && !empty($this->map['channel_id'])){ 206 if(isset($this->map['channel_id']) && !empty($this->map['channel_id'])){
207 $query->where('gl_project.channel','like','%"channel_id": "'.$this->map['channel_id'].'"%'); 207 $query->where('gl_project.channel','like','%"channel_id": "'.$this->map['channel_id'].'"%');
208 } 208 }
  209 + if(isset($this->map['user_id']) && !empty($this->map['user_id'])){
  210 + $query->where('gl_project.channel','like','%"user_id": "'.$this->map['channel_id'].'"%');
  211 + }
209 return $query; 212 return $query;
210 } 213 }
211 214
@@ -24,6 +24,10 @@ class WebSettingImageController extends BaseController @@ -24,6 +24,10 @@ class WebSettingImageController extends BaseController
24 */ 24 */
25 public function lists(WebSettingImage $webSettingImage){ 25 public function lists(WebSettingImage $webSettingImage){
26 $list = $webSettingImage->list([],'id',['id','image','type']); 26 $list = $webSettingImage->list([],'id',['id','image','type']);
  27 + foreach ($list as $k=>$v){
  28 + $v['image'] = getImageUrl($v['image']);
  29 + $list[$k] = $v;
  30 + }
27 $this->response('success',Code::SUCCESS,$list); 31 $this->response('success',Code::SUCCESS,$list);
28 } 32 }
29 33
@@ -35,17 +39,16 @@ class WebSettingImageController extends BaseController @@ -35,17 +39,16 @@ class WebSettingImageController extends BaseController
35 * @time :2023/9/21 15:17 39 * @time :2023/9/21 15:17
36 */ 40 */
37 public function save(WebSettingImage $webSettingImage){ 41 public function save(WebSettingImage $webSettingImage){
  42 + try {
  43 + $webSettingImage->del(['project_id'=>$this->user['project_id']]);
38 foreach ($this->param['data'] as $v){ 44 foreach ($this->param['data'] as $v){
39 - if(isset($v['id']) && !empty($v['id'])){  
40 - $rs = $webSettingImage->edit($v,['id'=>$v['id']]);  
41 - }else{  
42 $v['project_id'] = $this->user['project_id']; 45 $v['project_id'] = $this->user['project_id'];
43 - $rs = $webSettingImage->add($v); 46 + $v['image'] = str_replace_url($v['image']);
  47 + $webSettingImage->add($v);
44 } 48 }
45 - if($rs === false){ 49 + }catch (\Exception $e){
46 $this->response('系统错误请联系管理员'); 50 $this->response('系统错误请联系管理员');
47 } 51 }
48 - }  
49 $this->response('success'); 52 $this->response('success');
50 } 53 }
51 } 54 }
@@ -136,6 +136,16 @@ class ProductLogic extends BaseLogic @@ -136,6 +136,16 @@ class ProductLogic extends BaseLogic
136 public function editList(){ 136 public function editList(){
137 $this->param['category_id'] = $this->getLastCategory($this->param['category_id']); 137 $this->param['category_id'] = $this->getLastCategory($this->param['category_id']);
138 $this->param['keyword_id'] = $this->saveKeyword($this->param['keyword_id']); 138 $this->param['keyword_id'] = $this->saveKeyword($this->param['keyword_id']);
  139 + if(isset($this->param['gallery']) && !empty($this->param['gallery'])){
  140 + foreach ($this->param['gallery'] as $k => $v){
  141 + $v['url'] = str_replace_url($v['url']);
  142 + $this->param['gallery'][$k] = $v;
  143 + }
  144 + $this->param['thumb'] = Arr::a2s($this->param['gallery'][0] ?? []);
  145 + $this->param['gallery'] = Arr::a2s($this->param['gallery'] ?? []);
  146 + }else{
  147 + $this->param['thumb'] = [];
  148 + }
139 $this->model->edit($this->param,['id'=>$this->param['id']]); 149 $this->model->edit($this->param,['id'=>$this->param['id']]);
140 return $this->success(); 150 return $this->success();
141 } 151 }
@@ -191,6 +201,8 @@ class ProductLogic extends BaseLogic @@ -191,6 +201,8 @@ class ProductLogic extends BaseLogic
191 } 201 }
192 $param['thumb'] = Arr::a2s($param['gallery'][0] ?? []); 202 $param['thumb'] = Arr::a2s($param['gallery'][0] ?? []);
193 $param['gallery'] = Arr::a2s($param['gallery'] ?? []); 203 $param['gallery'] = Arr::a2s($param['gallery'] ?? []);
  204 + }else{
  205 + $param['thumb'] = [];
194 } 206 }
195 $param['attrs'] = Arr::a2s($param['attrs'] ?? []); 207 $param['attrs'] = Arr::a2s($param['attrs'] ?? []);
196 $param['attr_id'] = Arr::arrToSet($param['attr_id'] ?? ''); 208 $param['attr_id'] = Arr::arrToSet($param['attr_id'] ?? '');
@@ -201,6 +201,7 @@ class UserLoginLogic @@ -201,6 +201,7 @@ class UserLoginLogic
201 $info['upload_config'] = $project['upload_config']; 201 $info['upload_config'] = $project['upload_config'];
202 $info['image_max'] = $project['image_max']; 202 $info['image_max'] = $project['image_max'];
203 $info['configuration'] = $project['deploy_build']['configuration']; 203 $info['configuration'] = $project['deploy_build']['configuration'];
  204 + $info['type'] = $project['type'];
204 if($info['is_customized'] == 1){ 205 if($info['is_customized'] == 1){
205 $info['is_visualization'] = json_decode($project['is_visualization']); 206 $info['is_visualization'] = json_decode($project['is_visualization']);
206 } 207 }
@@ -17,7 +17,7 @@ class CollectTask extends Base @@ -17,7 +17,7 @@ class CollectTask extends Base
17 const STATUS_COM = 2; 17 const STATUS_COM = 2;
18 const STATUS_FAIL = 3; 18 const STATUS_FAIL = 3;
19 19
20 - public static function _insert($url, $project_id, $source, $source_id, $link_type = 0, $language_list = []) 20 + public static function _insert($url, $project_id, $source, $source_id, $link_type = 0, $language_list = [], $page_list = [])
21 { 21 {
22 if (!$url) { 22 if (!$url) {
23 return; 23 return;
@@ -35,10 +35,10 @@ class CollectTask extends Base @@ -35,10 +35,10 @@ class CollectTask extends Base
35 ]; 35 ];
36 36
37 $task = self::where($where)->first(); 37 $task = self::where($where)->first();
38 - if (!$task) { 38 + $data = [];
39 $now = date('Y-m-d H:i:s'); 39 $now = date('Y-m-d H:i:s');
40 - $data = [  
41 - [ 40 + if (!$task) {
  41 + $data[] = [
42 'project_id' => $project_id, 42 'project_id' => $project_id,
43 'source' => $source, 43 'source' => $source,
44 'source_id' => $source_id, 44 'source_id' => $source_id,
@@ -47,10 +47,10 @@ class CollectTask extends Base @@ -47,10 +47,10 @@ class CollectTask extends Base
47 'language' => '', 47 'language' => '',
48 'created_at' => $now, 48 'created_at' => $now,
49 'updated_at' => $now, 49 'updated_at' => $now,
50 - ]  
51 ]; 50 ];
  51 + }
52 52
53 - if ($link_type > 0 && $language_list) { 53 + if ($link_type > 0 && $language_list && in_array($url_arr['path'], $page_list)) {
54 $domain_arr = explode('.', $url_arr['host']); 54 $domain_arr = explode('.', $url_arr['host']);
55 foreach ($language_list as $v_lan) { 55 foreach ($language_list as $v_lan) {
56 if ($link_type == 1) { 56 if ($link_type == 1) {
@@ -77,5 +77,4 @@ class CollectTask extends Base @@ -77,5 +77,4 @@ class CollectTask extends Base
77 77
78 self::insert($data); 78 self::insert($data);
79 } 79 }
80 - }  
81 } 80 }
@@ -128,12 +128,8 @@ class RouteMap extends Base @@ -128,12 +128,8 @@ class RouteMap extends Base
128 } 128 }
129 if($source == self::SOURCE_NEWS){ 129 if($source == self::SOURCE_NEWS){
130 $route_map->path = self::SOURCE_NEWS; 130 $route_map->path = self::SOURCE_NEWS;
131 - }elseif($source == self::SOURCE_NEWS_CATE){  
132 - $route_map->path = self::PATH_NEWS_CATE;  
133 }elseif ($source == self::SOURCE_BLOG){ 131 }elseif ($source == self::SOURCE_BLOG){
134 $route_map->path = self::SOURCE_BLOG; 132 $route_map->path = self::SOURCE_BLOG;
135 - }elseif ($source == self::SOURCE_BLOG_CATE){  
136 - $route_map->path = self::PATH_BLOG_CATE;  
137 } 133 }
138 $route_map->route = $route; 134 $route_map->route = $route;
139 $route_map->save(); 135 $route_map->save();