LangCountry.php 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
  4. // +----------------------------------------------------------------------
  5. // | Copyright (c) 2016~2022 https://www.crmeb.com All rights reserved.
  6. // +----------------------------------------------------------------------
  7. // | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
  8. // +----------------------------------------------------------------------
  9. // | Author: CRMEB Team <admin@crmeb.com>
  10. // +----------------------------------------------------------------------
  11. namespace app\adminapi\controller\v1\setting;
  12. use app\adminapi\controller\AuthController;
  13. use app\services\system\lang\LangCountryServices;
  14. use think\facade\App;
  15. class LangCountry extends AuthController
  16. {
  17. /**
  18. * @param App $app
  19. * @param LangCountryServices $services
  20. */
  21. public function __construct(App $app, LangCountryServices $services)
  22. {
  23. parent::__construct($app);
  24. $this->services = $services;
  25. }
  26. /**
  27. * 国家语言列表
  28. * @return mixed
  29. * @throws \think\db\exception\DataNotFoundException
  30. * @throws \think\db\exception\DbException
  31. * @throws \think\db\exception\ModelNotFoundException
  32. */
  33. public function langCountryList()
  34. {
  35. $where = $this->request->getMore([
  36. ['keyword', ''],
  37. ]);
  38. return app('json')->success($this->services->langCountryList($where));
  39. }
  40. /**
  41. * 设置国家语言类型表单
  42. * @param $id
  43. * @return mixed
  44. * @throws \FormBuilder\Exception\FormBuilderException
  45. * @throws \think\db\exception\DataNotFoundException
  46. * @throws \think\db\exception\DbException
  47. * @throws \think\db\exception\ModelNotFoundException
  48. */
  49. public function langCountryTypeForm($id)
  50. {
  51. return app('json')->success($this->services->LangCountryTypeForm($id));
  52. }
  53. /**
  54. * 国家语言修改
  55. * @param $id
  56. * @return mixed
  57. */
  58. public function langCountrySave($id)
  59. {
  60. [$typeId] = $this->request->postMore([
  61. ['type', 0],
  62. ], true);
  63. $this->services->langCountrySave($id, $typeId);
  64. return app('json')->success(100000);
  65. }
  66. }