فهرست منبع

Merge remote-tracking branch 'origin/master'

zmw 1 سال پیش
والد
کامیت
5d82f74245
1فایلهای تغییر یافته به همراه11 افزوده شده و 21 حذف شده
  1. 11 21
      app/enterprise/controller/Talent.php

+ 11 - 21
app/enterprise/controller/Talent.php

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