作者 lyh

Merge branch 'master' of http://47.244.231.31:8099/zhl/globalso-v6 into develop

@@ -23,7 +23,7 @@ class UpgradeProjectCount extends Command @@ -23,7 +23,7 @@ class UpgradeProjectCount extends Command
23 * 23 *
24 * @var string 24 * @var string
25 */ 25 */
26 - protected $signature = 'upgrade_count'; 26 + protected $signature = 'upgrade_count {project_id}';
27 27
28 /** 28 /**
29 * The console command description. 29 * The console command description.
@@ -33,7 +33,7 @@ class UpgradeProjectCount extends Command @@ -33,7 +33,7 @@ class UpgradeProjectCount extends Command
33 protected $description = '升级项目统计'; 33 protected $description = '升级项目统计';
34 34
35 public function handle(){ 35 public function handle(){
36 - $project_id = 769; 36 + $project_id = $this->argument('project_id');
37 ProjectServer::useProject($project_id); 37 ProjectServer::useProject($project_id);
38 $this->count($project_id); 38 $this->count($project_id);
39 DB::disconnect('custom_mysql'); 39 DB::disconnect('custom_mysql');
@@ -100,7 +100,8 @@ class UpgradeProjectCount extends Command @@ -100,7 +100,8 @@ class UpgradeProjectCount extends Command
100 * @time :2023/6/14 15:40 100 * @time :2023/6/14 15:40
101 */ 101 */
102 public function pv_num($day){ 102 public function pv_num($day){
103 - $pv = DB::connection('custom_mysql')->table('gl_customer_visit_item')->whereDate('updated_date', $day)->count(); 103 + //$pv = DB::connection('custom_mysql')->table('gl_customer_visit_item')->whereDate('updated_date', $day)->count();
  104 + $pv = DB::connection('custom_mysql')->table('gl_customer_visit')->whereDate('updated_date', $day)->sum('depth');
104 return $pv; 105 return $pv;
105 } 106 }
106 107
@@ -122,7 +122,7 @@ class ProjectUpdate extends Command @@ -122,7 +122,7 @@ class ProjectUpdate extends Command
122 $data = curl_c($url); 122 $data = curl_c($url);
123 if (isset($data['code']) && $data['code'] == 200) { 123 if (isset($data['code']) && $data['code'] == 200) {
124 $items = $data['data'] ?? []; 124 $items = $data['data'] ?? [];
125 - $this->category_insert($project_id, $items, 0); 125 + $this->category_insert($project_id, $items, 0, $domain_arr['host'], $web_url_domain, $home_url);
126 } else { 126 } else {
127 return true; 127 return true;
128 } 128 }
@@ -737,7 +737,7 @@ class ProjectUpdate extends Command @@ -737,7 +737,7 @@ class ProjectUpdate extends Command
737 } 737 }
738 738
739 //产品多级分类入库 739 //产品多级分类入库
740 - protected function category_insert($project_id, $items, $pid = 0) 740 + protected function category_insert($project_id, $items, $pid, $domain, $web_url_domain, $home_url)
741 { 741 {
742 $model = new Category(); 742 $model = new Category();
743 foreach ($items as $item) { 743 foreach ($items as $item) {
@@ -747,9 +747,17 @@ class ProjectUpdate extends Command @@ -747,9 +747,17 @@ class ProjectUpdate extends Command
747 if (!$parent) { 747 if (!$parent) {
748 try { 748 try {
749 $item['name'] = $this->special2str($item['name'] ?? ''); 749 $item['name'] = $this->special2str($item['name'] ?? '');
  750 + //图片
  751 + if (is_array($item['images'] ?? '')) {
  752 + $image = $item['images'][0] ?? '';
  753 + } else {
  754 + $image = $item['images'] ?? '';
  755 + }
  756 + $new_img = $this->source_download($image, $project_id, $domain, $web_url_domain, $home_url);
750 $parent_id = $model->addReturnId([ 757 $parent_id = $model->addReturnId([
751 'project_id' => $project_id, 758 'project_id' => $project_id,
752 'title' => $item['name'], 759 'title' => $item['name'],
  760 + 'image' => $new_img,
753 'pid' => $pid, 761 'pid' => $pid,
754 'keywords' => $item['keywords'] ?? '', 762 'keywords' => $item['keywords'] ?? '',
755 'describe' => $item['description'] ?? '', 763 'describe' => $item['description'] ?? '',
@@ -766,7 +774,7 @@ class ProjectUpdate extends Command @@ -766,7 +774,7 @@ class ProjectUpdate extends Command
766 } 774 }
767 775
768 if (!empty($item['children'] ?? [])) { 776 if (!empty($item['children'] ?? [])) {
769 - $this->category_insert($project_id, $item['children'], $parent_id); 777 + $this->category_insert($project_id, $item['children'], $parent_id, $domain, $web_url_domain, $home_url);
770 } 778 }
771 } 779 }
772 } 780 }
@@ -11,6 +11,7 @@ namespace App\Http\Controllers\Html; @@ -11,6 +11,7 @@ namespace App\Http\Controllers\Html;
11 11
12 use App\Http\Controllers\Controller; 12 use App\Http\Controllers\Controller;
13 use App\Models\Com\NoticeLog; 13 use App\Models\Com\NoticeLog;
  14 +use App\Models\CustomModule\CustomModule;
14 use App\Models\Project\Project; 15 use App\Models\Project\Project;
15 use App\Models\RouteMap\RouteMap; 16 use App\Models\RouteMap\RouteMap;
16 use App\Models\Service\Service as ServiceSettingModel; 17 use App\Models\Service\Service as ServiceSettingModel;
@@ -53,12 +54,27 @@ class UpdateHtml extends Controller @@ -53,12 +54,27 @@ class UpdateHtml extends Controller
53 * @method :post 54 * @method :post
54 * @time :2024/2/2 11:03 55 * @time :2024/2/2 11:03
55 */ 56 */
56 - public function getPageHtmlIsCustomized($source,$is_list){  
57 - $type = $this->getCustomizedType($source, $is_list);//获取定制界面类型  
58 - //查看当前页面是否定制,是否开启可视化  
59 - $page_array = (array)$this->user['is_visualization']->page_array;//获取所有定制界面  
60 - if (in_array($type, $page_array)) {//是定制界面  
61 - return BTemplate::IS_VISUALIZATION; 57 + public function getPageHtmlIsCustomized($source,$is_list,$is_custom){
  58 + if($is_custom == BTemplate::IS_CUSTOM){
  59 + $customModuleModel = new CustomModule();
  60 + $info = $customModuleModel->read(['id'=>$source]);
  61 + if($info === false){
  62 + $this->fail('当前扩展模块不存在或已被删除');
  63 + }
  64 + //扩展模块定制
  65 + if($is_list == BTemplate::IS_LIST && $info['list_customized'] == BTemplate::IS_VISUALIZATION){
  66 + return BTemplate::IS_VISUALIZATION;
  67 + }
  68 + if($is_list == BTemplate::IS_DETAIL && $info['detail_customized'] == BTemplate::IS_VISUALIZATION){
  69 + return BTemplate::IS_VISUALIZATION;
  70 + }
  71 + }else{
  72 + $type = $this->getCustomizedType($source, $is_list);//获取定制界面类型
  73 + //查看当前页面是否定制,是否开启可视化
  74 + $page_array = (array)$this->user['is_visualization']->page_array;//获取所有定制界面
  75 + if (in_array($type, $page_array)) {//是定制界面
  76 + return BTemplate::IS_VISUALIZATION;
  77 + }
62 } 78 }
63 return BTemplate::IS_NO_VISUALIZATION; 79 return BTemplate::IS_NO_VISUALIZATION;
64 } 80 }
@@ -120,4 +136,37 @@ class UpdateHtml extends Controller @@ -120,4 +136,37 @@ class UpdateHtml extends Controller
120 } 136 }
121 return $html; 137 return $html;
122 } 138 }
  139 +
  140 + /**
  141 + * @remark :定制页面头部类型---根据source获取type类型
  142 + * @name :getType
  143 + * @author :lyh
  144 + * @method :post
  145 + * @time :2023/11/16 11:20
  146 + */
  147 + public function getCustomizedType($source,$is_list){
  148 + $type = BTemplate::TYPE_HOME;
  149 + if($source == BTemplate::SOURCE_PRODUCT){
  150 + if($is_list == BTemplate::IS_LIST){
  151 + $type = BTemplate::TYPE_PRODUCT_LIST;
  152 + }else{
  153 + $type = BTemplate::TYPE_PRODUCT_DETAIL;
  154 + }
  155 + }
  156 + if($source == BTemplate::SOURCE_BLOG){
  157 + if($is_list == BTemplate::IS_LIST){
  158 + $type = BTemplate::TYPE_BLOG_LIST;
  159 + }else{
  160 + $type = BTemplate::TYPE_BLOG_DETAIL;
  161 + }
  162 + }
  163 + if($source == BTemplate::SOURCE_NEWS){
  164 + if($is_list == BTemplate::IS_LIST){
  165 + $type = BTemplate::TYPE_NEWS_LIST;
  166 + }else{
  167 + $type = BTemplate::TYPE_NEWS_DETAIL;
  168 + }
  169 + }
  170 + return $type;
  171 + }
123 } 172 }
@@ -156,13 +156,14 @@ class ProjectLogic extends BaseLogic @@ -156,13 +156,14 @@ class ProjectLogic extends BaseLogic
156 $this->syncImageFile($this->param['project_location'],$this->param['id']); 156 $this->syncImageFile($this->param['project_location'],$this->param['id']);
157 //创建站点 157 //创建站点
158 // $this->createSite($this->param); 158 // $this->createSite($this->param);
  159 + (new SyncService())->projectAcceptAddress($this->param['id']);
