作者 李宇航

合并分支 'lyh-server' 到 'master'

Lyh server



查看合并请求 !2037
<?php
/**
* @remark :
* @name :NewsExtendController.php
* @author :lyh
* @method :post
* @time :2025/5/26 15:05
*/
namespace App\Http\Controllers\Bside\News;
use App\Http\Controllers\Bside\BaseController;
use App\Http\Logic\Bside\News\NewsExtendLogic;
use App\Models\News\NewsExtend;
use Illuminate\Http\Request;
class NewsExtendController extends BaseController
{
public function __construct(Request $request)
{
parent::__construct($request);
$this->logic = new NewsExtendLogic();
}
/**
* @remark :获取所有扩展字段
* @name :lists
* @author :lyh
* @method :post
* @time :2025/5/26 15:08
*/
public function lists()
{
$lists = $this->logic->list($this->map);
$this->response('success', Code::SUCCESS, $lists);
}
/**
* @remark :保存扩展字段
* @name :save
* @author :lyh
* @method :post
* @time :2025/5/26 15:09
*/
public function save()
{
$this->request->validate([
'title' => 'required',
'type' => 'required',
], [
'title.required' => '字段名称不能为空',
'type.required' => '字段类型不能为空',
]);
$info = $this->logic->extendSave();
$this->response('success', Code::SUCCESS, $info);
}
}
... ...
... ... @@ -92,6 +92,8 @@ class AiBlogLogic extends BaseLogic
$aiBlogService->mch_id = $aiSettingInfo['mch_id'];
$aiBlogService->key = $aiSettingInfo['key'];
$aiBlogService->updateAuthorInfo(['author_id'=>$this->param['author_id'],'route'=>$this->param['route'],'title'=>$this->param['title'],'picture'=>$this->param['image'],'description'=>$this->param['description']]);
$aiBlogTask = new AiBlogTask();
$aiBlogTask->edit(['status'=>1],['type'=>1,'project_id'=>$this->user['project_id']]);
}catch (\Exception $e){
$this->fail('保存失败,请联系管理员');
}
... ...
<?php
/**
* @remark :
* @name :NewsExtendLogic.php
* @author :lyh
* @method :post
* @time :2025/5/26 15:11
*/
namespace App\Http\Logic\Bside\News;
use App\Http\Logic\Bside\BaseLogic;
use App\Models\News\NewsExtend;
class NewsExtendLogic extends BaseLogic
{
public function __construct()
{
parent::__construct();
$this->model = new NewsExtend();
$this->param = $this->requestAll;
}
/**
* @remark :列表页
* @name :list
* @author :lyh
* @method :post
* @time :2025/5/26 15:17
*/
public function list($map){
$data = $this->model->list($map);
return $this->success($data);
}
/**
* @remark :
* @name :extendSave
* @author :lyh
* @method :post
* @time :2025/5/26 15:13
*/
public function extendSave(){
}
}
... ...
<?php
/**
* @remark :
* @name :NewsExtend.php
* @author :lyh
* @method :post
* @time :2025/5/26 15:08
*/
namespace App\Models\News;
use App\Models\Base;
class NewsExtend extends Base
{
protected $table = 'gl_news_extend';
protected $connection = 'custom_mysql';
}
... ...