LangCountry.php 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <?php
  2. namespace app\adminapi\controller\v1\setting;
  3. use app\adminapi\controller\AuthController;
  4. use app\services\system\lang\LangCountryServices;
  5. use think\facade\App;
  6. class LangCountry extends AuthController
  7. {
  8. /**
  9. * @param App $app
  10. * @param LangCountryServices $services
  11. */
  12. public function __construct(App $app, LangCountryServices $services)
  13. {
  14. parent::__construct($app);
  15. $this->services = $services;
  16. }
  17. /**
  18. * 国家语言列表
  19. * @return mixed
  20. * @throws \think\db\exception\DataNotFoundException
  21. * @throws \think\db\exception\DbException
  22. * @throws \think\db\exception\ModelNotFoundException
  23. */
  24. public function langCountryList()
  25. {
  26. $where = $this->request->getMore([
  27. ['keyword', ''],
  28. ]);
  29. return app('json')->success($this->services->langCountryList($where));
  30. }
  31. /**
  32. * 设置国家语言类型表单
  33. * @param $id
  34. * @return mixed
  35. * @throws \FormBuilder\Exception\FormBuilderException
  36. * @throws \think\db\exception\DataNotFoundException
  37. * @throws \think\db\exception\DbException
  38. * @throws \think\db\exception\ModelNotFoundException
  39. */
  40. public function langCountryTypeForm($id)
  41. {
  42. return app('json')->success($this->services->LangCountryTypeForm($id));
  43. }
  44. /**
  45. * 国家语言修改
  46. * @param $id
  47. * @return mixed
  48. */
  49. public function langCountrySave($id)
  50. {
  51. [$typeId] = $this->request->postMore([
  52. ['type', 0],
  53. ], true);
  54. $this->services->langCountrySave($id, $typeId);
  55. return app('json')->success(100000);
  56. }
  57. }