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