|
@@ -164,6 +164,43 @@ class Talent {
|
|
|
return true;
|
|
|
}
|
|
|
break;
|
|
|
+ case 4:
|
|
|
+ //发放人才码后增加积分记录
|
|
|
+ $mainId = $data["id"];
|
|
|
+ $where = [];
|
|
|
+ $where[] = ["ti.id", "=", $mainId];
|
|
|
+ $where[] = ["ti.checkState", "=", TalentState::CERTIFICATED];
|
|
|
+ $talentInfo = TalentModel::alias("ti")->leftJoin("un_enterprise e", "e.id=ti.enterprise_id")->field("ti.*,e.type as enterpriseType")->where($where)->find();
|
|
|
+ $where = [];
|
|
|
+ $where[] = ["mainId", "=", $mainId];
|
|
|
+ $where[] = ["projectType", "=", 1];
|
|
|
+ $integralLog = Db::table("new_integral_log")->where($where)->find();
|
|
|
+ if ($talentInfo && !$integralLog) {
|
|
|
+ $name = $talentInfo["name"]; //姓名
|
|
|
+ $cardNumber = $talentInfo["card_number"]; //身份证
|
|
|
+ $type = $talentInfo["enterpriseType"]; //企业类型
|
|
|
+
|
|
|
+ /* 查询是否升级 */
|
|
|
+
|
|
|
+ /* 查询最后一条积分日志 */
|
|
|
+ $where = [];
|
|
|
+ $where[] = ["name", "=", $name];
|
|
|
+ $where[] = ["card_number", "=", $cardNumber];
|
|
|
+ $last_log = Db::table("new_integral_log")->where($where)->order("createTime desc")->find();
|
|
|
+
|
|
|
+ $log["type"] = $type;
|
|
|
+ $log["projectType"] = 1;
|
|
|
+ $log["mainId"] = $mainId;
|
|
|
+ $log["name"] = $name;
|
|
|
+ $log["card_number"] = $cardNumber;
|
|
|
+ $log["lastPoints"] = $last_log["nowPoints"];
|
|
|
+ $log["gainPoints"] = $mainId;
|
|
|
+ $log["nowPoints"] = $mainId;
|
|
|
+ $log["lastPoints"] = $mainId;
|
|
|
+ $log["description"] = $mainId;
|
|
|
+ $log["createTime"] = date("Y-m-d H:i:s");
|
|
|
+ }
|
|
|
+ break;
|
|
|
}
|
|
|
return false;
|
|
|
}
|