FengsuShip.php 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. <?php
  2. declare (strict_types = 1);
  3. namespace app\admin\controller\goods;
  4. use app\common\controller\Backend;
  5. use app\admin\traits\Actions;
  6. use think\annotation\route\Group;
  7. use think\annotation\route\Route;
  8. use app\common\model\FengsuShip as FengsuShipModel;
  9. #[Group("goods/fengsu_ship")]
  10. class FengsuShip extends Backend
  11. {
  12. //app\admin\controller\goods\FengsuShip
  13. use Actions{
  14. index as private _index;
  15. add as private _add;
  16. edit as private _edit;
  17. del as private _del;
  18. multi as private _multi;
  19. }
  20. protected function _initialize()
  21. {
  22. parent::_initialize();
  23. $this->model = new FengsuShipModel();
  24. }
  25. //查看
  26. #[Route("GET,JSON","index")]
  27. public function index()
  28. {
  29. return $this->_index();
  30. }
  31. //添加
  32. #[Route("GET,POST","add")]
  33. public function add()
  34. {
  35. //通过定义postParams来增加或覆盖post提交的表单
  36. $this->postParams=[];
  37. //通过定义callback回调函数来执行添加后的操作
  38. $this->callback=function ($model){};
  39. return $this->_add();
  40. }
  41. //修改
  42. #[Route("GET,POST","edit")]
  43. public function edit()
  44. {
  45. //通过定义postParams来增加或覆盖post提交的表单
  46. $this->postParams=[];
  47. //通过定义callback回调函数来执行修改后的操作
  48. $this->callback=function ($model){};
  49. return $this->_edit();
  50. }
  51. //删除
  52. #[Route("GET,POST","del")]
  53. public function del()
  54. {
  55. //通过定义callback回调函数来执行删除后的操作
  56. $this->callback=function ($ids){};
  57. return $this->_del();
  58. }
  59. //更新
  60. #[Route("GET,POST","multi")]
  61. public function multi()
  62. {
  63. //通过定义callback回调函数来执行更新后的操作
  64. $this->callback=function ($ids,$field,$value){};
  65. return $this->_multi();
  66. }
  67. }