12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879 |
- <?php
- namespace app\api\controller\v1;
- use app\api\controller\Base;
- use app\hander\HelpHander;
- use think\App;
- class PatrolTask extends Base
- {
- public function __construct(App $app = null) {
- parent::__construct($app);
- $this->model = new \app\common\model\PatrolTask();
- }
- public function lists(){
- $page = input('page/d',1);
- $size = input('size/d',10);
- $type = input('type/d');
- $patrol_mode = input('patrolMode/d');
- $status= input('status','');
- if($status == 0){
- $status = 2;
- }elseif ($status == 1){
- $status = 3;
- }elseif ($status == 2){
- $status = 5;
- }
- $model = $this->model;
- $ret = $model->lists($page,$size,$type,$this->userId,$this->orgId,$patrol_mode,$status);
- HelpHander::success($ret);
- }
- public function queryAddrList(){
- $taskId = input('taskId');
- $model = $this->model;
- $ret = $model->addrList($taskId,$this->orgId);
- if($ret){
- HelpHander::success($ret);
- }else{
- HelpHander::error('暂无信息');
- }
- }
- public function queryTaskDeatil(){
- $taskId = input('taskId');
- $formId = input('patrolAddrFormId');
- $model = $this->model;
- $ret = $model->taskDeatils($taskId,$formId,$this->orgId);
- if($ret){
- HelpHander::success($ret);
- }else{
- HelpHander::error('暂无信息');
- }
- }
- public function queryForms(){
- $patrolAddrFormId = input('patrolAddrFormId');
- $model = $this->model;
- $ret = $model->forms($patrolAddrFormId);
- if($ret){
- HelpHander::success($ret);
- }else{
- HelpHander::error('暂无信息');
- }
- }
- public function updateStatus(){
- $patrolTaskId = input('patrolTaskId');
- $interruptReson = input('interruptReson');
- $interruptImg = input('interruptImg');
- $model = $this->model;
- $ret = $model->updateStatus($patrolTaskId,$interruptReson,$interruptImg);
- if($ret){
- HelpHander::success([],'修改成功');
- }else{
- HelpHander::error($model->getError());
- }
- }
- }
|