作者 lyh

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

@@ -93,4 +93,9 @@ class TdkTest extends Command @@ -93,4 +93,9 @@ class TdkTest extends Command
93 } 93 }
94 } 94 }
95 } 95 }
  96 +
  97 + public function ceshi(){
  98 + //under_ceshi
  99 + $model = new Cesjo();
  100 + }
96 } 101 }
@@ -308,6 +308,13 @@ class ProjectUpdate extends Command @@ -308,6 +308,13 @@ class ProjectUpdate extends Command
308 $keyword_id = ',' . implode(',', array_column($keyword_arr, 'id')) . ','; 308 $keyword_id = ',' . implode(',', array_column($keyword_arr, 'id')) . ',';
309 } 309 }
310 } 310 }
  311 + //产品参数
  312 + $attrs = [];
  313 + if ($item['attr'] ?? []) {
  314 + foreach ($item['attr'] as $k_attr => $attr) {
  315 + $attrs[] = ['key' => $k_attr, 'value' => $attr];
  316 + }
  317 + }
311 //名称去掉特殊符号 318 //名称去掉特殊符号
312 $item['ttile'] = $this->special2str($item['ttile'] ?? ''); 319 $item['ttile'] = $this->special2str($item['ttile'] ?? '');
313 320
@@ -323,6 +330,7 @@ class ProjectUpdate extends Command @@ -323,6 +330,7 @@ class ProjectUpdate extends Command
323 'keyword_id' => $keyword_id, 330 'keyword_id' => $keyword_id,
324 'thumb' => isset($gallery[0]) ? Arr::a2s($gallery[0]) : '', 331 'thumb' => isset($gallery[0]) ? Arr::a2s($gallery[0]) : '',
325 'gallery' => Arr::a2s($gallery), 332 'gallery' => Arr::a2s($gallery),
  333 + 'attrs' => Arr::a2s($attrs),
