作者 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
}
}
}
public function ceshi(){
//under_ceshi
$model = new Cesjo();
}
}
... ...
... ... @@ -308,6 +308,13 @@ class ProjectUpdate extends Command
$keyword_id = ',' . implode(',', array_column($keyword_arr, 'id')) . ',';
}
}
//产品参数
$attrs = [];
if ($item['attr'] ?? []) {
foreach ($item['attr'] as $k_attr => $attr) {
$attrs[] = ['key' => $k_attr, 'value' => $attr];
}
}
//名称去掉特殊符号
$item['ttile'] = $this->special2str($item['ttile'] ?? '');
... ... @@ -323,6 +330,7 @@ class ProjectUpdate extends Command
'keyword_id' => $keyword_id,
'thumb' => isset($gallery[0]) ? Arr::a2s($gallery[0]) : '',
'gallery' => Arr::a2s($gallery),
'attrs' => Arr::a2s($attrs),
'seo_mate' => Arr::a2s([
'title' => $item['ttile'],
'keyword' => $item['keywords'] ?? '',
... ... @@ -353,6 +361,7 @@ class ProjectUpdate extends Command
'keyword_id' => $keyword_id,
'thumb' => isset($gallery[0]) ? Arr::a2s($gallery[0]) : '',
'gallery' => Arr::a2s($gallery),
'attrs' => Arr::a2s($attrs),
'seo_mate' => Arr::a2s([
'title' => $item['ttile'],
'keyword' => $item['keywords'] ?? '',
... ... @@ -361,7 +370,7 @@ class ProjectUpdate extends Command
'send_time' => $item['post_date'] ?? date('Y-m-d H:i:s'),
'sort' => $item['sort'] ?? 0,
], ['id' => $id]);
}else{
} else {
//按6.0展示只更新分类
$model->edit([
'category_id' => $category_id
... ... @@ -656,15 +665,15 @@ class ProjectUpdate extends Command
$item['title'] = $this->special2str($item['title'] ?? '');
//排序
$sort = 0;
if(isset($item['listorder'])){
if (isset($item['listorder'])) {
$sort = $item['listorder'];
}
if(isset($item['sort'])){
if (isset($item['sort'])) {
$sort = $item['sort'];
}
try {
$custom_content = $model->read(['route' => $route], ['id','six_read']);
$custom_content = $model->read(['route' => $route], ['id', 'six_read']);
if (!$custom_content) {
$id = $model->insertGetId([
'project_id' => $project_id,
... ... @@ -688,7 +697,7 @@ class ProjectUpdate extends Command
} else {
$id = $custom_content['id'];
$six_read = $custom_content['six_read'];
if($six_read){
if ($six_read) {
$model->edit([
'name' => $item['title'],
'category_id' => $category_id,
... ... @@ -701,7 +710,7 @@ class ProjectUpdate extends Command
}
//扩展字段
if($six_read){
if ($six_read) {
if ($item['extend'] ?? []) {
foreach ($item['extend'] as $ke => $ve) {
$extend = $extend_model->read(['title' => $ke]);
... ...
... ... @@ -442,6 +442,24 @@ class BTemplateLogic extends BaseLogic
*/
public function handleVisualizationParam($html,$source, $is_list,$is_custom,$data){
if($this->user['is_customized'] == BTemplate::IS_VISUALIZATION){//定制项目
//TODO::扩展模块定制单独处理
if($is_custom == BTemplate::IS_CUSTOM){
$customModuleModel = new CustomModule();
$info = $customModuleModel->read(['id'=>$source]);
if($info === false){
$this->fail('当前扩展模块不存在或已被删除');
}
//todo::扩展模块(列表页/详情页)定制
if($info['list_customized'] == BTemplate::IS_VISUALIZATION || $info['detail_customized'] == BTemplate::IS_VISUALIZATION) {
$data['html'] = $html;
$data['type'] = BTemplate::ALL_HTML;
}else{
$mainInfo = $this->handleTemplateHtml($html);
$data['main_html'] = $mainInfo['main_html'];
$data['main_css'] = $mainInfo['main_css'];
}
return $this->success($data);
}
$type = $this->getCustomizedType($source, $is_list);//获取定制界面类型
//查看当前页面是否定制,是否开启可视化
$page_array = (array)$this->user['is_visualization']->page_array;//获取所有定制界面
... ... @@ -449,19 +467,6 @@ class BTemplateLogic extends BaseLogic
$data['html'] = $html;
$data['type'] = BTemplate::ALL_HTML;
}else{
//TODO::扩展模块定制单独处理
if($is_custom == BTemplate::IS_CUSTOM){
$customModuleModel = new CustomModule();
$info = $customModuleModel->read(['id'=>$source]);
if($info === false){
$this->fail('当前扩展模块不存在或已被删除');
}
//todo::扩展模块(列表页/详情页)定制
if($info['list_customized'] == BTemplate::IS_VISUALIZATION || $info['detail_customized'] == BTemplate::IS_VISUALIZATION) {
$data['html'] = $html;
$data['type'] = BTemplate::ALL_HTML;
}
}
$mainInfo = $this->handleTemplateHtml($html);
$data['main_html'] = $mainInfo['main_html'];
$data['main_css'] = $mainInfo['main_css'];
... ...
... ... @@ -436,8 +436,8 @@ class ProductLogic extends BaseLogic
public function setCopyProduct(){
$info = $this->model->read(['id'=>$this->param['id']]);
$param = $this->setProductParams($info);
DB::beginTransaction();
try {
// DB::beginTransaction();
// try {
$save_id = $this->model->insertGetId($param);
CategoryRelated::saveRelated($save_id, $info['category_id']);
$route = preg_replace('/-product.*/', '', $param['route']);
... ... @@ -448,11 +448,11 @@ class ProductLogic extends BaseLogic
$this->copyTemplate($this->param['id'],$info['project_id'],$save_id);
//同步扩展字段
$this->copyExtendInfo($info['id'],$save_id);
DB::commit();
}catch (\Exception $e){
DB::rollBack();
$this->fail('复制失败,请联系管理员');
}
// DB::commit();
// }catch (\Exception $e){
// DB::rollBack();
// $this->fail('复制失败,请联系管理员');
// }
return $this->success(['id'=>$save_id]);
}
... ...