正在显示
4 个修改的文件
包含
48 行增加
和
0 行删除
| @@ -2,8 +2,10 @@ | @@ -2,8 +2,10 @@ | ||
| 2 | 2 | ||
| 3 | namespace App\Http\Controllers\Bside\Setting; | 3 | namespace App\Http\Controllers\Bside\Setting; |
| 4 | 4 | ||
| 5 | +use App\Enums\Common\Code; | ||
| 5 | use App\Http\Controllers\Bside\BaseController; | 6 | use App\Http\Controllers\Bside\BaseController; |
| 6 | use App\Http\Logic\Bside\Setting\WebSettingCountryLogic; | 7 | use App\Http\Logic\Bside\Setting\WebSettingCountryLogic; |
| 8 | +use App\Models\Project\Country as CountryModel; | ||
| 7 | 9 | ||
| 8 | class WebSettingCountryController extends BaseController | 10 | class WebSettingCountryController extends BaseController |
| 9 | { | 11 | { |
| @@ -14,6 +16,18 @@ class WebSettingCountryController extends BaseController | @@ -14,6 +16,18 @@ class WebSettingCountryController extends BaseController | ||
| 14 | * @time :2023/4/28 14:40 | 16 | * @time :2023/4/28 14:40 |
| 15 | */ | 17 | */ |
| 16 | public function lists(WebSettingCountryLogic $webSettingCountryLogic){ | 18 | public function lists(WebSettingCountryLogic $webSettingCountryLogic){ |
| 19 | + $lists = $webSettingCountryLogic->country_list(); | ||
| 20 | + $this->response('success',Code::SUCCESS,$lists); | ||
| 21 | + } | ||
| 17 | 22 | ||
| 23 | + /** | ||
| 24 | + * @name :(获取当前项目设置的多语言列表)user_get_list | ||
| 25 | + * @author :lyh | ||
| 26 | + * @method :post | ||
| 27 | + * @time :2023/4/28 16:55 | ||
| 28 | + */ | ||
| 29 | + public function get_country_info(WebSettingCountryLogic $webSettingCountryLogic){ | ||
| 30 | + $info = $webSettingCountryLogic->get_country_info(); | ||
| 31 | + $this->response('success',Code::SUCCESS,$info); | ||
| 18 | } | 32 | } |
| 19 | } | 33 | } |
| @@ -3,6 +3,7 @@ | @@ -3,6 +3,7 @@ | ||
| 3 | namespace App\Http\Logic\Bside\Setting; | 3 | namespace App\Http\Logic\Bside\Setting; |
| 4 | 4 | ||
| 5 | use App\Http\Logic\Bside\BaseLogic; | 5 | use App\Http\Logic\Bside\BaseLogic; |
| 6 | +use App\Models\Project\Country as CountryModel; | ||
| 6 | use App\Models\WebSetting\WebSettingCountry; | 7 | use App\Models\WebSetting\WebSettingCountry; |
| 7 | 8 | ||
| 8 | class WebSettingCountryLogic extends BaseLogic | 9 | class WebSettingCountryLogic extends BaseLogic |
| @@ -14,4 +15,33 @@ class WebSettingCountryLogic extends BaseLogic | @@ -14,4 +15,33 @@ class WebSettingCountryLogic extends BaseLogic | ||
| 14 | $this->model = new WebSettingCountry(); | 15 | $this->model = new WebSettingCountry(); |
| 15 | $this->param = $this->requestAll; | 16 | $this->param = $this->requestAll; |
| 16 | } | 17 | } |
| 18 | + | ||
| 19 | + /** | ||
| 20 | + * @name :(获取多语言国家)user_country_list | ||
| 21 | + * @author :lyh | ||
| 22 | + * @method :post | ||
| 23 | + * @time :2023/4/28 16:18 | ||
| 24 | + */ | ||
| 25 | + public function country_list(){ | ||
| 26 | + $countryModel = new CountryModel(); | ||
| 27 | + $lists = $countryModel->list($this->param,'id',['id','name','image']); | ||
| 28 | + if (empty($lists)){ | ||
| 29 | + $this->fail('当前数据不存在'); | ||
| 30 | + } | ||
| 31 | + $this->success($lists); | ||
| 32 | + } | ||
| 33 | + | ||
| 34 | + /** | ||
| 35 | + * @name :(获取当前项目关联的多语言)get_country_info | ||
| 36 | + * @author :lyh | ||
| 37 | + * @method :post | ||
| 38 | + * @time :2023/4/28 17:03 | ||
| 39 | + */ | ||
| 40 | + public function get_country_info(){ | ||
| 41 | + $lists = $this->model->read(['project_id'=>$this->param['project_id']]); | ||
| 42 | + if (empty($lists)){ | ||
| 43 | + $this->fail('当前数据不存在'); | ||
| 44 | + } | ||
| 45 | + $this->success($lists); | ||
| 46 | + } | ||
| 17 | } | 47 | } |
| @@ -53,6 +53,7 @@ class WebSettingLogic extends BaseLogic | @@ -53,6 +53,7 @@ class WebSettingLogic extends BaseLogic | ||
| 53 | if($rs === false){ | 53 | if($rs === false){ |
| 54 | $this->fail('error'); | 54 | $this->fail('error'); |
| 55 | } | 55 | } |
| 56 | + CommonHelper::del_user_cache($this->model->getTable(),$this->user['project_id']); | ||
| 56 | return $this->success(); | 57 | return $this->success(); |
| 57 | } | 58 | } |
| 58 | } | 59 | } |
| @@ -111,6 +111,9 @@ Route::middleware(['bloginauth'])->group(function () { | @@ -111,6 +111,9 @@ Route::middleware(['bloginauth'])->group(function () { | ||
| 111 | //首页设置 | 111 | //首页设置 |
| 112 | Route::any('/', [\App\Http\Controllers\Bside\Setting\WebSettingController::class, 'lists'])->name('web_setting_lists'); | 112 | Route::any('/', [\App\Http\Controllers\Bside\Setting\WebSettingController::class, 'lists'])->name('web_setting_lists'); |
| 113 | Route::any('/save', [\App\Http\Controllers\Bside\Setting\WebSettingController::class, 'save'])->name('web_setting_save'); | 113 | Route::any('/save', [\App\Http\Controllers\Bside\Setting\WebSettingController::class, 'save'])->name('web_setting_save'); |
| 114 | + //多语言设置 | ||
| 115 | + Route::any('/country/', [\App\Http\Controllers\Bside\Setting\WebSettingCountryController::class, 'lists'])->name('web_setting_country_lists'); | ||
| 116 | + Route::any('/country/get_country_info', [\App\Http\Controllers\Bside\Setting\WebSettingCountryController::class, 'get_country_info'])->name('web_setting_country_info'); | ||
| 114 | }); | 117 | }); |
| 115 | //产品 | 118 | //产品 |
| 116 | Route::prefix('product')->group(function () { | 119 | Route::prefix('product')->group(function () { |
-
请 注册 或 登录 后发表评论