|
@@ -1603,27 +1603,31 @@ class Talent extends EnterpriseController {
|
|
$where[] = ["card_number", "not in", $sList];
|
|
$where[] = ["card_number", "not in", $sList];
|
|
}
|
|
}
|
|
$twiceIdentifyPersons = \app\common\api\VerifyApi::getTwiceIdentifyPersons();
|
|
$twiceIdentifyPersons = \app\common\api\VerifyApi::getTwiceIdentifyPersons();
|
|
- if ($twiceIdentifyPersons) {
|
|
|
|
|
|
+ if ($twiceIdentifyPersons && $type == ProjectState::LEVELCHANGE) {
|
|
$_whr = $where;
|
|
$_whr = $where;
|
|
- $where[] = ["card_number", "not in", $twiceIdentifyPersons];
|
|
|
|
$_whr[] = ["card_number", "in", $twiceIdentifyPersons];
|
|
$_whr[] = ["card_number", "in", $twiceIdentifyPersons];
|
|
- $tmpList = TalentModel::where($_whr)->field("id,name")->select()->toArray();
|
|
|
|
|
|
+ $tmpList = TalentModel::where($_whr)->field("id,name,card_number")->select()->toArray();
|
|
|
|
|
|
$twiceIdentifyPersonList = [];
|
|
$twiceIdentifyPersonList = [];
|
|
- foreach ($tmpList as $person) {
|
|
|
|
- if (!$twiceIdentifyPersonList[$person["card_number"]]) {
|
|
|
|
- $twiceIdentifyPersonList[$person["card_number"]] = $person;
|
|
|
|
|
|
+ foreach ($tmpList as $key => $person) {
|
|
|
|
+ $_cardNumber = $person["card_number"];
|
|
|
|
+ if (!$twiceIdentifyPersonList[$_cardNumber]) {
|
|
|
|
+ $twiceIdentifyPersonList[$_cardNumber] = $person;
|
|
} else {
|
|
} else {
|
|
- if ($person["talent_arrange"] < $twiceIdentifyPersonList[$person["card_number"]]["talent_arrange"]) {
|
|
|
|
- $twiceIdentifyPersonList[$person["card_number"]] = $person;
|
|
|
|
|
|
+ if ($person["talent_arrange"] < $twiceIdentifyPersonList[$_cardNumber]["talent_arrange"]) {
|
|
|
|
+ $twiceIdentifyPersonList[$_cardNumber] = $person;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
sort($twiceIdentifyPersonList);
|
|
sort($twiceIdentifyPersonList);
|
|
}
|
|
}
|
|
- $result = TalentModel::where($where)->field("id,name")->select()->toArray();
|
|
|
|
|
|
+ $result = TalentModel::where($where)->field("id,name,card_number")->select()->toArray();
|
|
if ($twiceIdentifyPersonList) {
|
|
if ($twiceIdentifyPersonList) {
|
|
- $result = array_merge($twiceIdentifyPersonList, (array) $result);
|
|
|
|
|
|
+ foreach ($result as &$res) {
|
|
|
|
+ if ($twiceIdentifyPersonList[$res["card_number"]]) {
|
|
|
|
+ $res["id"] = $twiceIdentifyPersonList[$res["card_number"]]["id"];
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
return json($result);
|
|
return json($result);
|
|
}
|
|
}
|