|
...
|
...
|
@@ -45,30 +45,46 @@ class TemplateController extends BaseController |
|
|
|
* @author:dc
|
|
|
|
* @time 2023/5/9 15:19
|
|
|
|
*/
|
|
|
|
public function info(){
|
|
|
|
// 保存更新
|
|
|
|
if($this->isPost()){
|
|
|
|
$template_id = intval($this->param['template_id']??0);
|
|
|
|
// 是否存在模板
|
|
|
|
if($template_id && ATemplate::_bFind($template_id)){
|
|
|
|
BSetting::_save($this->user['project_id'],$template_id);
|
|
|
|
}else{
|
|
|
|
return $this->response('无法使用不存在的模板',Code::SYSTEM_ERROR);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// 读取我的模板
|
|
|
|
$conf = BSetting::_get($this->user['project_id']);
|
|
|
|
// 读取模板信息
|
|
|
|
$data = ATemplate::_bFind($conf['template_id']);
|
|
|
|
return $this->success([
|
|
|
|
'template_id' => $data['id']??0,
|
|
|
|
'name' => $data['name']??'',
|
|
|
|
'thumb' => $data['thumb']??'',
|
|
|
|
'time' => $conf['time']
|
|
|
|
// public function info(){
|
|
|
|
// // 保存更新
|
|
|
|
// if($this->isPost()){
|
|
|
|
// $template_id = intval($this->param['template_id']??0);
|
|
|
|
// // 是否存在模板
|
|
|
|
// if($template_id && ATemplate::_bFind($template_id)){
|
|
|
|
// BSetting::_save($this->user['project_id'],$template_id);
|
|
|
|
// }else{
|
|
|
|
// return $this->response('无法使用不存在的模板',Code::SYSTEM_ERROR);
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// // 读取我的模板
|
|
|
|
// $conf = BSetting::_get($this->user['project_id']);
|
|
|
|
// // 读取模板信息
|
|
|
|
// $data = ATemplate::_bFind($conf['template_id']);
|
|
|
|
// return $this->success([
|
|
|
|
// 'template_id' => $data['id']??0,
|
|
|
|
// 'name' => $data['name']??'',
|
|
|
|
// 'thumb' => $data['thumb']??'',
|
|
|
|
// 'time' => $conf['time']
|
|
|
|
// ]);
|
|
|
|
// }
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @remark :使用模版
|
|
|
|
* @name :read
|
|
|
|
* @author :lyh
|
|
|
|
* @method :post
|
|
|
|
* @time :2023/6/27 15:07
|
|
|
|
*/
|
|
|
|
public function info(TemplateLogic $templateLogic){
|
|
|
|
$this->request->validate([
|
|
|
|
'template_id' => 'required',
|
|
|
|
],[
|
|
|
|
'template_id.required' => 'template_id不能为空'
|
|
|
|
]);
|
|
|
|
$data = $templateLogic->usingTemplates();
|
|
|
|
$this->response('选中模版信息',Code::SUCCESS,$data);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 保存模板
|
|
|
|
* @author:dc
|
...
|
...
|
|