|
@@ -20,9 +20,20 @@ class ApproveFlow extends Model
|
|
|
}
|
|
|
|
|
|
// 获取抄送人
|
|
|
- public static function getCopyTo($module)
|
|
|
+ public static function getCopyTo($module,$user_id)
|
|
|
{
|
|
|
- return static::where('type',2)->where('module',$module)->order('sort asc ,id asc')->select()->toArray();
|
|
|
+ $check_flow = ApproveFlow::where('user_id',$user_id)->where('type',2)->where('module',$module)->find();
|
|
|
+ $where = [];
|
|
|
+ $where[] = ['l.type','=',2];
|
|
|
+ $where[] = ['l.module','=',$module];
|
|
|
+ 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();
|
|
|
+ return $list;
|
|
|
}
|
|
|
|
|
|
|