|
@@ -124,7 +124,7 @@ class Base extends EnterpriseController {
|
|
|
echo sprintf("<script>parent.TalentInfoInfoDlg.infoCallback(%s);</script>", json_encode($res));
|
|
|
exit;
|
|
|
} */
|
|
|
- $no_empty[] = "pre_contract_rangetime";
|
|
|
+ $no_empty[] = "pre_import_type";
|
|
|
}
|
|
|
$return = [];
|
|
|
foreach ($no_empty as $key) {
|
|
@@ -144,7 +144,22 @@ class Base extends EnterpriseController {
|
|
|
$where[] = ["must", "=", 1];
|
|
|
$filetypes = Db::table("new_common_filetype")->where($where)->select()->toArray();
|
|
|
|
|
|
- $ft_ids = array_column($filetypes, "id");
|
|
|
+
|
|
|
+ $ft_ids = [];
|
|
|
+ $deletes = [];
|
|
|
+ foreach ($filetypes as $ft) {
|
|
|
+ if ($ft["option"]) {
|
|
|
+ $selectVal = $param[$ft["rel"]];
|
|
|
+ $conditions = array_filter(explode(",", $ft["option"]));
|
|
|
+ if (!in_array($selectVal, $conditions)) {
|
|
|
+ $deletes[] = $ft["id"];
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ $ft_ids[] = $ft["id"];
|
|
|
+ }
|
|
|
+
|
|
|
+ //$ft_ids = array_column($filetypes, "id");
|
|
|
$whr = [];
|
|
|
$upload_type_counts = 0;
|
|
|
if ($files) {
|
|
@@ -193,8 +208,34 @@ class Base extends EnterpriseController {
|
|
|
$data["checkState"] = TalentState::FST_SAVE;
|
|
|
$id = TalentModel::insertGetId($data);
|
|
|
TalentLogApi::write(1, $id, TalentState::FST_SAVE, "添加人才认定申报", 1);
|
|
|
+ $whr = [];
|
|
|
+ $whr[] = ["fileId", "in", $files];
|
|
|
+ $upd_checklog["mainId"] = $id;
|
|
|
+ Db::table("new_talent_checklog")->where($whr)->save($upd_checklog);
|
|
|
}
|
|
|
if ($id) {
|
|
|
+ if ($deletes) {
|
|
|
+ //删除多余的附件,一般是选择人才类型留下来的
|
|
|
+ $whr = [];
|
|
|
+ $whr[] = ["typeId", "in", $deletes];
|
|
|
+ $whr[] = ["id", "in", $files];
|
|
|
+ $_wait_del_files = Db::table("new_talent_file")->where($whr)->select()->toArray();
|
|
|
+ $_logfileIds[] = [];
|
|
|
+ foreach ($_wait_del_files as $_del_file) {
|
|
|
+ $_logfileIds[] = $_del_file["id"];
|
|
|
+ @unlink("storage/" . $_del_file["url"]);
|
|
|
+ }
|
|
|
+ Db::table("new_talent_file")->where($whr)->delete();
|
|
|
+ if ($_logfileIds) {
|
|
|
+ $whr = [];
|
|
|
+ $whr[] = ["fileId", "in", $_logfileIds];
|
|
|
+ $_upd_checklog["description"] = "人才申报过程1中取消且已经彻底删除的附件";
|
|
|
+ $_upd_checklog["updateUser"] = sprintf("%s(%s)", $this->user["account"], $this->user["companyName"] ?: $this->user["rolename"]);
|
|
|
+ $_upd_checklog["updateTime"] = date("Y-m-d H:i:s");
|
|
|
+ Db::table("new_talent_checklog")->where($whr)->save($_upd_checklog);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
$whr = [];
|
|
|
$whr[] = ["id", "in", $files];
|
|
|
Db::table("new_talent_file")->where($whr)->save(["mainId" => $id]);
|
|
@@ -236,7 +277,20 @@ class Base extends EnterpriseController {
|
|
|
$where[] = ["must", "=", 1];
|
|
|
$filetypes = Db::table("new_common_filetype")->where($where)->select()->toArray();
|
|
|
|
|
|
- $ft_ids = array_column($filetypes, "id");
|
|
|
+ $ft_ids = [];
|
|
|
+ foreach ($filetypes as $ft) {
|
|
|
+ if ($ft["option"]) {
|
|
|
+ $selectVal = $info[$ft["rel"]];
|
|
|
+ $conditions = array_filter(explode(",", $ft["option"]));
|
|
|
+ if (!in_array($selectVal, $conditions)) {
|
|
|
+ $deletes[] = $ft["id"];
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ $ft_ids[] = $ft["id"];
|
|
|
+ }
|
|
|
+
|
|
|
+ //$ft_ids = array_column($filetypes, "id");
|
|
|
$whr = [];
|
|
|
$upload_type_counts = 0;
|
|
|
if ($ft_ids) {
|