合并分支 'lyh-server' 到 'master'
Lyh server 查看合并请求 !2037
正在显示
4 个修改的文件
包含
123 行增加
和
0 行删除
| 1 | +<?php | ||
| 2 | +/** | ||
| 3 | + * @remark : | ||
| 4 | + * @name :NewsExtendController.php | ||
| 5 | + * @author :lyh | ||
| 6 | + * @method :post | ||
| 7 | + * @time :2025/5/26 15:05 | ||
| 8 | + */ | ||
| 9 | + | ||
| 10 | +namespace App\Http\Controllers\Bside\News; | ||
| 11 | + | ||
| 12 | +use App\Http\Controllers\Bside\BaseController; | ||
| 13 | +use App\Http\Logic\Bside\News\NewsExtendLogic; | ||
| 14 | +use App\Models\News\NewsExtend; | ||
| 15 | +use Illuminate\Http\Request; | ||
| 16 | + | ||
| 17 | +class NewsExtendController extends BaseController | ||
| 18 | +{ | ||
| 19 | + public function __construct(Request $request) | ||
| 20 | + { | ||
| 21 | + parent::__construct($request); | ||
| 22 | + $this->logic = new NewsExtendLogic(); | ||
| 23 | + } | ||
| 24 | + | ||
| 25 | + /** | ||
| 26 | + * @remark :获取所有扩展字段 | ||
| 27 | + * @name :lists | ||
| 28 | + * @author :lyh | ||
| 29 | + * @method :post | ||
| 30 | + * @time :2025/5/26 15:08 | ||
| 31 | + */ | ||
| 32 | + public function lists() | ||
| 33 | + { | ||
| 34 | + $lists = $this->logic->list($this->map); | ||
| 35 | + $this->response('success', Code::SUCCESS, $lists); | ||
| 36 | + } | ||
| 37 | + | ||
| 38 | + /** | ||
| 39 | + * @remark :保存扩展字段 | ||
| 40 | + * @name :save | ||
| 41 | + * @author :lyh | ||
| 42 | + * @method :post | ||
| 43 | + * @time :2025/5/26 15:09 | ||
| 44 | + */ | ||
| 45 | + public function save() | ||
| 46 | + { | ||
| 47 | + $this->request->validate([ | ||
| 48 | + 'title' => 'required', | ||
| 49 | + 'type' => 'required', | ||
| 50 | + ], [ | ||
| 51 | + 'title.required' => '字段名称不能为空', | ||
| 52 | + 'type.required' => '字段类型不能为空', | ||
| 53 | + ]); | ||
| 54 | + $info = $this->logic->extendSave(); | ||
| 55 | + $this->response('success', Code::SUCCESS, $info); | ||
| 56 | + } | ||
| 57 | +} |
| @@ -92,6 +92,8 @@ class AiBlogLogic extends BaseLogic | @@ -92,6 +92,8 @@ class AiBlogLogic extends BaseLogic | ||
| 92 | $aiBlogService->mch_id = $aiSettingInfo['mch_id']; | 92 | $aiBlogService->mch_id = $aiSettingInfo['mch_id']; |
| 93 | $aiBlogService->key = $aiSettingInfo['key']; | 93 | $aiBlogService->key = $aiSettingInfo['key']; |
| 94 | $aiBlogService->updateAuthorInfo(['author_id'=>$this->param['author_id'],'route'=>$this->param['route'],'title'=>$this->param['title'],'picture'=>$this->param['image'],'description'=>$this->param['description']]); | 94 | $aiBlogService->updateAuthorInfo(['author_id'=>$this->param['author_id'],'route'=>$this->param['route'],'title'=>$this->param['title'],'picture'=>$this->param['image'],'description'=>$this->param['description']]); |
| 95 | + $aiBlogTask = new AiBlogTask(); | ||
| 96 | + $aiBlogTask->edit(['status'=>1],['type'=>1,'project_id'=>$this->user['project_id']]); | ||
| 95 | }catch (\Exception $e){ | 97 | }catch (\Exception $e){ |
| 96 | $this->fail('保存失败,请联系管理员'); | 98 | $this->fail('保存失败,请联系管理员'); |
| 97 | } | 99 | } |
| 1 | +<?php | ||
| 2 | +/** | ||
| 3 | + * @remark : | ||
| 4 | + * @name :NewsExtendLogic.php | ||
| 5 | + * @author :lyh | ||
| 6 | + * @method :post | ||
| 7 | + * @time :2025/5/26 15:11 | ||
| 8 | + */ | ||
| 9 | + | ||
| 10 | +namespace App\Http\Logic\Bside\News; | ||
| 11 | + | ||
| 12 | +use App\Http\Logic\Bside\BaseLogic; | ||
| 13 | +use App\Models\News\NewsExtend; | ||
| 14 | + | ||
| 15 | +class NewsExtendLogic extends BaseLogic | ||
| 16 | +{ | ||
| 17 | + public function __construct() | ||
| 18 | + { | ||
| 19 | + parent::__construct(); | ||
| 20 | + $this->model = new NewsExtend(); | ||
| 21 | + $this->param = $this->requestAll; | ||
| 22 | + } | ||
| 23 | + | ||
| 24 | + /** | ||
| 25 | + * @remark :列表页 | ||
| 26 | + * @name :list | ||
| 27 | + * @author :lyh | ||
| 28 | + * @method :post | ||
| 29 | + * @time :2025/5/26 15:17 | ||
| 30 | + */ | ||
| 31 | + public function list($map){ | ||
| 32 | + $data = $this->model->list($map); | ||
| 33 | + return $this->success($data); | ||
| 34 | + } | ||
| 35 | + | ||
| 36 | + /** | ||
| 37 | + * @remark : | ||
| 38 | + * @name :extendSave | ||
| 39 | + * @author :lyh | ||
| 40 | + * @method :post | ||
| 41 | + * @time :2025/5/26 15:13 | ||
| 42 | + */ | ||
| 43 | + public function extendSave(){ | ||
| 44 | + | ||
| 45 | + } | ||
| 46 | +} |
app/Models/News/NewsExtend.php
0 → 100644
| 1 | +<?php | ||
| 2 | +/** | ||
| 3 | + * @remark : | ||
| 4 | + * @name :NewsExtend.php | ||
| 5 | + * @author :lyh | ||
| 6 | + * @method :post | ||
| 7 | + * @time :2025/5/26 15:08 | ||
| 8 | + */ | ||
| 9 | + | ||
| 10 | +namespace App\Models\News; | ||
| 11 | + | ||
| 12 | +use App\Models\Base; | ||
| 13 | + | ||
| 14 | +class NewsExtend extends Base | ||
| 15 | +{ | ||
| 16 | + protected $table = 'gl_news_extend'; | ||
| 17 | + protected $connection = 'custom_mysql'; | ||
| 18 | +} |
-
请 注册 或 登录 后发表评论