作者 lyh

gx

... ... @@ -45,28 +45,28 @@ 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 :使用模版
... ... @@ -75,7 +75,7 @@ class TemplateController extends BaseController
* @method :post
* @time :2023/6/27 15:07
*/
public function info(TemplateLogic $templateLogic){
public function read(TemplateLogic $templateLogic){
$this->request->validate([
'template_id' => 'required',
],[
... ...