KeywordPrefixLogic.php 992 字节
<?php
/**
 * @remark :
 * @name   :KeywordPrefixLogic.php
 * @author :lyh
 * @method :post
 * @time   :2023/9/6 14:40
 */

namespace App\Http\Logic\Aside\Project;

use App\Http\Logic\Aside\BaseLogic;
use App\Models\Project\KeywordPrefix;

class KeywordPrefixLogic extends BaseLogic
{
    public function __construct()
    {
        parent::__construct();
        $this->param = $this->requestAll;
        $this->model = new KeywordPrefix();
    }

    /**
     * @remark :保存关键字
     * @name   :prefixSave
     * @author :lyh
     * @method :post
     * @time   :2023/9/6 14:42
     */
    public function prefixSave(){
        try {
            if(isset($this->param['id']) && !empty($this->param['id'])){
                $this->model->edit($this->param,['id'=>$this->param['id']]);
            }else{
                $this->model->add($this->param);
            }
        }catch (\Exception $e){
            $this->fail('error');
        }
        return $this->success();
    }
}