作者 lyh

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

... ... @@ -34,13 +34,14 @@ class BTemplateLogController extends BaseController
*/
public function lists(BTemplateLog $bTemplateLog){
$this->map['project_id'] = $this->user['project_id'];
$this->map['source'] = 1;
$lists = $bTemplateLog->lists($this->map,$this->page,$this->row,$this->order,['id','template_id','operator_id','source','created_at','updated_at']);
if(!empty($lists['list'])){
$templateModel = new Template();
$userModel = new User();
foreach ($lists['list'] as $k => $v){
$v['template_name'] = $templateModel->read(['id'=>$v['template_id']],['name'])['name'];
$v['operator_name'] = $userModel->read(['id'=>$v['operator_id']],['name'])['name'];
$v['operator_name'] = $userModel->getName($v['operator_id']);
$lists['list'][$k] = $v;
}
}
... ...
... ... @@ -13,6 +13,7 @@ use App\Models\Template\BSetting;
use App\Models\Template\BTemplate;
use App\Models\Template\BTemplateLog;
use App\Models\Template\Template;
use Illuminate\Support\Facades\Cache;
use Illuminate\Support\Facades\DB;
use mysql_xdevapi\Exception;
... ... @@ -56,15 +57,20 @@ class BTemplateLogic extends BaseLogic
public function getTemplate(){
$bSettingModel = new BSetting();
$info = $bSettingModel->read(['project_id'=>$this->user['project_id']]);
if($info === false){
$this->fail('请先选择模版');
}
$TemplateInfo = [];
if($info !== false){
$key = 'template_'.$this->user['project_id'].'_'.$this->param['source'].'_'.$this->param['source_id'];
if(!empty(Cache::add($key))){
$this->fail('当前页面正在装修中');
}
if($this->param['source'] == $this->model::SOURCE_HOME){//首页
$TemplateInfo = $this->homeHtml($info,$this->param['source'],$this->param['source_id']);
}
if($this->param['source'] == $this->model::SOURCE_PRODUCT){//产品页
$TemplateInfo = $this->productHtml($info,$this->param['source'],$this->param['source_id']);
}
}
return $this->success($TemplateInfo);
}
... ...