wupengfei 2 年之前
父節點
當前提交
2e99e508ba
共有 1 個文件被更改,包括 76 次插入0 次删除
  1. 76 0
      application/api/controller/UserCar.php

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

@@ -0,0 +1,76 @@
+<?php
+namespace app\api\controller;
+use app\common\model\CarFlow;
+use think\Db;
+
+/**
+ * @title 用车管理
+ * @controller UserCar
+ * @group base
+ */
+class UserCar extends Base
+{
+    public function initialize()
+    {
+        parent::initialize();
+        parent::checkLogin();
+    }
+
+    /**
+     * @title 获取审批流程
+     * @desc 获取审批流程
+     * @author qc
+     * @url /api/User_car/getApproveFlow
+     * @method GET
+     * @tag 个人信息
+     * @header name:Authorization require:1 desc:Token
+     * @return name:user_name type:string default:-- desc:会员名称
+     * @return name:headimg type:string default:-- desc:会员头像
+     */
+    public function getApproveFlow()
+    {
+        $check_flow = CarFlow::where('user_id',$this->user_id)->where('type',1)->find();
+        $where = [];
+        $where[] = ['l.type','=',1];
+        if($check_flow)$where[] = ['l.sort','>',$check_flow->sort];
+        $list = CarFlow::field('l.user_id,u.name user_name,u.headimg')
+            ->alias('l')
+            ->where($where)
+            ->order('l.sort asc')
+            ->leftJoin('StoreMember u','u.id = l.user_id')
+            ->select()->toArray();
+        $this->success('ok',['list'=>$list]);
+    }
+
+    /**
+     * @title 获取抄送人流程
+     * @desc 获取抄送人流程
+     * @author qc
+     * @url /api/User_car/getCopyFlow
+     * @method GET
+     * @tag 个人信息
+     * @header name:Authorization require:1 desc:Token
+     * @return name:user_name type:string default:-- desc:会员名称
+     * @return name:headimg type:string default:-- desc:会员头像
+     */
+    public function getCopyFlow()
+    {
+        $check_flow = CarFlow::where('user_id',$this->user_id)->where('type',2)->find();
+        $where = [];
+        $where[] = ['l.type','=',2];
+        if($check_flow)$where[] = ['l.sort','>',$check_flow->sort];
+        $list = CarFlow::field('l.user_id,u.name user_name,u.headimg')
+            ->alias('l')
+            ->where($where)
+            ->order('l.sort asc')
+            ->leftJoin('StoreMember u','u.id = l.user_id')
+            ->select()->toArray();
+        $this->success('ok',['list'=>$list]);
+    }
+
+
+
+
+}
+
+