Lssue.php 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. <?php
  2. /*
  3. * @Descripttion:
  4. * @version: 1.0.0
  5. * @Author: likang
  6. * @Date: 2022-07-26 16:16:11
  7. * @LastEditors: likang
  8. * @LastEditTime: 2022-07-28 17:47:29
  9. */
  10. namespace catchAdmin\system\controller;
  11. use catchAdmin\api\Directive;
  12. use catcher\base\CatchRequest as Request;
  13. use catcher\CatchResponse;
  14. use catcher\base\CatchController;
  15. use catchAdmin\system\model\Lssue as lssueModel;
  16. class Lssue extends CatchController
  17. {
  18. protected $lssueModel;
  19. public function __construct(LssueModel $lssueModel)
  20. {
  21. $this->lssueModel = $lssueModel;
  22. }
  23. /**
  24. * 列表
  25. * @time 2022年07月26日 16:16
  26. * @param Request $request
  27. */
  28. public function index(Request $request): \think\Response
  29. {
  30. return CatchResponse::paginate($this->lssueModel->getList());
  31. }
  32. /**
  33. * 保存信息
  34. * @time 2022年07月26日 16:16
  35. * @param Request $request
  36. */
  37. public function save(Request $request): \think\Response
  38. {
  39. $data = $request->post();
  40. $this->lssueModel->storeBy($request->post());
  41. $content = [
  42. 'type' => $data['type'],
  43. 'file_name' => $data['file_name'],
  44. 'equ_ids' => $data['equ_ids']
  45. ];
  46. // Directive::Issued($data['type'],);
  47. $this->lssueModel->IssueAll($content);
  48. return CatchResponse::success();
  49. }
  50. /**
  51. * 读取
  52. * @time 2022年07月26日 16:16
  53. * @param $id
  54. */
  55. public function read($id): \think\Response
  56. {
  57. return CatchResponse::success($this->lssueModel->findBy($id));
  58. }
  59. /**
  60. * 更新
  61. * @time 2022年07月26日 16:16
  62. * @param Request $request
  63. * @param $id
  64. */
  65. public function update(Request $request, $id): \think\Response
  66. {
  67. return CatchResponse::success($this->lssueModel->updateBy($id, $request->post()));
  68. }
  69. /**
  70. * 删除
  71. * @time 2022年07月26日 16:16
  72. * @param $id
  73. */
  74. public function delete($id): \think\Response
  75. {
  76. return CatchResponse::success($this->lssueModel->deleteBy($id, true));
  77. }
  78. }