瀏覽代碼

增加人才层次认定基础分(未完成)

sugangqiang 1 年之前
父節點
當前提交
adbf3f1a0c
共有 1 個文件被更改,包括 37 次插入0 次删除
  1. 37 0
      app/job/Talent.php

+ 37 - 0
app/job/Talent.php

@@ -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;
     }