作者 lyh

gx

... ... @@ -69,15 +69,17 @@ class OnlineCheckLogic extends BaseLogic
*/
public function saveOnlineCheck(){
$info = $this->model->read(['project_id'=>$this->param['id']]);
$projectModel = new Project();
if($info !== false){
$projectInfo = $projectModel->read(['id'=>$this->param['id']],['id','status']);
if($projectInfo['status'] != $projectModel::STATUS_ONE){
$projectModel->edit(['status'=>$projectModel::STATUS_ONE],['id'=>$projectInfo['id']]);
}
$this->fail('已提交,请勿重复提交');
}else{
if(($this->param['optimist_mid'] == 0) || ($this->param['qa_mid'] == 0)){
$this->fail('请先选择优化师和品控,在提交审核');
}
$projectModel = new Project();
//提交审核修改状态为审核中
$projectModel->edit(['status'=>1],['id'=>$this->param['id']]);
//组装数据
$data = [
'project_id' => $this->param['id'],
... ... @@ -86,9 +88,11 @@ class OnlineCheckLogic extends BaseLogic
'qa_mid' => $this->param['qa_mid'],
'created_at'=>date('Y-m-d H:i:s')
];
$rs = $this->model->add($data);
if($rs === false){
$this->fail('error');
try {
$projectModel->edit(['status'=>$projectModel::STATUS_ONE],['id'=>$this->param['id']]);
$this->model->add($data);
}catch (\Exception $e){
$this->fail('提交失败,请联系开发人员');
}
}
return $this->success();
... ...
... ... @@ -55,8 +55,7 @@ class BTemplateLogLogic extends BaseLogic
}
try {
$data = $this->setParam($info);
$BTemplateModel = new BTemplate();
$BTemplateModel->edit($data,['template_id'=>$info['template_id'],'source'=>$info['source'],'source_id'=>$info['source_id']]);
$bTemplateModel->edit($data,['template_id'=>$info['template_id'],'source'=>$info['source'],'source_id'=>$info['source_id']]);
$commonData = $this->setCommonParam($info);
$commonTemplateModel = new BTemplateCommon();
$commonTemplateModel->edit($commonData,['template_id'=>$info['template_id'],'type'=>1,'project_id'=>$this->user['project_id']]);
... ...
... ... @@ -80,6 +80,17 @@ class BTemplateLogic extends BaseLogic
}
/**
* @remark :查看首页是否可视化
* @name :getTemplateHtml
* @author :lyh
* @method :post
* @time :2023/12/13 9:50
*/
public function watchHomeISVisualization(){
}
/**
* @remark :根据参数获取数据详情
* @name :webTemplateInfo
* @author :lyh
... ...
... ... @@ -76,13 +76,13 @@ class VisualizationLogic extends BaseLogic
*/
public function getSource($type){
$source_id = 0;
if ($type == 2){$source = 2;$source_id = 1;
}elseif ($type == 3){$source = 2;
}elseif ($type == 4){$source = 3;$source_id = 1;
}elseif ($type == 5){$source = 3;
}elseif ($type == 6){$source = 4;$source_id = 1;
}elseif ($type == 7){$source = 4;
}else{$source = 1;}
if ($type == BTemplate::TYPE_TWO){$source = BTemplate::SOURCE_PRODUCT;$source_id = 1;
}elseif ($type == BTemplate::TYPE_THREE){$source = BTemplate::SOURCE_PRODUCT;
}elseif ($type == BTemplate::TYPE_FOUR){$source = BTemplate::SOURCE_BLOG;$source_id = 1;
}elseif ($type == BTemplate::TYPE_FIVE){$source = BTemplate::SOURCE_BLOG;
}elseif ($type == BTemplate::TYPE_SIX){$source = BTemplate::SOURCE_NEWS;$source_id = 1;
}elseif ($type == BTemplate::TYPE_SEVEN){$source = BTemplate::SOURCE_NEWS;
}else{$source = BTemplate::SOURCE_HOME;}
return ['source'=>$source,'source_id'=>$source_id];
}
... ... @@ -271,15 +271,15 @@ class VisualizationLogic extends BaseLogic
* @time :2023/11/16 11:20
*/
public function getType($source,$source_id){
$type = 1;
if($source == 2){
if($source_id == 0){$type = 3;}else{$type = 2;}
$type = BTemplate::TYPE_ONE;
if($source == BTemplate::SOURCE_PRODUCT){
if($source_id == 0){$type = BTemplate::TYPE_THREE;}else{$type = BTemplate::TYPE_TWO;}
}
if($source == 3){
if($source_id == 0){$type = 5;}else{$type = 4;}
if($source == BTemplate::SOURCE_BLOG){
if($source_id == 0){$type = BTemplate::TYPE_FIVE;}else{$type = BTemplate::TYPE_FOUR;}
}
if($source == 4){
if($source_id == 0){$type = 7;}else{$type = 6;}
if($source == BTemplate::SOURCE_NEWS){
if($source_id == 0){$type = BTemplate::TYPE_SEVEN;}else{$type = BTemplate::TYPE_SIX;}
}
return $type;
}
... ... @@ -412,7 +412,9 @@ class VisualizationLogic extends BaseLogic
$this->param['main_html'] = characterTruncation($param['html'],'/<main\b[^>]*>(.*?)<\/main>/s');
$this->param['main_css'] = characterTruncation($param['html'],'/<style id="globalsojs-styles">(.*?)<\/style>/s');
//保存头部
$this->saveCommonTemplate($param['html'],$param['source'],$param['source_id'],$param['template_id']);
if($param['is_custom'] == BTemplate::SOURCE_NO_CUSTOM){//非扩展模块才可以保存头底
$this->saveCommonTemplate($param['html'],$param['source'],$param['source_id'],$param['template_id']);
}
if($templateInfo === false){
$param['project_id'] = $this->user['project_id'];
$bTemplateModel->add($param);
... ...
... ... @@ -38,17 +38,9 @@ class Manage extends Base
*/
public function getName($id){
$name = '';
if(!empty($id)){
$info = Common::get_user_cache('manager',$id,'A');
if(empty($info)){
$info = $this->read(['id'=>$id],['id','name']);
if($info !== false){
$name = $info['name'];
Common::set_user_cache($info,'manager',$id,'A');
}
}else{
$name = $info['name'];
}
$info = $this->read(['id'=>$id],['id','name']);
if($info !== false){
$name = $info['name'];
}
return $name;
}
... ...
... ... @@ -19,6 +19,8 @@ class BTemplate extends Base
const SOURCE_KEYWORD = 5;//聚合页
const SOURCE_CUSTOM = 1;//自定义模块
const SOURCE_NO_CUSTOM = 0;//默认模块
const STATUS = 0;
const TYPE_ONE = 1;//首页类型
... ...