wupengfei il y a 2 ans
Parent
commit
ec375145ae
1 fichiers modifiés avec 22 ajouts et 0 suppressions
  1. 22 0
      application/api/controller/UserCar.php

+ 22 - 0
application/api/controller/UserCar.php

@@ -105,6 +105,7 @@ class UserCar extends Base
         $copy_user = array_column($copy,'user_id');
         $copy_key = array_search($request_param['user_id'],$copy_user);// 用车人是否在抄送人员中
 
+        $request_param['apply_date'] = date("Y-m-d");
         $flow_info = CarInfo::create($request_param);//生成用车记录
 
         $flow_data = [];// 审批流程
@@ -253,6 +254,27 @@ class UserCar extends Base
         $this->success('ok',['list'=>$list]);
     }
 
+    /**
+     * @title 撤销y申请
+     * @desc 撤销用车申请
+     * @author qc
+     * @url /api/User_car/cancelApply
+     * @method POST
+     * @tag
+     * @header name:Authorization require:1 desc:Token
+     * @param name:id type:int default:-- desc:用车记录id
+     *
+     */
+    public function cancelApply()
+    {
+        $id  = input('post.id');
+        $apply_info  = CarInfo::where('id',$id)->where('user_id',$this->user_id)->find();
+        if(!$apply_info)$this->error('用车记录有误');
+        $apply_info->status = 9;
+        $apply_info->save();
+        $this->success('撤销成功');
+    }
+