Company.php 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. <?php
  2. /*
  3. * @Author: wang jun
  4. * @Date: 2022-01-18 10:57:14
  5. * @Last Modified by: wang jun
  6. * @Last Modified time: 2022-01-18 16:56:01
  7. * 微信类
  8. */
  9. namespace app\index\controller;
  10. use app\index\logic\companylogic;
  11. use think\Controller;
  12. class Company extends Base
  13. {
  14. /**
  15. * 设置请求数据规则
  16. * 20220107
  17. * wj
  18. */
  19. protected function setrules()
  20. {
  21. $list = [
  22. 'newinfo' => [
  23. ['name' => 'openid', 'title' => 'openid', 'require' => true, 'type' => 'string'],
  24. ],
  25. 'getinfobyid' => [
  26. ['name' => 'id', 'title' => 'id', 'require' => true, 'type' => 'string'],
  27. ],
  28. 'updatebyid' => [
  29. ['name' => 'id', 'title' => 'id', 'require' => true, 'type' => 'string'],
  30. ],
  31. ];
  32. return $list;
  33. }
  34. public function newinfo()
  35. {
  36. $param = request()->param();
  37. $l_c = new companylogic();
  38. $result = $l_c->newinfo($param);
  39. if (1 != $result['status']) {
  40. return backjson(0, $result['msg']);
  41. }
  42. return backjson(200, $result['data']);
  43. }
  44. public function getinfobyid()
  45. {
  46. $param = request()->param();
  47. $l_c = new companylogic();
  48. $result = $l_c->getinfobyid($param);
  49. if (1 != $result['status']) {
  50. return backjson(0, $result['msg']);
  51. }
  52. return backjson(200, $result['data']);
  53. }
  54. public function updatebyid()
  55. {
  56. $param = request()->param();
  57. $l_c = new companylogic();
  58. $result = $l_c->updatebyid($param);
  59. if (1 != $result['status']) {
  60. return backjson(0, $result['msg']);
  61. }
  62. return backjson(200, $result['data']);
  63. }
  64. }