LeaderShip.php 1006 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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 LeaderShip extends Base
  7. {
  8. // 新增/编辑
  9. public function save(){
  10. model('LeaderShip')->add();
  11. HelpHander::success([],'操作成功');
  12. }
  13. // 详情
  14. public function detail(){
  15. $id = input('id/d',0);
  16. $ret = model('LeaderShip')->info($id);
  17. HelpHander::success($ret);
  18. }
  19. // 删除
  20. public function del(){
  21. $id = input('id/d',0);
  22. model('LeaderShip')->del($id);
  23. HelpHander::success([],'操作成功');
  24. }
  25. //列表
  26. public function list(){
  27. $page = input('page/d',1);
  28. $size = input('size/d',10);
  29. $content= input('content','','trim');
  30. $ret = model('LeaderShip')->lists($page,$size,$content,$this->userId);
  31. HelpHander::success($ret);
  32. }
  33. public function all(){
  34. $ret = model('LeaderShip')->all();
  35. HelpHander::success($ret);
  36. }
  37. }