PartyFee.php 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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 PartyFee extends Base
  7. {
  8. // 新增/编辑
  9. public function save(){
  10. model('PartyFee')->add();
  11. HelpHander::success([],'操作成功');
  12. }
  13. // 详情
  14. public function detail(){
  15. $id = input('id/d',0);
  16. $ret = model('PartyFee')->info($id);
  17. HelpHander::success($ret);
  18. }
  19. // 删除
  20. public function del(){
  21. $id = input('id/d',0);
  22. model('PartyFee')->del($id);
  23. HelpHander::success([],'操作成功');
  24. }
  25. //列表
  26. public function list(){
  27. $title = input('name','','trim');
  28. $year = input('year','','trim');
  29. if(!$year){
  30. HelpHander::error('未选择年份');
  31. }
  32. $ret = model('PartyFee')->lists($title,$year);
  33. HelpHander::success($ret);
  34. }
  35. //用户列表
  36. public function ulist(){
  37. $year = input('year','','trim');
  38. if(!$year){
  39. HelpHander::error('未选择年份');
  40. }
  41. $ret = model('PartyFee')->ulists($this->userId,$year);
  42. HelpHander::success($ret);
  43. }
  44. }