正在显示
3 个修改的文件
包含
11 行增加
和
19 行删除
| @@ -69,23 +69,6 @@ class TemplateController extends BaseController | @@ -69,23 +69,6 @@ class TemplateController extends BaseController | ||
| 69 | } | 69 | } |
| 70 | 70 | ||
| 71 | /** | 71 | /** |
| 72 | - * @remark :使用模版 | ||
| 73 | - * @name :read | ||
| 74 | - * @author :lyh | ||
| 75 | - * @method :post | ||
| 76 | - * @time :2023/6/27 15:07 | ||
| 77 | - */ | ||
| 78 | - public function read(TemplateLogic $templateLogic){ | ||
| 79 | - $this->request->validate([ | ||
| 80 | - 'template_id' => 'required', | ||
| 81 | - ],[ | ||
| 82 | - 'template_id.required' => 'template_id不能为空' | ||
| 83 | - ]); | ||
| 84 | - $data = $templateLogic->usingTemplates(); | ||
| 85 | - $this->response('选中模版信息',Code::SUCCESS,$data); | ||
| 86 | - } | ||
| 87 | - | ||
| 88 | - /** | ||
| 89 | * 保存模板 | 72 | * 保存模板 |
| 90 | * @author:dc | 73 | * @author:dc |
| 91 | * @time 2023/5/10 10:53 | 74 | * @time 2023/5/10 10:53 |
| @@ -83,12 +83,19 @@ class TemplateLogic extends BaseLogic | @@ -83,12 +83,19 @@ class TemplateLogic extends BaseLogic | ||
| 83 | */ | 83 | */ |
| 84 | public function first($source,$source_id) | 84 | public function first($source,$source_id) |
| 85 | { | 85 | { |
| 86 | - return $data = BTemplate::where([ | 86 | + $data = BTemplate::where([ |
| 87 | 'project_id'=>$this->user['project_id'], | 87 | 'project_id'=>$this->user['project_id'], |
| 88 | 'data_source' => $source, | 88 | 'data_source' => $source, |
| 89 | 'data_source_id' => $source_id, | 89 | 'data_source_id' => $source_id, |
| 90 | 'template_id' => BSetting::_get($this->user['project_id'])['template_id'] | 90 | 'template_id' => BSetting::_get($this->user['project_id'])['template_id'] |
| 91 | ])->first(); | 91 | ])->first(); |
| 92 | + if(empty($data)){ | ||
| 93 | + $data = ATemplate::where([ | ||
| 94 | + 'project_id'=>$this->user['project_id'], | ||
| 95 | + 'template_id' => BSetting::_get($this->user['project_id'])['template_id'] | ||
| 96 | + ])->first(); | ||
| 97 | + } | ||
| 98 | + return $data; | ||
| 92 | } | 99 | } |
| 93 | 100 | ||
| 94 | 101 |
| @@ -2,6 +2,8 @@ | @@ -2,6 +2,8 @@ | ||
| 2 | 2 | ||
| 3 | namespace App\Models\Template; | 3 | namespace App\Models\Template; |
| 4 | 4 | ||
| 5 | +use App\Models\Base; | ||
| 6 | + | ||
| 5 | /** | 7 | /** |
| 6 | * 自定义 界面 | 8 | * 自定义 界面 |
| 7 | * @author:dc | 9 | * @author:dc |
| @@ -9,7 +11,7 @@ namespace App\Models\Template; | @@ -9,7 +11,7 @@ namespace App\Models\Template; | ||
| 9 | * Class BTemplate | 11 | * Class BTemplate |
| 10 | * @package App\Models\Template | 12 | * @package App\Models\Template |
| 11 | */ | 13 | */ |
| 12 | -class BTemplate extends \App\Models\Base{ | 14 | +class BTemplate extends Base { |
| 13 | 15 | ||
| 14 | protected $table = 'gl_web_template'; | 16 | protected $table = 'gl_web_template'; |
| 15 | 17 |
-
请 注册 或 登录 后发表评论