|
...
|
...
|
@@ -18,19 +18,29 @@ class WebSettingTextLogic extends BaseLogic |
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @name :(查询设置详情)setting_read
|
|
|
|
* @author :lyh
|
|
|
|
* @method :post
|
|
|
|
* @time :2023/5/8 15:56
|
|
|
|
*/
|
|
|
|
public function setting_read(){
|
|
|
|
$web_setting = new WebSetting();
|
|
|
|
$setting_info = $web_setting->read(['project_id'=>$this->user['project_id']],['anchor_setting','anchor_is_enable','anchor_num']);
|
|
|
|
return $setting_info;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @name :(描文本详情)setting_text_lists
|
|
|
|
* @author :lyh
|
|
|
|
* @method :post
|
|
|
|
* @time :2023/5/8 14:18
|
|
|
|
*/
|
|
|
|
public function setting_text_lists(){
|
|
|
|
$lists = $this->model->list(['project_id'=>$this->user['project_id']],'created_at');
|
|
|
|
$web_setting = new WebSetting();
|
|
|
|
$setting_info = $web_setting->read(['project_id'=>$this->user['project_id']],['anchor_setting']);
|
|
|
|
$lists['anchor_info'] = $setting_info;
|
|
|
|
$anchor_text = config('setting.anchor_text');
|
|
|
|
$lists['data'] = $this->model->list(['project_id'=>$this->user['project_id']],'created_at',['key_words','url']);
|
|
|
|
$lists['anchor_info'] = $this->setting_read();
|
|
|
|
$anchor_text = $this->model->anchor_text;
|
|
|
|
$lists['anchor_text'] = $anchor_text;
|
|
|
|
$this->success($lists);
|
|
|
|
return $this->success($lists);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
...
|
...
|
@@ -40,12 +50,25 @@ class WebSettingTextLogic extends BaseLogic |
|
|
|
* @time :2023/5/8 14:39
|
|
|
|
*/
|
|
|
|
public function setting_text_save(){
|
|
|
|
$web_setting = new WebSetting();
|
|
|
|
$setting_info = $this->setting_read();
|
|
|
|
if(count($this->param['data']) > $setting_info['anchor_num']){
|
|
|
|
$this->fail('超过最大设置限制');
|
|
|
|
}
|
|
|
|
DB::beginTransaction();
|
|
|
|
try {
|
|
|
|
//更新描文本设置
|
|
|
|
$web_setting = new WebSetting();
|
|
|
|
$web_setting->edit(['anchor_setting'=>$this->param['anchor_setting']],['project_id'=>$this->user['project_id']]);
|
|
|
|
$data = [
|
|
|
|
'anchor_setting'=>$this->param['anchor_setting'],
|
|
|
|
'anchor_is_enable'=>$this->param['anchor_is_enable'],
|
|
|
|
'anchor_num'=>$this->param['anchor_num']
|
|
|
|
];
|
|
|
|
$web_setting->edit($data,['project_id'=>$this->user['project_id']]);
|
|
|
|
$this->model->del(['project_id'=>$this->user['project_id']]);
|
|
|
|
foreach ($this->param['data'] as $k => $v){
|
|
|
|
$v['project_id'] = $this->user['project_id'];
|
|
|
|
$this->param['data'][$k] = $v;
|
|
|
|
}
|
|
|
|
$this->model->add($this->param['data']);
|
|
|
|
DB::commit();
|
|
|
|
}catch (\Exception $e){
|
...
|
...
|
|