159 } 160 }
160 DB::commit(); 161 DB::commit();
161 }catch (\Exception $e){ 162 }catch (\Exception $e){
162 DB::rollBack(); 163 DB::rollBack();
163 $this->fail('保存失败,请联系管理员'); 164 $this->fail('保存失败,请联系管理员');
164 } 165 }
165 - (new SyncService())->projectAcceptAddress($this->param['id']); 166 +
166 return $this->success(); 167 return $this->success();
167 } 168 }
168 169
@@ -373,7 +374,7 @@ class ProjectLogic extends BaseLogic @@ -373,7 +374,7 @@ class ProjectLogic extends BaseLogic
373 'company' => $param['company'], 374 'company' => $param['company'],
374 'lead_name' => $param['lead_name'], 375 'lead_name' => $param['lead_name'],
375 'mobile' => $param['mobile'], 376 'mobile' => $param['mobile'],
376 - 'qq' => $param['qq'], 377 + 'qq' => $param['qq'] ?? '',
377 'channel' => json_encode($param['channel']), 378 'channel' => json_encode($param['channel']),
378 'requirement' => $param['requirement'], 379 'requirement' => $param['requirement'],
379 'cooperate_date' => $param['cooperate_date'], 380 'cooperate_date' => $param['cooperate_date'],