|
@@ -33,17 +33,7 @@ class UserCar extends Base
|
|
|
*/
|
|
|
public function getApproveFlow()
|
|
|
{
|
|
|
- $check_flow = ApproveFlow::where('user_id',$this->user_id)->where('type',1)->where('module',2)->find();
|
|
|
- $where = [];
|
|
|
- $where[] = ['l.type','=',1];
|
|
|
- $where[] = ['l.module','=',2];
|
|
|
- if($check_flow)$where[] = ['l.sort','>',$check_flow->sort];
|
|
|
- $list = ApproveFlow::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();
|
|
|
+ $list = ApproveFlow::getApproveUser(2,$this->user_id);
|
|
|
$this->success('ok',['list'=>$list]);
|
|
|
}
|
|
|
|
|
@@ -60,17 +50,7 @@ class UserCar extends Base
|
|
|
*/
|
|
|
public function getCopyFlow()
|
|
|
{
|
|
|
- $check_flow = ApproveFlow::where('user_id',$this->user_id)->where('type',2)->where('module',2)->find();
|
|
|
- $where = [];
|
|
|
- $where[] = ['l.type','=',2];
|
|
|
- $where[] = ['l.module','=',2];
|
|
|
- if($check_flow)$where[] = ['l.sort','>',$check_flow->sort];
|
|
|
- $list = ApproveFlow::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();
|
|
|
+ $list = ApproveFlow::getCopyTo(2,$this->user_id);
|
|
|
$this->success('ok',['list'=>$list]);
|
|
|
}
|
|
|
|
|
@@ -109,7 +89,7 @@ class UserCar extends Base
|
|
|
$approve_res = ApproveFlow::getApproveData($flow_user,$copy_user,$flow_info->id);
|
|
|
$flow_data = $approve_res['flow_data'];// 审批流程
|
|
|
$flow_num = $approve_res['flow_num'];
|
|
|
-
|
|
|
+
|
|
|
if(!empty($flow_data)) {
|
|
|
CarInfo::where('id',$flow_info->id)->update(['approve_num'=>$flow_num]);
|
|
|
(new CarApprove())->saveAll($flow_data);
|