GreenTask.php 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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 GreenTask extends Base
  7. {
  8. public function lists(){
  9. $page = input('page',1);
  10. $size = input('size',10);
  11. $type = input('type',1);
  12. $list = model('GreenTask')->lists($page,$size,$type,$this->userId,$this->orgId);
  13. HelpHander::success($list);
  14. }
  15. public function queryAddrList(){
  16. $taskId = input('taskId');
  17. $list = model('GreenTask')->addrList($taskId,$this->orgId,$this->userId);
  18. if(!$list){
  19. HelpHander::error('暂无信息');
  20. }
  21. HelpHander::success($list);
  22. }
  23. public function queryTaskDetail(){
  24. $taskId = input('taskId');
  25. $formId = input('greenTaskAddrId');
  26. $ret = model('GreenTask')->taskDetails($taskId,$formId,$this->orgId);
  27. if($ret){
  28. HelpHander::success($ret);
  29. }else{
  30. HelpHander::error('暂无信息');
  31. }
  32. }
  33. public function queryForms(){
  34. $greenTaskAddrId = input('greenTaskAddrId');
  35. $ret = model('GreenTask')->forms($greenTaskAddrId);
  36. if($ret){
  37. HelpHander::success($ret);
  38. }else{
  39. HelpHander::error('暂无信息');
  40. }
  41. }
  42. public function updateStatus(){
  43. $greenTaskId = input('greenTaskId');
  44. $interruptReson = input('interruptReson');
  45. $interruptImg = input('interruptImg');
  46. $ret = model('GreenTask')->updateStatus($greenTaskId,$interruptReson,$interruptImg);
  47. if($ret){
  48. HelpHander::success([],'修改成功');
  49. }else{
  50. HelpHander::error(model('GreenTask')->getError());
  51. }
  52. }
  53. }