LangCountry.php 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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 langCountryForm($id)
  50. {
  51. return app('json')->success($this->services->langCountryForm($id));
  52. }
  53. /**
  54. * 地区语言修改
  55. * @param $id
  56. * @return mixed
  57. */
  58. public function langCountrySave($id)
  59. {
  60. $data = $this->request->postMore([
  61. ['name', ''],
  62. ['code', ''],
  63. ]);
  64. $this->services->langCountrySave($id, $data);
  65. return app('json')->success(100000);
  66. }
  67. public function langCountryDel($id)
  68. {
  69. $this->services->langCountryDel($id);
  70. return app('json')->success(100002);
  71. }
  72. }