DinnerUser.php 858 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <?php
  2. namespace app\api\controller\v1;
  3. use app\api\controller\Base;
  4. use app\hander\HelpHander;
  5. use think\Db;
  6. class DinnerUser extends Base
  7. {
  8. // 新增
  9. public function save(){
  10. model('DinnerUser')->add();
  11. HelpHander::success([],'操作成功');
  12. }
  13. // 编辑
  14. public function update(){
  15. model('DinnerUser')->add();
  16. HelpHander::success([],'操作成功');
  17. }
  18. public function detail(){
  19. $id = input('id/d',0);
  20. $ret = model('DinnerUser')->info($id);
  21. HelpHander::success($ret);
  22. }
  23. // 删除
  24. public function del(){
  25. $id = input('id/d',0);
  26. model('DinnerUser')->del($id);
  27. HelpHander::success([],'操作成功');
  28. }
  29. // 列表
  30. public function list(){
  31. $ret = model('DinnerUser')->lists();
  32. HelpHander::success($ret);
  33. }
  34. }