ProjectCountryLogic.php 1.2 KB
<?php

namespace App\Http\Logic\Bside\Setting;

use App\Http\Logic\Bside\BaseLogic;
use App\Models\Project\Country as CountryModel;

class ProjectCountryLogic extends BaseLogic
{
    public function __construct()
    {
        parent::__construct();

        $this->model = new CountryModel();
        $this->param = $this->requestAll;
    }
    /**
     * @name   :(获取当前项目关联的多语言)get_country_info
     * @author :lyh
     * @method :post
     * @time   :2023/4/28 17:03
     */
    public function country_info(){
        $lists = $this->model->read(['project_id'=>$this->user['project_id']]);
        if (empty($lists)){
            $this->fail('当前数据不存在');
        }
        return $this->success($lists);
    }

    /**
     * @name   :(更新多语言设置)country_edit
     * @author :lyh
     * @method :post
     * @time   :2023/4/28 17:42
     */
    public function country_edit(){
        $rs = $this->model->edit($this->param,['project_id'=>$this->user['project_id']]);
        if($rs === false){
            $this->fail('当前数据不存在');
        }
        //TODO::配置多语言翻译api接口
        return $this->success();
    }
}