|
@@ -2,7 +2,7 @@
|
|
|
namespace app\api\controller;
|
|
|
use AlibabaCloud\SDK\Dingtalk\Vyida_1_0\Models\GetFormDataByIDResponseBody\originator\name;
|
|
|
use app\common\model\LeaveApprove;
|
|
|
-use app\common\model\LeaveFlow;
|
|
|
+use app\common\model\ApproveFlow;
|
|
|
use app\common\model\LeaveInfo;
|
|
|
use app\common\model\LeaveType;
|
|
|
use app\common\service\ApproveService;
|
|
@@ -34,11 +34,12 @@ class UserLeave extends Base
|
|
|
*/
|
|
|
public function getApproveFlow()
|
|
|
{
|
|
|
- $check_flow = LeaveFlow::where('user_id',$this->user_id)->where('type',1)->find();
|
|
|
+ $check_flow = ApproveFlow::where('user_id',$this->user_id)->where('type',1)->where('module',1)->find();
|
|
|
$where = [];
|
|
|
$where[] = ['l.type','=',1];
|
|
|
+ $where[] = ['l.module','=',1];
|
|
|
if($check_flow)$where[] = ['l.sort','>',$check_flow->sort];
|
|
|
- $list = LeaveFlow::field('l.user_id,u.name user_name,u.headimg')
|
|
|
+ $list = ApproveFlow::field('l.user_id,u.name user_name,u.headimg')
|
|
|
->alias('l')
|
|
|
->where($where)
|
|
|
->order('l.sort asc')
|
|
@@ -60,11 +61,12 @@ class UserLeave extends Base
|
|
|
*/
|
|
|
public function getCopyFlow()
|
|
|
{
|
|
|
- $check_flow = LeaveFlow::where('user_id',$this->user_id)->where('type',2)->find();
|
|
|
+ $check_flow = ApproveFlow::where('user_id',$this->user_id)->where('type',2)->where('module',1)->find();
|
|
|
$where = [];
|
|
|
$where[] = ['l.type','=',2];
|
|
|
+ $where[] = ['l.module','=',1];
|
|
|
if($check_flow)$where[] = ['l.sort','>',$check_flow->sort];
|
|
|
- $list = LeaveFlow::field('l.user_id,u.name user_name,u.headimg')
|
|
|
+ $list = ApproveFlow::field('l.user_id,u.name user_name,u.headimg')
|
|
|
->alias('l')
|
|
|
->where($where)
|
|
|
->order('l.sort asc')
|
|
@@ -117,12 +119,12 @@ class UserLeave extends Base
|
|
|
if(empty($request_param['user_id'])) $request_param['user_id'] = $this->user_id;
|
|
|
$request_param['apply_user'] = $this->user_id;// 申请会员id
|
|
|
|
|
|
- $flow = LeaveFlow::getApproveUser();// 请假审批流程设置
|
|
|
+ $flow = ApproveFlow::getApproveUser(1);// 请假审批流程设置
|
|
|
$flow_user = array_column($flow,'user_id');
|
|
|
$flow_key = array_search($request_param['user_id'],$flow_user);// 请假人是否在审批流程人员中
|
|
|
|
|
|
|
|
|
- $copy = LeaveFlow::getCopyTo();
|
|
|
+ $copy = ApproveFlow::getCopyTo(1);
|
|
|
$copy_user = array_column($copy,'user_id');
|
|
|
$copy_key = array_search($request_param['user_id'],$copy_user);// 请假人是否在抄送人员中
|
|
|
|