Преглед на файлове

津补贴中截取批次前4位

sugangqiang преди 9 месеца
родител
ревизия
3a181b390c

+ 1 - 1
app/admin/controller/LivingAllowance.php

@@ -1415,7 +1415,7 @@ class LivingAllowance extends AdminController {
         $where = [];
         $where[] = ["cardType", "=", $oldInfo["cardType"]];
         $where[] = ["idCard", "=", $oldInfo["idCard"]];
-        $where[] = ["year", "=", substr($oldInfo["year"], 0, 4)];
+        $where[] = ["year", "like", substr($oldInfo["year"], 0, 4) . "%"];
         $where[] = ["checkState", "=", 30];
         $where[] = ["publicState", ">=", 4];
         $talentAllowanceInfo = \app\common\model\TalentAllowance::where($where)->findOrEmpty()->toArray();

+ 1 - 1
app/admin/controller/TalentAllowance.php

@@ -1832,7 +1832,7 @@ class TalentAllowance extends AdminController {
 
     private function setTalentAllowanceInfo($where, $query, $process) {
         if (\StrUtil::isNotEmpAndNull($query["year"])) {
-            $where[] = ["year", "=", $query["year"]];
+            $where[] = ["year", "like", $query["year"] . "%"];
         }
         if (\StrUtil::isNotEmpAndNull($query["enterpriseName"])) {
             $where[] = ["enterpriseName", "like", "%" . $query["enterpriseName"] . "%"];

+ 3 - 2
app/enterprise/controller/Talent.php

@@ -1686,17 +1686,18 @@ class Talent extends EnterpriseController {
         $type = $this->request["type"];
         $res = [];
         $ids = null;
+        $year = substr($year, 0, 4);
         //根据申报年度查询当前企业已申报的人才
         if ($type == 1) {  //津补贴
             $where = [];
-            $where[] = ["year", "=", $year];
+            $where[] = ["year", "like", $year . "%"];
             $where[] = ["delete", "=", 0];
             $where[] = ["enterpriseId", "=", $this->user["uid"]];
             $talentAllowances = \app\common\model\TalentAllowance::where($where)->select()->toArray();
             $ids = array_unique(array_column($talentAllowances, "talentId"));
         } else if ($type == 2) {    //购房补贴
             $where = [];
-            $where[] = ["year", "=", $year];
+            $where[] = ["year", "like", $year . "%"];
             $where[] = ["delete", "=", 0];
             $where[] = ["enterpriseId", "=", $this->user["uid"]];
             $housePurchases = \app\common\model\HousePurchase::where($where)->select()->toArray();

+ 3 - 2
app/enterprise/controller/TalentAllowance.php

@@ -251,7 +251,7 @@ class TalentAllowance extends EnterpriseController {
         }
         if (!$param["id"]) {
             $where = [];
-            $where[] = ["year", "=", $param["year"]];
+            $where[] = ["year", "like", substr($param["year"], 0, 4) . "%"];
             $where[] = ["idCard", "=", $param["idCard"]];
             $where[] = ["delete", "=", 0];
             $where[] = ["checkState", "not in", [MainState::NOTPASS, MainState::PASS]];
@@ -1139,10 +1139,11 @@ class TalentAllowance extends EnterpriseController {
         $batch = BatchApi::getValidBatch(ProjectState::JBT, $this->user["type"]);
         $year = $batch["batch"];
         if ($year) {
+            $year = substr($year, 0, 4);
             $ids = null;
             //根据申报年度查询当前企业已申报的人才
             $where = [];
-            $where[] = ["year", "=", $year];
+            $where[] = ["year", "like", $year . "%"];
             $where[] = ["enterpriseId", "=", $this->user["uid"]];
             $talentAllowances = TaModel::where($where)->select()->toArray();
             $ids = array_unique(array_column($talentAllowances, "talentId"));

+ 1 - 1
app/job/TalentAllowance.php

@@ -71,7 +71,7 @@ class TalentAllowance {
                     }
 
                     $where = [];
-                    $where[] = ["year", "=", $year];
+                    $where[] = ["year", "like", substr($year, 0, 4) . "%"];
                     $where[] = ["delete", "=", 0];
                     $where[] = ["idCard", "=", $ti["card_number"]];
                     $where[] = ["checkState", "not in", [MainState::NOTPASS, MainState::PASS]];