CleanPlanRecord.php 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <?php
  2. namespace app\api\controller\v1;
  3. use app\api\controller\Base;
  4. use app\hander\HelpHander;
  5. use think\App;
  6. use think\Db;
  7. use think\exception\Handle;
  8. class CleanPlanRecord extends Base
  9. {
  10. public function __construct(App $app = null) {
  11. parent::__construct($app);
  12. $this->model = new \app\common\model\CleanPlanRecord();
  13. }
  14. public function detail(){
  15. $id=input('id/d',0);
  16. $ret=$this->model->detail($id,$this->orgId);
  17. if($ret){
  18. HelpHander::success($ret);
  19. }else{
  20. HelpHander::error('暂无信息');
  21. }
  22. }
  23. public function list(){
  24. $page=input('page',1);
  25. $size=input('size',10);
  26. $status=input('status/d',0);
  27. $day=input('day');
  28. $userId=$this->userId;
  29. $ret=$this->model->lists($page,$size,$status,$day,$userId,$this->orgId);
  30. HelpHander::success($ret);
  31. }
  32. public function finish(){
  33. $content = input('content','','trim');
  34. $imgs = input('imgs','','trim');
  35. $id =input('id/d',0);
  36. if(!$content){
  37. HelpHander::error('汇报内容不能为空');
  38. }
  39. $ret=$this->model->finish($id,$content,$imgs,$this->userId,$this->orgId);
  40. if(!$ret){
  41. HelpHander::error($this->model->getError());
  42. }
  43. HelpHander::success([],'操作成功');
  44. }
  45. }