|
@@ -463,6 +463,36 @@ class TalentAllowance extends EnterpriseController {
|
|
|
"newIdentifyMonth" => $year . "-12-31",
|
|
|
"newIdentifyGetTime" => $year . "-12-31"
|
|
|
];
|
|
|
+ if (in_array($info["idCard"], \app\common\api\VerifyApi::getTwiceIdentifyPersons())) {
|
|
|
+ $whr = [];
|
|
|
+ $whr[] = ["ti.checkState", "=", \app\common\api\TalentState::CERTIFICATED];
|
|
|
+ $whr[] = ["ti.enterprise_id", "=", $this->user["uid"]];
|
|
|
+ $whr[] = ["e.type", "=", $this->user["type"]];
|
|
|
+ $whr[] = ["ti.id", "<>", $talentInfo["id"]];
|
|
|
+ $whr[] = ["card_number", "=", $info["idCard"]];
|
|
|
+ $otherChangeList = \app\enterprise\model\Talent::alias("ti")->leftJoin("un_enterprise e", "e.id=ti.enterprise_id")->field("ti.*,e.`type` as eType")->order("identifyMonth desc")->where($whr)->select()->toArray();
|
|
|
+ foreach ($otherChangeList as $k => $oc) {
|
|
|
+ if ($k == 0) {
|
|
|
+ $newIdentifyMonth = $talentInfo["identifyMonth"];
|
|
|
+ $newIdentifyGetTime = $talentInfo["identifyGetTime"];
|
|
|
+ } else {
|
|
|
+ $newIdentifyMonth = $oc[$k - 1]["identifyMonth"];
|
|
|
+ $newIdentifyGetTime = $oc[$k - 1]["identifyGetTime"];
|
|
|
+ }
|
|
|
+ $typeList[] = [
|
|
|
+ "oldTalentArrange" => $oc["talent_arrange"],
|
|
|
+ "oldIdentifyCondition" => $oc["talent_condition"],
|
|
|
+ "oldIdentifyGetTime" => $oc["identifyGetTime"],
|
|
|
+ "oldIdentifyOutTime" => $oc["identifyExpireTime"],
|
|
|
+ "oldIdentifyMonth" => $oc["identifyMonth"],
|
|
|
+ "oldCertificateStartTime" => $oc["certificateGetTime"],
|
|
|
+ "oldCertificateOutTime" => $oc["certificateExpireTime"],
|
|
|
+ "newIdentifyMonth" => $newIdentifyMonth,
|
|
|
+ "newIdentifyGetTime" => $newIdentifyGetTime
|
|
|
+ ];
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
$totalMonth = \DateUtil::getMonthBetweenDates($year . "-01-01", $year . "-12-31");
|
|
|
/* * 获取上一年度有效的人才层次 */
|
|
|
usort($typeList, function($a, $b) {
|
|
@@ -1049,7 +1079,33 @@ class TalentAllowance extends EnterpriseController {
|
|
|
$whr[] = ["ti.enterprise_id", "=", $this->user["uid"]];
|
|
|
$whr[] = ["e.type", "=", $this->user["type"]];
|
|
|
$whr[] = ["ti.id", "not in", $ids];
|
|
|
+ $twiceIdentifyPersons = \app\common\api\VerifyApi::getTwiceIdentifyPersons();
|
|
|
+ if ($twiceIdentifyPersons) {
|
|
|
+ $_whr = $whr;
|
|
|
+ $whr[] = ["card_number", "not in", $twiceIdentifyPersons];
|
|
|
+ $_whr[] = ["card_number", "in", $twiceIdentifyPersons];
|
|
|
+ $tmpList = \app\enterprise\model\Talent::alias("ti")->leftJoin("un_enterprise e", "e.id=ti.enterprise_id")->field("ti.id,ti.name,ti.card_number as idCard,ti.cur_entry_time,e.`type` as eType")->where($_whr)->select()->toArray();
|
|
|
+
|
|
|
+ $twiceIdentifyPersonList = [];
|
|
|
+ $otherTypeChangeList = [];
|
|
|
+ foreach ($tmpList as $person) {
|
|
|
+ if (!$twiceIdentifyPersonList[$person["idCard"]]) {
|
|
|
+ $twiceIdentifyPersonList[$person["idCard"]] = $person;
|
|
|
+ } else {
|
|
|
+ if ($person["talent_arrange"] < $twiceIdentifyPersonList[$person["idCard"]]["talent_arrange"]) {
|
|
|
+ $otherTypeChangeList[$person["idCard"]][] = ["oldIdentifyMonth" => $twiceIdentifyPersonList[$person["idCard"]]["identifyMonth"], "oldIdentifyGetTime" => $twiceIdentifyPersonList[$person["idCard"]]["identifyGetTime"]];
|
|
|
+ $twiceIdentifyPersonList[$person["idCard"]] = $person;
|
|
|
+ } else {
|
|
|
+ $otherTypeChangeList[$person["idCard"]][] = ["oldIdentifyMonth" => $person["identifyMonth"], "oldIdentifyGetTime" => $person["identifyGetTime"]];
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ sort($twiceIdentifyPersonList);
|
|
|
+ }
|
|
|
$list = \app\enterprise\model\Talent::alias("ti")->leftJoin("un_enterprise e", "e.id=ti.enterprise_id")->field("ti.id,ti.name,ti.card_number as idCard,ti.cur_entry_time,e.`type` as eType")->where($whr)->select()->toArray();
|
|
|
+ if ($twiceIdentifyPersonList) {
|
|
|
+ $list = array_merge((array) $list, $twiceIdentifyPersonList);
|
|
|
+ }
|
|
|
foreach ($list as $info) {
|
|
|
$identifyTime = $info["identifyMonth"];
|
|
|
if ($info["eType"] == CommonConst::ENTERPRISE_JC) {
|
|
@@ -1063,6 +1119,9 @@ class TalentAllowance extends EnterpriseController {
|
|
|
$whereTypeChange[] = ["checkState", "=", MainState::PASS];
|
|
|
$whereTypeChange[] = ["isPublic", "=", 6];
|
|
|
$typeChanges = TalentTypeChange::where($whereTypeChange)->select()->toArray();
|
|
|
+ if ($otherTypeChangeList[$info["idCard"]]) {
|
|
|
+ $typeChanges = array_merge($otherTypeChangeList[$info["idCard"]], (array) $typeChanges);
|
|
|
+ }
|
|
|
foreach ($typeChanges as $typeChange) {
|
|
|
$oldIdentifyTime = $typeChange["oldIdentifyMonth"];
|
|
|
if ($typeChange["type"] == CommonConst::ENTERPRISE_JC) {
|