|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* @remark :
|
|
|
|
* @name :WebSettingSeoLogic.php
|
|
|
|
* @author :lyh
|
|
|
|
* @method :post
|
|
|
|
* @time :2023/9/11 16:32
|
|
|
|
*/
|
|
|
|
|
|
|
|
namespace App\Http\Logic\Bside\Setting;
|
|
|
|
|
|
|
|
use App\Http\Logic\Bside\BaseLogic;
|
|
|
|
use App\Models\WebSetting\WebSettingSeo;
|
|
|
|
|
|
|
|
class WebSettingSeoLogic extends BaseLogic
|
|
|
|
{
|
|
|
|
public function __construct()
|
|
|
|
{
|
|
|
|
parent::__construct();
|
|
|
|
$this->model = new WebSettingSeo();
|
|
|
|
$this->param = $this->requestAll;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @remark :获取详情
|
|
|
|
* @name :seoInfo
|
|
|
|
* @author :lyh
|
|
|
|
* @method :post
|
|
|
|
* @time :2023/9/11 16:33
|
|
|
|
*/
|
|
|
|
public function seoInfo(){
|
|
|
|
$info = $this->model->read($this->param);
|
|
|
|
if($info === false){
|
|
|
|
$this->fail('当前数据不存在');
|
|
|
|
}
|
|
|
|
return $this->success($info);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @remark :保存数据
|
|
|
|
* @name :save
|
|
|
|
* @author :lyh
|
|
|
|
* @method :post
|
|
|
|
* @time :2023/9/11 16:34
|
|
|
|
*/
|
|
|
|
public function seoSave(){
|
|
|
|
try {
|
|
|
|
$info = $this->model->read(['project_id'=>$this->user['project_id']]);
|
|
|
|
if($info === false){
|
|
|
|
$this->param['project_id'] = $this->user['project_id'];
|
|
|
|
$this->model->add($this->param);
|
|
|
|
}else{
|
|
|
|
$this->model->edit($this->param,['project_id'=>$this->param['project_id']]);
|
|
|
|
}
|
|
|
|
}catch (\Exception $e){
|
|
|
|
$this->fail('error');
|
|
|
|
}
|
|
|
|
return $this->success();
|
|
|
|
}
|
|
|
|
} |
...
|
...
|
|