|
@@ -223,7 +223,7 @@ class Collection extends Backend
|
|
|
//比较两者的不同,然后在删除
|
|
|
$array_diff = array_diff($user_ids,explode(',',$depart_id));
|
|
|
|
|
|
- if(!empty($depart_id)){
|
|
|
+ if(!empty($array_diff)){
|
|
|
//判断是否有已经开始考试的人员
|
|
|
$isset_exam = $this->exam_model->where(['user_id'=>['in',$array_diff],'exam_collection_id'=>$ids,'exam_status'=>4])->find();
|
|
|
if(!empty($isset_exam)){
|
|
@@ -233,7 +233,7 @@ class Collection extends Backend
|
|
|
$result = false;
|
|
|
Db::startTrans();
|
|
|
try {
|
|
|
- if(!empty($depart_id)){
|
|
|
+ if(!empty($array_diff)){
|
|
|
$depart_count = count($array_diff);
|
|
|
$params['xueyuan_count'] = $row->xueyuan_count-$depart_count??0;
|
|
|
$result = $row->allowField(true)->save($params);
|