|
@@ -507,8 +507,11 @@ class Recruit extends Base
|
|
|
$recruits = \app\common\model\Recruit::where(['user_id'=>$this->user_id,'is_deleted'=>0])->column('id');
|
|
|
$recruit_ids = RecruitResume::where('recruit_id','in',$recruits)->where('is_deleted',0)->where('to_deleted',0)->group('recruit_id')->column('recruit_id');
|
|
|
$ids_str = implode(',',$recruit_ids);
|
|
|
- $list = \app\common\model\Recruit::where(['r.user_id'=>$this->user_id,'r.is_deleted'=>0,])->where('r.id','in',$ids_str)->alias('r')
|
|
|
- ->field('r.id,IFNULL( (SELECT count( s.id) FROM dd_recruit_resume as s WHERE r.id=s.recruit_id ),0) as re_num')
|
|
|
+ $list = \app\common\model\Recruit::where(['r.user_id'=>$this->user_id,'r.is_deleted'=>0,])
|
|
|
+ //->where('r.id','in',$ids_str)
|
|
|
+ ->alias('r')
|
|
|
+ ->field('r.id,IFNULL( (SELECT count( s.id) FROM dd_recruit_resume as s WHERE r.id=s.recruit_id ),0) as re_num,IFNULL( (SELECT max(y.id) FROM dd_recruit_resume as y WHERE r.id=y.recruit_id ),0) as max_id')
|
|
|
+ ->order('max_id desc')
|
|
|
->select()->toArray();
|
|
|
var_dump( $list);
|
|
|
|