326 'seo_mate' => Arr::a2s([ 334 'seo_mate' => Arr::a2s([
327 'title' => $item['ttile'], 335 'title' => $item['ttile'],
328 'keyword' => $item['keywords'] ?? '', 336 'keyword' => $item['keywords'] ?? '',
@@ -353,6 +361,7 @@ class ProjectUpdate extends Command @@ -353,6 +361,7 @@ class ProjectUpdate extends Command
353 'keyword_id' => $keyword_id, 361 'keyword_id' => $keyword_id,
354 'thumb' => isset($gallery[0]) ? Arr::a2s($gallery[0]) : '', 362 'thumb' => isset($gallery[0]) ? Arr::a2s($gallery[0]) : '',
355 'gallery' => Arr::a2s($gallery), 363 'gallery' => Arr::a2s($gallery),
  364 + 'attrs' => Arr::a2s($attrs),
356 'seo_mate' => Arr::a2s([ 365 'seo_mate' => Arr::a2s([
357 'title' => $item['ttile'], 366 'title' => $item['ttile'],
358 'keyword' => $item['keywords'] ?? '', 367 'keyword' => $item['keywords'] ?? '',
@@ -361,7 +370,7 @@ class ProjectUpdate extends Command @@ -361,7 +370,7 @@ class ProjectUpdate extends Command
361 'send_time' => $item['post_date'] ?? date('Y-m-d H:i:s'), 370 'send_time' => $item['post_date'] ?? date('Y-m-d H:i:s'),
362 'sort' => $item['sort'] ?? 0, 371 'sort' => $item['sort'] ?? 0,
363 ], ['id' => $id]); 372 ], ['id' => $id]);
364 - }else{ 373 + } else {
365 //按6.0展示只更新分类 374 //按6.0展示只更新分类
366 $model->edit([ 375 $model->edit([
367 'category_id' => $category_id 376 'category_id' => $category_id
@@ -656,15 +665,15 @@ class ProjectUpdate extends Command @@ -656,15 +665,15 @@ class ProjectUpdate extends Command
656 $item['title'] = $this->special2str($item['title'] ?? ''); 665 $item['title'] = $this->special2str($item['title'] ?? '');
657 //排序 666 //排序
658 $sort = 0; 667 $sort = 0;
659 - if(isset($item['listorder'])){ 668 + if (isset($item['listorder'])) {
660 $sort = $item['listorder']; 669 $sort = $item['listorder'];
661 } 670 }
662 - if(isset($item['sort'])){ 671 + if (isset($item['sort'])) {
663 $sort = $item['sort']; 672 $sort = $item['sort'];
664 } 673 }
665 674
666 try { 675 try {
667 - $custom_content = $model->read(['route' => $route], ['id','six_read']); 676 + $custom_content = $model->read(['route' => $route], ['id', 'six_read']);
668 if (!$custom_content) { 677 if (!$custom_content) {
669 $id = $model->insertGetId([ 678 $id = $model->insertGetId([
670 'project_id' => $project_id, 679 'project_id' => $project_id,
@@ -688,7 +697,7 @@ class ProjectUpdate extends Command @@ -688,7 +697,7 @@ class ProjectUpdate extends Command
688 } else { 697 } else {
689 $id = $custom_content['id']; 698 $id = $custom_content['id'];
690 $six_read = $custom_content['six_read']; 699 $six_read = $custom_content['six_read'];
691 - if($six_read){ 700 + if ($six_read) {
692 $model->edit([ 701 $model->edit([
693 'name' => $item['title'], 702 'name' => $item['title'],
694 'category_id' => $category_id, 703 'category_id' => $category_id,
@@ -701,7 +710,7 @@ class ProjectUpdate extends Command @@ -701,7 +710,7 @@ class ProjectUpdate extends Command
701 } 710 }
702 711
703 //扩展字段 712 //扩展字段
704 - if($six_read){ 713 + if ($six_read) {
705 if ($item['extend'] ?? []) { 714 if ($item['extend'] ?? []) {
706 foreach ($item['extend'] as $ke => $ve) { 715 foreach ($item['extend'] as $ke => $ve) {
707 $extend = $extend_model->read(['title' => $ke]); 716 $extend = $extend_model->read(['title' => $ke]);
@@ -442,6 +442,24 @@ class BTemplateLogic extends BaseLogic @@ -442,6 +442,24 @@ class BTemplateLogic extends BaseLogic
442 */ 442 */
443 public function handleVisualizationParam($html,$source, $is_list,$is_custom,$data){ 443 public function handleVisualizationParam($html,$source, $is_list,$is_custom,$data){
444 if($this->user['is_customized'] == BTemplate::IS_VISUALIZATION){//定制项目 444 if($this->user['is_customized'] == BTemplate::IS_VISUALIZATION){//定制项目
  445 + //TODO::扩展模块定制单独处理
  446 + if($is_custom == BTemplate::IS_CUSTOM){
  447 + $customModuleModel = new CustomModule();
  448 + $info = $customModuleModel->read(['id'=>$source]);
  449 + if($info === false){
  450 + $this->fail('当前扩展模块不存在或已被删除');
  451 + }
  452 + //todo::扩展模块(列表页/详情页)定制
  453 + if($info['list_customized'] == BTemplate::IS_VISUALIZATION || $info['detail_customized'] == BTemplate::IS_VISUALIZATION) {
  454 + $data['html'] = $html;
  455 + $data['type'] = BTemplate::ALL_HTML;
  456 + }else{
  457 + $mainInfo = $this->handleTemplateHtml($html);
  458 + $data['main_html'] = $mainInfo['main_html'];
  459 + $data['main_css'] = $mainInfo['main_css'];
  460 + }
  461 + return $this->success($data);
  462 + }
445 $type = $this->getCustomizedType($source, $is_list);//获取定制界面类型 463 $type = $this->getCustomizedType($source, $is_list);//获取定制界面类型
446 //查看当前页面是否定制,是否开启可视化 464 //查看当前页面是否定制,是否开启可视化
447 $page_array = (array)$this->user['is_visualization']->page_array;//获取所有定制界面 465 $page_array = (array)$this->user['is_visualization']->page_array;//获取所有定制界面
@@ -449,19 +467,6 @@ class BTemplateLogic extends BaseLogic @@ -449,19 +467,6 @@ class BTemplateLogic extends BaseLogic
449 $data['html'] = $html; 467 $data['html'] = $html;
450 $data['type'] = BTemplate::ALL_HTML; 468 $data['type'] = BTemplate::ALL_HTML;
451 }else{ 469 }else{
452 - //TODO::扩展模块定制单独处理  
453 - if($is_custom == BTemplate::IS_CUSTOM){  
454 - $customModuleModel = new CustomModule();  
455 - $info = $customModuleModel->read(['id'=>$source]);  
456 - if($info === false){  
457 - $this->fail('当前扩展模块不存在或已被删除');  
458 - }  
459 - //todo::扩展模块(列表页/详情页)定制  
460 - if($info['list_customized'] == BTemplate::IS_VISUALIZATION || $info['detail_customized'] == BTemplate::IS_VISUALIZATION) {  
461 - $data['html'] = $html;  
462 - $data['type'] = BTemplate::ALL_HTML;  
463 - }  
464 - }  
465 $mainInfo = $this->handleTemplateHtml($html); 470 $mainInfo = $this->handleTemplateHtml($html);
466 $data['main_html'] = $mainInfo['main_html']; 471 $data['main_html'] = $mainInfo['main_html'];
467 $data['main_css'] = $mainInfo['main_css']; 472 $data['main_css'] = $mainInfo['main_css'];
@@ -436,8 +436,8 @@ class ProductLogic extends BaseLogic @@ -436,8 +436,8 @@ class ProductLogic extends BaseLogic
436 public function setCopyProduct(){ 436 public function setCopyProduct(){
437 $info = $this->model->read(['id'=>$this->param['id']]); 437 $info = $this->model->read(['id'=>$this->param['id']]);
438 $param = $this->setProductParams($info); 438 $param = $this->setProductParams($info);
439 - DB::beginTransaction();  
440 - try { 439 +// DB::beginTransaction();
  440 +// try {
441 $save_id = $this->model->insertGetId($param); 441 $save_id = $this->model->insertGetId($param);
442 CategoryRelated::saveRelated($save_id, $info['category_id']); 442 CategoryRelated::saveRelated($save_id, $info['category_id']);
443 $route = preg_replace('/-product.*/', '', $param['route']); 443 $route = preg_replace('/-product.*/', '', $param['route']);
@@ -448,11 +448,11 @@ class ProductLogic extends BaseLogic @@ -448,11 +448,11 @@ class ProductLogic extends BaseLogic
448 $this->copyTemplate($this->param['id'],$info['project_id'],$save_id); 448 $this->copyTemplate($this->param['id'],$info['project_id'],$save_id);
449 //同步扩展字段 449 //同步扩展字段
450 $this->copyExtendInfo($info['id'],$save_id); 450 $this->copyExtendInfo($info['id'],$save_id);
451 - DB::commit();  
452 - }catch (\Exception $e){  
453 - DB::rollBack();  
454 - $this->fail('复制失败,请联系管理员');  
455 - } 451 +// DB::commit();
  452 +// }catch (\Exception $e){
  453 +// DB::rollBack();
  454 +// $this->fail('复制失败,请联系管理员');
  455 +// }
456 return $this->success(['id'=>$save_id]); 456 return $this->success(['id'=>$save_id]);
457 } 457 }
458 458