|
@@ -92,11 +92,14 @@ class LivingAllowance extends EnterpriseController {
|
|
|
return $responseObj;
|
|
|
}
|
|
|
if (!$info["id"]) {
|
|
|
- $where = [];
|
|
|
- $where[] = ["idCard", "=", $info["idCard"]];
|
|
|
- $where[] = ["checkState", "=", LaState::LA_PASS];
|
|
|
- $totalApplyCount = LaModel::where($where)->count();
|
|
|
- if ($totalApplyCount >= 3) {
|
|
|
+ $year = substr($info["year"], 0, 4);
|
|
|
+
|
|
|
+ $passYears = CommonLaApi::getPassYearsByIdCard($info["idCard"]);
|
|
|
+ if (in_array($year, $passYears)) {
|
|
|
+ return $responseObj->msg = "您今年度已经申报过了,每年度仅能享受一次生活补贴!";
|
|
|
+ }
|
|
|
+
|
|
|
+ if (count($passYears) >= 3) {
|
|
|
return $responseObj->msg = "一个人最多享受三次!";
|
|
|
}
|
|
|
}
|
|
@@ -253,7 +256,7 @@ class LivingAllowance extends EnterpriseController {
|
|
|
$data["createTime"] = date("Y-m-d H:i:s");
|
|
|
$data["createUser"] = $this->user["uid"];
|
|
|
$data["creditStatus"] = 1;
|
|
|
- $count = CommonLaApi::getApplyCountByIdCard($data["idCard"]);
|
|
|
+ $count = count(CommonLaApi::getPassYearsByIdCard($data["idCard"]));
|
|
|
$data["applyCount"] = $count + 1;
|
|
|
if ($data["applyCount"] > 1 && !$data["personalTax"]) {
|
|
|
throw new ValidateException("非首年申报必须填写个税缴交情况!");
|