Talent.php 47 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998
  1. <?php
  2. namespace app\enterprise\controller;
  3. use app\enterprise\common\EnterpriseController;
  4. use app\enterprise\api\TalentApi;
  5. use app\enterprise\model\Talent as TalentModel;
  6. use think\facade\Db;
  7. use app\common\api\EnterpriseApi;
  8. use app\common\api\DictApi;
  9. use app\common\api\TalentLogApi;
  10. use app\common\api\TalentState;
  11. use think\exception\ValidateException;
  12. use app\enterprise\validate\TalentInfo;
  13. // 0正在填写 1保存未提交 2已提交未审核 3已审核 4驳回 5保存补充材料未提交 6提交补充材料进入初审 7初审通过 8初审驳回 9部门审核通过 10部门审核驳回 11复核通过 12复核驳回 13复核失败
  14. /**
  15. * Description of Talent
  16. *
  17. * @author sgq
  18. */
  19. class Talent extends EnterpriseController {
  20. public function index() {
  21. $isMix = $this->request->param("isMix");
  22. $tpl = "";
  23. if ($isMix == 1) {
  24. $tpl = "newIndex";
  25. }
  26. return view($tpl);
  27. }
  28. public function list() {
  29. $step = 2;
  30. $res = TalentApi::getList($this->request, $step);
  31. return json($res);
  32. }
  33. public function zrIndex() {
  34. return view();
  35. }
  36. /**
  37. * 新人才申报企业端统一申报入口,混合基础信息及人才信息
  38. */
  39. public function apply(\think\Request $request) {
  40. $type = $this->user["type"];
  41. $tpl = "";
  42. switch ($type) {
  43. case 1:
  44. $tpl = "apply"; //晋江人才
  45. break;
  46. case 2:
  47. $tpl = "ic_apply"; //集成电路
  48. break;
  49. }
  50. $param = $request->param();
  51. $id = isset($param["id"]) ? $param["id"] : 0;
  52. $info = \app\common\api\VerifyApi::getTalentInfoById($id);
  53. if ($info["isImport"]) {
  54. //$tpl = "no_file_apply"; //晋江人才
  55. }
  56. $ep = EnterpriseApi::getOne($this->user["uid"]);
  57. if (!chkEnterpriseFull($ep))
  58. return;
  59. $tagList = DictApi::selectByParentCode('enterprise_tag');
  60. $streetList = DictApi::selectByParentCode('street');
  61. $industryFieldNew = DictApi::selectByParentCode('industry_field');
  62. $ep->enterpristTagName = $tagList[$ep->enterpriseTag];
  63. $ep->streetName = $streetList[$ep->street];
  64. $ep->industryFieldNewName = $industryFieldNew[$ep->industryFieldNew];
  65. if ($info) {
  66. $info["real_state"] = TalentLogApi::getLastLog($id, 1)["state"];
  67. }
  68. if ($info && in_array($info["checkState"], [TalentState::FST_VERIFY_PASS, TalentState::DEPT_VERIFY_PASS, TalentState::REVERIFY_PASS, TalentState::REVERIFY_FAIL])) {
  69. return $this->view($request);
  70. exit();
  71. }
  72. if ($request->isPost()) {
  73. $checkState = $info["checkState"] ?: 0;
  74. if ($checkState == TalentState::SCND_SAVE || $checkState == 0) {
  75. switch ($type) {
  76. case 1:
  77. $this->mixSave($info, $request, TalentState::SCND_SAVE);
  78. exit();
  79. break;
  80. case 2:
  81. $this->icSave($info, $request, TalentState::SCND_SAVE);
  82. exit();
  83. break;
  84. }
  85. } else if (in_array($checkState, [TalentState::BASE_VERIFY_FAIL, TalentState::BASE_REVERIFY_FAIL, TalentState::FST_VERIFY_FAIL, TalentState::REVERIFY_FAIL])) {
  86. $res = ["msg" => "审核失败,不能再保存"];
  87. echo sprintf("<script>parent.TalentInfoInfoDlg.infoCallback(%s);</script>", json_encode($res));
  88. exit;
  89. }
  90. $res = ["msg" => "已提交审核,请耐心等待"];
  91. echo sprintf("<script>parent.TalentInfoInfoDlg.infoCallback(%s);</script>", json_encode($res));
  92. exit;
  93. }
  94. $checkState = $info["checkState"] ?: 0;
  95. $batch = \app\common\api\BatchApi::getValidBatch(\app\common\state\ProjectState::TALENT, $this->user["type"]);
  96. $info["enterprise"] = $ep;
  97. $info["talent_type_list"] = DictApi::findChildDictByCode("talent_type");
  98. return view($tpl, ["year" => $batch["batch"], "checkState" => $checkState, "row" => $info]);
  99. }
  100. /**
  101. * 旧第二步
  102. * @param \think\Request $request
  103. * @return type
  104. */
  105. public function second(\think\Request $request) {
  106. if ($this->user["type"] != 1)
  107. return "此入口仅供晋江市人才申报,晋江集成电路人才请使用新统一申报入口";
  108. $params = $request->param();
  109. $id = $params["id"];
  110. $info = \app\common\api\VerifyApi::getTalentInfoById($id);
  111. $info["real_state"] = TalentLogApi::getLastLog($id, 1)["state"];
  112. if ($request->isPost()) {
  113. if (!$info || $info["enterprise_id"] != $this->user["uid"]) {
  114. $res = ["msg" => "没有对应的人才认定申报信息"];
  115. echo sprintf("<script>parent.TalentInfoInfoDlg.infoCallback(%s);</script>", json_encode($res));
  116. exit;
  117. }
  118. $checkState = $info["checkState"];
  119. if ($checkState == TalentState::SCND_SAVE || $checkState == TalentState::BASE_REVERIFY_PASS) {
  120. $this->save($info, $request, TalentState::SCND_SAVE);
  121. exit();
  122. } else if (in_array($checkState, [TalentState::BASE_VERIFY_FAIL, TalentState::BASE_REVERIFY_FAIL, TalentState::FST_VERIFY_FAIL, TalentState::REVERIFY_FAIL])) {
  123. $res = ["msg" => "审核失败,不能再保存"];
  124. echo sprintf("<script>parent.TalentInfoInfoDlg.infoCallback(%s);</script>", json_encode($res));
  125. exit;
  126. }
  127. $res = ["msg" => "已提交审核,请耐心等待"];
  128. echo sprintf("<script>parent.TalentInfoInfoDlg.infoCallback(%s);</script>", json_encode($res));
  129. exit;
  130. }
  131. $enterprise_info = \app\common\model\Enterprise::find($this->user["uid"]);
  132. $info["enterprise"] = $enterprise_info;
  133. $batch = \app\common\api\BatchApi::getValidBatch(1, $enterprise_info["type"]);
  134. return view("second", ["year" => $info["apply_year"] ?: $batch["batch"], "row" => $info]);
  135. }
  136. public function view(\think\Request $request) {
  137. switch ($this->user["type"]) {
  138. case 1:
  139. $tpl = "view"; //晋江人才
  140. break;
  141. case 2:
  142. $tpl = "ic_view"; //集成电路
  143. break;
  144. }
  145. $id = $request->param("id");
  146. $info = \app\common\api\VerifyApi::getTalentInfoById($id);
  147. if ($info["isImport"]) {
  148. //$tpl = "no_file_view";
  149. }
  150. return view($tpl, ["row" => $info]);
  151. }
  152. /**
  153. * 提交表单(旧第二步)
  154. */
  155. public function submit() {
  156. $params = $this->request->param();
  157. $id = $params["id"];
  158. if (!$info = TalentApi::chkIsOwner($id, $this->user["uid"])) {
  159. $res = ["msg" => "没有对应的人才认定申报信息"];
  160. echo sprintf("<script>parent.TalentInfoInfoDlg.submitCallback(%s);</script>", json_encode($res));
  161. exit;
  162. }
  163. if ($info) {
  164. $info["real_state"] = TalentLogApi::getLastLog($id, 1)["state"];
  165. }
  166. $checkState = $info["checkState"];
  167. if ($checkState == TalentState::SCND_SAVE || $checkState == TalentState::BASE_REVERIFY_PASS) {
  168. $field_dict = \app\common\api\DictApi::getTalentFields(2);
  169. $no_empty = ["talent_arrange", "talent_condition", "highest_degree", "graduate_school", "major", "bank", "bank_number", "bank_branch_name",
  170. "bank_account", "study_abroad", "phone", "email", "import_way", "cur_entry_time", "cur_entry_time", "position", "source"];
  171. $where = [];
  172. $where[] = ["rel", "=", "study_abroad"];
  173. $where[] = ["step", "=", 2];
  174. $where[] = ["project", "=", 1];
  175. $where[] = ["active", "=", 1];
  176. $where[] = ["delete", "=", 0];
  177. $where[] = ["type", "=", $this->user["type"]];
  178. $where[] = ["isConditionFile", "<>", 1];
  179. $abroad_files = Db::table("new_common_filetype")->where($where)->select()->toArray(); //留学的附件
  180. $abroad_file_ids = null;
  181. if ($abroad_files)
  182. $abroad_file_ids = array_column($abroad_files, "id");
  183. if ($params["study_abroad"] == 1) {
  184. $no_empty[] = "abroad_school";
  185. $no_empty[] = "abroad_major";
  186. }
  187. if (in_array($params["source"], [1, 3])) {
  188. $no_empty[] = "source_batch";
  189. $no_empty[] = "fujian_highcert_pubtime";
  190. $no_empty[] = "fujian_highcert_exptime";
  191. if ($params["source"] == 3) {
  192. $no_empty[] = "source_city";
  193. }
  194. }
  195. if (in_array($params["source"], [2, 4])) {
  196. $no_empty[] = "source_batch";
  197. $no_empty[] = "quanzhou_highcert_pubtime";
  198. $no_empty[] = "quanzhou_highcert_exptime";
  199. if ($params["source"] == 4) {
  200. $no_empty[] = "source_county";
  201. }
  202. }
  203. $condition_info = Db::table("new_talent_condition")->findOrEmpty($params["talent_condition"]);
  204. if ($condition_info["isSalary"] == 1) {
  205. $no_empty[] = "annual_salary";
  206. }
  207. $no_empty = array_filter($no_empty);
  208. $return = [];
  209. foreach ($no_empty as $key) {
  210. if (!$params[$key]) {
  211. $return[] = sprintf("请填写“%s”", $field_dict[$key]);
  212. }
  213. }
  214. if (count($return) > 0) {
  215. $res = ["msg" => implode("<br>", $return)];
  216. echo sprintf("<script>parent.TalentInfoInfoDlg.submitCallback(%s);</script>", json_encode($res));
  217. exit;
  218. }
  219. if ($condition_info["bindFileTypes"] && $info["source"] == 5) {
  220. $whr[] = ["id", "in", $condition_info["bindFileTypes"]];
  221. $whr[] = ["must", "=", 1];
  222. }
  223. $where = [];
  224. $where[] = ["step", "=", 2];
  225. $where[] = ["project", "=", 1];
  226. $where[] = ["type", "=", $this->user["type"]];
  227. $where[] = ["must", "=", 1];
  228. $where[] = ["active", "=", 1];
  229. $where[] = ["delete", "=", 0];
  230. $where[] = ["isConditionFile", "<>", 1];
  231. if ($whr) {
  232. $filetypes = Db::table("new_common_filetype")->whereOr([$where, $whr])->select()->toArray();
  233. } else {
  234. $filetypes = Db::table("new_common_filetype")->where($where)->select()->toArray();
  235. }
  236. $ft_ids = array_column($filetypes, "id");
  237. if ($params["study_abroad"] == 1) {
  238. //选中留学,如果存在留学附件变成必传
  239. $ft_ids = array_unique(array_merge($ft_ids, (array) $abroad_file_ids));
  240. } else {
  241. //没选中,留学附件就算设成必传也不用验证
  242. $ft_ids = array_diff($ft_ids, (array) $abroad_file_ids);
  243. }
  244. $whr = [];
  245. $whr[] = ["typeId", "in", $ft_ids];
  246. $whr[] = ["mainId", "=", $id];
  247. $distinct_filetypes = Db::table("new_talent_file")->where($whr)->distinct(true)->field("typeId")->select();
  248. $upload_type_counts = count($distinct_filetypes);
  249. if ($upload_type_counts != count($ft_ids)) {
  250. $res = ["msg" => "请留意附件上传栏中带*号的内容均为必传项,请上传完整再提交审核"];
  251. echo sprintf("<script>parent.TalentInfoInfoDlg.submitCallback(%s);</script>", json_encode($res));
  252. exit;
  253. }
  254. $this->save($info, $this->request, TalentState::SCND_SUBMIT);
  255. } else if (in_array($checkState, [TalentState::BASE_VERIFY_FAIL, TalentState::BASE_REVERIFY_FAIL, TalentState::FST_VERIFY_FAIL, TalentState::REVERIFY_FAIL])) {
  256. $res = ["msg" => "审核失败,不能再提交审核"];
  257. echo sprintf("<script>parent.TalentInfoInfoDlg.submitCallback(%s);</script>", json_encode($res));
  258. exit;
  259. }
  260. $res = ["msg" => "已提交审核,请耐心等待"];
  261. echo sprintf("<script>parent.TalentInfoInfoDlg.submitCallback(%s);</script>", json_encode($res));
  262. exit;
  263. }
  264. public function submitToCheck() {
  265. switch ($this->user["type"]) {
  266. case 1:
  267. return $this->submitToCheck_JJRC();
  268. case 2:
  269. return $this->submitToCheck_IC();
  270. }
  271. }
  272. /**
  273. * 提交表单(新:混合基础信息人才申报信息)晋江人才
  274. */
  275. private function submitToCheck_JJRC() {
  276. $params = $this->request->param();
  277. $id = $params["id"];
  278. $info = TalentApi::chkIsOwner($id, $this->user["uid"]);
  279. if ($info) {
  280. $info["real_state"] = TalentLogApi::getLastLog($id, 1)["state"];
  281. }
  282. $checkState = $info["checkState"];
  283. if ($checkState == TalentState::SCND_SAVE || !$id) {
  284. $field_dict = \app\common\api\DictApi::getTalentFields(4, $info["isImport"]);
  285. $no_empty = ["name", "nation", "card_type", "card_number", "sex", "birthday", "politics", "nationality", "province", "city", "county", "talent_type", "experience", "education",
  286. "talent_arrange", "talent_condition", "highest_degree", "graduate_school", "major", "bank", "bank_number", "bank_branch_name",
  287. "bank_account", "study_abroad", "phone", "email", "import_way", "cur_entry_time", "cur_entry_time", "position", "source"];
  288. $where = [];
  289. $where[] = ["rel", "=", "study_abroad"];
  290. $where[] = ["project", "=", 1];
  291. $where[] = ["active", "=", 1];
  292. $where[] = ["delete", "=", 0];
  293. $where[] = ["type", "=", $this->user["type"]];
  294. $where[] = ["isConditionFile", "<>", 1];
  295. $abroad_files = Db::table("new_common_filetype")->where($where)->select()->toArray(); //留学的附件
  296. $abroad_file_ids = null;
  297. if ($abroad_files)
  298. $abroad_file_ids = array_column($abroad_files, "id");
  299. if (in_array($params["talent_type"], [1, 2])) {
  300. $no_empty[] = "tax_insurance_month";
  301. $no_empty[] = "labor_contract_rangetime";
  302. }
  303. if ($params["talent_type"] == 3) {
  304. $no_empty[] = "pre_import_type";
  305. }
  306. if ($params["study_abroad"] == 1) {
  307. $no_empty[] = "abroad_school";
  308. $no_empty[] = "abroad_major";
  309. }
  310. if (in_array($params["source"], [1, 3])) {
  311. //$no_empty[] = "source_batch";
  312. //$no_empty[] = "fujian_highcert_pubtime";
  313. //$no_empty[] = "fujian_highcert_exptime";
  314. if ($params["source"] == 3) {
  315. $no_empty[] = "source_city";
  316. }
  317. }
  318. if (in_array($params["source"], [2, 4])) {
  319. //$no_empty[] = "source_batch";
  320. //$no_empty[] = "quanzhou_highcert_pubtime";
  321. //$no_empty[] = "quanzhou_highcert_exptime";
  322. if ($params["source"] == 4) {
  323. $no_empty[] = "source_county";
  324. }
  325. }
  326. $condition_info = Db::table("new_talent_condition")->findOrEmpty($params["talent_condition"]);
  327. if ($condition_info["isSalary"] == 1) {
  328. $no_empty[] = "annual_salary";
  329. }
  330. $no_empty = array_filter($no_empty);
  331. $return = [];
  332. foreach ($no_empty as $key) {
  333. if (!$params[$key]) {
  334. $return[] = sprintf("请填写“%s”", $field_dict[$key]);
  335. }
  336. }
  337. if (count($return) > 0) {
  338. $res = ["msg" => implode("<br>", $return)];
  339. echo sprintf("<script>parent.TalentInfoInfoDlg.submitCallback(%s);</script>", json_encode($res));
  340. exit;
  341. }
  342. $isMatchZhiren = $info["isImport"] && $params["isMatchZhiren"] == 1 ? true : false;
  343. if ($condition_info["bindFileTypes"] && $info["source"] == 5 && !$isMatchZhiren) {
  344. $whr[] = ["id", "in", $condition_info["bindFileTypes"]];
  345. $whr[] = ["must", "=", 1];
  346. }
  347. $where = [];
  348. $where[] = ["project", "=", 1];
  349. $where[] = ["type", "=", $this->user["type"]];
  350. $where[] = ["must", "=", 1];
  351. $where[] = ["active", "=", 1];
  352. $where[] = ["delete", "=", 0];
  353. $where[] = ["isConditionFile", "<>", 1];
  354. if ($whr) {
  355. $filetypes = Db::table("new_common_filetype")->whereOr([$where, $whr])->select()->toArray();
  356. } else {
  357. $filetypes = Db::table("new_common_filetype")->where($where)->select()->toArray();
  358. }
  359. $age = 0;
  360. if ($params["birthday"]) {
  361. $birthday = $params["birthday"];
  362. $birthdayYear = substr($birthday, 0, 4);
  363. $currentYear = date("Y");
  364. $age = $currentYear - $birthdayYear;
  365. }
  366. $ft_ids = [];
  367. $deletes = [];
  368. foreach ($filetypes as $ft) {
  369. if ($ft["option"]) {
  370. if ($ft["rel"] == "birthday") {
  371. if ($age < $ft["option"]) {
  372. $deletes[] = $ft["id"];
  373. continue;
  374. }
  375. } else {
  376. $selectVal = $params[$ft["rel"]];
  377. $conditions = array_filter(explode(",", $ft["option"]));
  378. if (!in_array($selectVal, $conditions)) {
  379. $deletes[] = $ft["id"];
  380. continue;
  381. }
  382. }
  383. }
  384. $ft_ids[] = $ft["id"];
  385. }
  386. if ($params["study_abroad"] == 1) {
  387. //选中留学,如果存在留学附件变成必传
  388. $ft_ids = array_unique(array_merge($ft_ids, (array) $abroad_file_ids));
  389. } else {
  390. //没选中,留学附件就算设成必传也不用验证
  391. $ft_ids = array_diff($ft_ids, (array) $abroad_file_ids);
  392. }
  393. $whr = [];
  394. if ($id) {
  395. $whr[] = ["mainId", "=", $id];
  396. } else {
  397. if ($params["uploadFiles"])
  398. $whr[] = ["id", "in", $params["uploadFiles"]];
  399. }
  400. $whr[] = ["typeId", "in", $ft_ids];
  401. $distinct_filetypes = Db::table("new_talent_file")->where($whr)->distinct(true)->field("typeId")->select();
  402. $upload_type_counts = count($distinct_filetypes);
  403. if ($upload_type_counts != count($ft_ids)) {
  404. $res = ["msg" => "请留意附件上传栏中带*号的内容均为必传项,请上传完整再提交审核"];
  405. echo sprintf("<script>parent.TalentInfoInfoDlg.submitCallback(%s);</script>", json_encode($res));
  406. exit;
  407. }
  408. return $this->mixSave($info, $this->request, TalentState::SCND_SUBMIT);
  409. } else if (in_array($checkState, [TalentState::BASE_VERIFY_FAIL, TalentState::BASE_REVERIFY_FAIL, TalentState::FST_VERIFY_FAIL, TalentState::REVERIFY_FAIL, TalentState::ZX_FAIL, TalentState::ANNOUNCED_REVERIFY_FAIL, TalentState::PUBLISH_FAIL])) {
  410. $res = ["msg" => "审核失败,不能再提交审核"];
  411. echo sprintf("<script>parent.TalentInfoInfoDlg.submitCallback(%s);</script>", json_encode($res));
  412. exit;
  413. }
  414. $res = ["msg" => "已提交审核,请耐心等待"];
  415. echo sprintf("<script>parent.TalentInfoInfoDlg.submitCallback(%s);</script>", json_encode($res));
  416. exit;
  417. }
  418. /**
  419. * 提交表单(新:混合基础信息人才申报信息)晋江电路
  420. */
  421. private function submitToCheck_IC() {
  422. $params = $this->request->param();
  423. $id = $params["id"];
  424. if (!$info = TalentApi::chkIsOwner($id, $this->user["uid"])) {
  425. return json(["msg" => "没有对应的人才认定申报信息"]);
  426. }
  427. if ($info) {
  428. $info["real_state"] = TalentLogApi::getLastLog($id, 1)["state"];
  429. }
  430. $checkState = $info["checkState"];
  431. if ($checkState == TalentState::SCND_SAVE) {
  432. $field_dict = \app\common\api\DictApi::getTalentFields_IC();
  433. $no_empty = ["name", "card_type", "card_number", "sex", "birthday", "nationality", "province", "city", "county", "nation", "politics", "break_faith",
  434. "phone", "email", "highest_degree", "graduate_school", "major", "study_abroad", "position", "cur_entry_time", "labor_contract_rangetime",
  435. "talent_arrange", "talent_condition", "identifyConditionName", "identifyGetTime",
  436. "bank", "bank_branch_name", "bank_account", "experience", "education"];
  437. $no_empty = array_filter($no_empty);
  438. $return = [];
  439. foreach ($no_empty as $key) {
  440. if (!$info[$key]) {
  441. $return[] = sprintf("请填写“%s”", $field_dict[$key]);
  442. }
  443. }
  444. if (count($return) > 0) {
  445. return json(["msg" => implode("<br>", $return)]);
  446. }
  447. $where = [];
  448. $where[] = ["project", "=", 1];
  449. $where[] = ["type", "=", $this->user["type"]];
  450. $where[] = ["must", "=", 1];
  451. $where[] = ["active", "=", 1];
  452. $where[] = ["delete", "=", 0];
  453. $filetypes = Db::table("new_common_filetype")->where($where)->select()->toArray();
  454. $ft_ids = array_column($filetypes, "id");
  455. $whr = [];
  456. $whr[] = ["typeId", "in", $ft_ids];
  457. $whr[] = ["mainId", "=", $id];
  458. $distinct_filetypes = Db::table("new_talent_file")->where($whr)->distinct(true)->field("typeId")->select();
  459. $upload_type_counts = count($distinct_filetypes);
  460. if ($upload_type_counts != count($ft_ids)) {
  461. return json(["msg" => "请留意附件上传栏中带*号的内容均为必传项,请上传完整再提交审核"]);
  462. }
  463. return $this->icSave($info, $this->request, TalentState::SCND_SUBMIT);
  464. } else if (in_array($checkState, [TalentState::BASE_VERIFY_FAIL, TalentState::BASE_REVERIFY_FAIL, TalentState::FST_VERIFY_FAIL, TalentState::REVERIFY_FAIL, TalentState::ZX_FAIL, TalentState::ANNOUNCED_REVERIFY_FAIL, TalentState::PUBLISH_FAIL])) {
  465. return json(["msg" => "审核失败,不能再提交审核", "code" => 500]);
  466. }
  467. return json(["msg" => "已提交审核,请耐心等待", "code" => 500]);
  468. }
  469. /**
  470. * 保存表单(旧第二步)
  471. * @param type $info talent_info
  472. * @param type $param request->param();
  473. */
  474. private function save($info, \think\Request $request, $checkState) {
  475. try {
  476. $batch = \app\common\api\BatchApi::getValidBatch(1, $this->user["type"]);
  477. if (!$batch) {
  478. throw new ValidateException("不在人才认定申报申请时间内");
  479. }
  480. $param = $request->param();
  481. validate(TalentInfo::class)->check($param);
  482. $data["apply_year"] = $batch["batch"];
  483. $all_valid_keys = ["applay_year", "import_way", "cur_entry_time", "position",
  484. "source", "source_batch", "fujian_highcert_pubtime", "fujian_highcert_exptime", "quanzhou_highcert_pubtime", "quanzhou_highcert_exptime", "source_city", "source_county",
  485. "talent_arrange", "talent_condition", "highest_degree", "graduate_school", "major", "professional", "bank", "bank_number", "bank_branch_name", "bank_account",
  486. "study_abroad", "abroad_school", "abroad_major", "phone", "email", "annual_salary", "pro_qua"];
  487. foreach ($all_valid_keys as $key) {
  488. $data[$key] = trim($param[$key]);
  489. }
  490. if ($data["study_abroad"] == 1) {
  491. $data["abroad_school"] = $param["abroad_school"];
  492. $data["abroad_major"] = $param["abroad_major"];
  493. } else {
  494. $data["abroad_school"] = null;
  495. $data["abroad_major"] = null;
  496. }
  497. switch ($data["source"]) {
  498. case 1:
  499. $data["source_batch"] = $param["source_batch"];
  500. $data["fujian_highcert_pubtime"] = $param["fujian_highcert_pubtime"];
  501. $data["fujian_highcert_exptime"] = $param["fujian_highcert_exptime"];
  502. $data["source_city"] = null;
  503. break;
  504. case 2:
  505. $data["source_batch"] = $param["source_batch"];
  506. $data["quanzhou_highcert_pubtime"] = $param["quanzhou_highcert_pubtime"];
  507. $data["quanzhou_highcert_exptime"] = $param["quanzhou_highcert_exptime"];
  508. $data["source_county"] = null;
  509. break;
  510. case 3:
  511. $data["source_batch"] = $param["source_batch"];
  512. $data["fujian_highcert_pubtime"] = $param["fujian_highcert_pubtime"];
  513. $data["fujian_highcert_exptime"] = $param["fujian_highcert_exptime"];
  514. $data["source_city"] = $param["source_city"];
  515. break;
  516. case 4:
  517. $data["source_batch"] = $param["source_batch"];
  518. $data["quanzhou_highcert_pubtime"] = $param["quanzhou_highcert_pubtime"];
  519. $data["quanzhou_highcert_exptime"] = $param["quanzhou_highcert_exptime"];
  520. $data["source_county"] = $param["source_county"];
  521. break;
  522. }
  523. $condition_info = Db::table("new_talent_condition")->findOrEmpty($param["talent_condition"]);
  524. if ($condition_info["isSalary"] == 1) {
  525. $data["annual_salary"] = $param["annual_salary"];
  526. } else {
  527. $data["annual_salary"] = null;
  528. }
  529. if ($info["real_state"] == TalentState::FST_VERIFY_REJECT) {
  530. //真实状态8是驳回,需要判断什么字段可以提交
  531. $modify_fields = array_filter(explode(",", $info["modify_fields"]));
  532. $tmp_data = $data;
  533. $data = [];
  534. foreach ($modify_fields as $field) {
  535. $data[$field] = $tmp_data[$field];
  536. }
  537. }
  538. $data["checkState"] = $checkState;
  539. $data["id"] = $info["id"];
  540. $success_msg = "提交成功";
  541. $error_msg = "提交失败";
  542. if ($checkState == TalentState::SCND_SAVE) {
  543. $last_log = TalentLogApi::getLastLog($data["id"], 1);
  544. if ($last_log["new_state"] != TalentState::SCND_SAVE) {
  545. TalentLogApi::write(1, $data["id"], $checkState, "保存认定材料未提交", 1);
  546. }
  547. TalentModel::update($data);
  548. } else if ($checkState == TalentState::SCND_SUBMIT) {
  549. $success_msg = "提交成功";
  550. $error_msg = "提交失败";
  551. $data["new_submit_time"] = date("Y-m-d H:i:s");
  552. TalentModel::update($data);
  553. TalentLogApi::write(1, $info["id"], $checkState, "确认提交审核", 1);
  554. } else {
  555. throw new ValidateException($error_msg);
  556. }
  557. $res = ["code" => 200, "msg" => $success_msg, "obj" => ["id" => $info["id"], "checkState" => $checkState]];
  558. $callback = $checkState == TalentState::SCND_SAVE ? "infoCallback" : "submitCallback";
  559. echo sprintf("<script>parent.TalentInfoInfoDlg.{$callback}(%s);</script>", json_encode($res));
  560. exit();
  561. } catch (ValidateException $e) {
  562. $res = ["msg" => $e->getMessage()];
  563. $callback = $checkState == TalentState::SCND_SAVE ? "infoCallback" : "submitCallback";
  564. echo sprintf("<script>parent.TalentInfoInfoDlg.{$callback}(%s);</script>", json_encode($res));
  565. exit();
  566. }
  567. }
  568. /**
  569. * 保存表单(新:混合基础信息人才申报信息)
  570. * @param type $info talent_info
  571. * @param type $param request->param();
  572. */
  573. private function mixSave($info, \think\Request $request, $checkState) {
  574. try {
  575. $batch = \app\common\api\BatchApi::getValidBatch(1, $this->user["type"]);
  576. if (!$batch) {
  577. throw new ValidateException("不在人才认定申报申请时间内");
  578. }
  579. $param = $request->param();
  580. validate(TalentInfo::class)->check($param);
  581. $id = $param["id"];
  582. if ($id) {
  583. if (!$info || $info["id"] != $id || $info["enterprise_id"] != $this->user["uid"]) {
  584. throw new ValidateException("没有对应的人才认定申报信息");
  585. }
  586. }
  587. $files = $param["uploadFiles"];
  588. $data["headimgurl"] = $info["headimgurl"];
  589. if ($request->file()) {
  590. $headimg = $request->file("photo");
  591. $upload = new \app\common\api\UploadApi();
  592. $result = $upload->uploadOne($headimg, "image", "talent/photo");
  593. $file = imagecreatefromstring(file_get_contents("storage/" . $result->filepath));
  594. $width = imagesx($file);
  595. $height = imagesy($file);
  596. //免冠二寸照长宽413:579
  597. if ($width * 579 != $height * 413) {
  598. @unlink("storage/" . $result->filepath); //像素不符合,删除上传文件
  599. throw new ValidateException("近期免冠半身彩照(二寸)不符合二寸像素标准。*<span style='color:#ff0000;'>二寸像素标准[413*579]</span>");
  600. }
  601. if ($info && $info["headimgurl"]) {
  602. //如果新照片符合像素要求,则删除旧照片
  603. $old_head_url = "storage/" . $info["headimgurl"];
  604. if (file_exists($old_head_url))
  605. @unlink($old_head_url);
  606. }
  607. $data["headimgurl"] = $result->filepath;
  608. }
  609. if (!$data["headimgurl"] && $checkState == TalentState::SCND_SUBMIT)
  610. throw new ValidateException("请上传头像。*<span style='color:#ff0000;'>二寸像素标准[413*579]</span>");
  611. $where = [];
  612. $where[] = ["project", "=", 1];
  613. $where[] = ["type", "=", $this->user["type"]];
  614. $where[] = ["must", "=", 1];
  615. $where[] = ["active", "=", 1];
  616. $where[] = ["delete", "=", 0];
  617. $filetypes = Db::table("new_common_filetype")->where($where)->select()->toArray();
  618. $age = 0;
  619. if ($param["birthday"]) {
  620. $birthday = $param["birthday"];
  621. $birthdayYear = substr($birthday, 0, 4);
  622. $currentYear = date("Y");
  623. $age = $currentYear - $birthdayYear;
  624. }
  625. $ft_ids = [];
  626. $deletes = [];
  627. foreach ($filetypes as $ft) {
  628. if ($ft["option"]) {
  629. if ($ft["rel"] == "birthday") {
  630. if ($age < $ft["option"]) {
  631. $deletes[] = $ft["id"];
  632. continue;
  633. }
  634. } else {
  635. $selectVal = $param[$ft["rel"]];
  636. $conditions = array_filter(explode(",", $ft["option"]));
  637. if (!in_array($selectVal, $conditions)) {
  638. $deletes[] = $ft["id"];
  639. continue;
  640. }
  641. }
  642. }
  643. $ft_ids[] = $ft["id"];
  644. }
  645. $data["apply_year"] = $batch["batch"];
  646. $data["isMatchZhiren"] = $param["isMatchZhiren"] ?: 0;
  647. $all_valid_keys = ["talent_type", "name", "card_type", "card_number", "sex", "birthday", "nationality", "province", "city", "county", "nation", "politics", "experience", "education",
  648. "import_way", "cur_entry_time", "position",
  649. "source", "source_batch", "fujian_highcert_pubtime", "fujian_highcert_exptime", "quanzhou_highcert_pubtime", "quanzhou_highcert_exptime", "source_city", "source_county",
  650. "talent_arrange", "talent_condition", "highest_degree", "graduate_school", "major", "professional", "bank", "bank_number", "bank_branch_name", "bank_account",
  651. "study_abroad", "abroad_school", "abroad_major", "phone", "email", "annual_salary", "pro_qua"];
  652. foreach ($all_valid_keys as $key) {
  653. $data[$key] = trim($param[$key]);
  654. }
  655. if (in_array($data["talent_type"], [1, 2])) {
  656. $data["tax_insurance_month"] = $param["tax_insurance_month"];
  657. $data["labor_contract_rangetime"] = $param["labor_contract_rangetime"];
  658. $data["salary_pay_way"] = $param["salary_pay_way"];
  659. $data["salary_pay_month"] = $param["salary_pay_month"];
  660. $data["fst_work_time"] = $param["fst_work_time"];
  661. $data['pre_import_type'] = null;
  662. } else {
  663. $data["tax_insurance_month"] = null;
  664. $data["labor_contract_rangetime"] = null;
  665. $data["salary_pay_way"] = null;
  666. $data["salary_pay_month"] = null;
  667. $data["fst_work_time"] = null;
  668. $data['pre_import_type'] = $param["pre_import_type"];
  669. }
  670. if ($data["study_abroad"] == 1) {
  671. $data["abroad_school"] = $param["abroad_school"];
  672. $data["abroad_major"] = $param["abroad_major"];
  673. } else {
  674. $data["abroad_school"] = null;
  675. $data["abroad_major"] = null;
  676. }
  677. switch ($data["source"]) {
  678. case 1:
  679. $data["source_batch"] = $param["source_batch"];
  680. $data["fujian_highcert_pubtime"] = $param["fujian_highcert_pubtime"];
  681. $data["fujian_highcert_exptime"] = $param["fujian_highcert_exptime"];
  682. $data["source_city"] = null;
  683. break;
  684. case 2:
  685. $data["source_batch"] = $param["source_batch"];
  686. $data["quanzhou_highcert_pubtime"] = $param["quanzhou_highcert_pubtime"];
  687. $data["quanzhou_highcert_exptime"] = $param["quanzhou_highcert_exptime"];
  688. $data["source_county"] = null;
  689. break;
  690. case 3:
  691. $data["source_batch"] = $param["source_batch"];
  692. $data["fujian_highcert_pubtime"] = $param["fujian_highcert_pubtime"];
  693. $data["fujian_highcert_exptime"] = $param["fujian_highcert_exptime"];
  694. $data["source_city"] = $param["source_city"];
  695. break;
  696. case 4:
  697. $data["source_batch"] = $param["source_batch"];
  698. $data["quanzhou_highcert_pubtime"] = $param["quanzhou_highcert_pubtime"];
  699. $data["quanzhou_highcert_exptime"] = $param["quanzhou_highcert_exptime"];
  700. $data["source_county"] = $param["source_county"];
  701. break;
  702. }
  703. $condition_info = Db::table("new_talent_condition")->findOrEmpty($param["talent_condition"]);
  704. if ($condition_info["isSalary"] == 1) {
  705. $data["annual_salary"] = $param["annual_salary"];
  706. } else {
  707. $data["annual_salary"] = null;
  708. }
  709. if ($info["real_state"] == TalentState::FST_VERIFY_REJECT) {
  710. //真实状态11是驳回,需要判断什么字段可以提交
  711. $modify_fields = array_filter(explode(",", $info["modify_fields"]));
  712. $tmp_data = $data;
  713. $data = [];
  714. foreach ($modify_fields as $field) {
  715. $data[$field] = $tmp_data[$field];
  716. }
  717. }
  718. $data["checkState"] = $checkState;
  719. $data["id"] = $id;
  720. $success_msg = "提交成功";
  721. $error_msg = "提交失败";
  722. if ($checkState == TalentState::SCND_SAVE) {
  723. $success_msg = "保存成功";
  724. if ($data["id"]) {
  725. //编辑
  726. TalentModel::update($data);
  727. $last_log = TalentLogApi::getLastLog($data["id"], 1);
  728. if ($last_log["new_state"] != TalentState::SCND_SAVE) {
  729. TalentLogApi::write(1, $data["id"], $checkState, "保存未提交", 1);
  730. } else {
  731. TalentLogApi::setActive($last_log["id"], 1); //更新修改时间
  732. }
  733. } else {
  734. //新增
  735. $data["enterprise_id"] = $this->user["uid"];
  736. $id = TalentModel::insertGetId($data);
  737. TalentLogApi::write(1, $id, $checkState, "保存未提交", 1);
  738. $whr = [];
  739. $whr[] = ["fileId", "in", $files];
  740. $upd_checklog["mainId"] = $id;
  741. Db::table("new_talent_checklog")->where($whr)->save($upd_checklog);
  742. }
  743. } else if ($checkState == TalentState::SCND_SUBMIT) {
  744. if (!$info["first_submit_time"]) {
  745. $data["first_submit_time"] = date("Y-m-d H:i:s");
  746. } else {
  747. $data["new_submit_time"] = date("Y-m-d H:i:s");
  748. }
  749. if ($data["id"]) {
  750. TalentModel::update($data);
  751. } else {
  752. //新增
  753. $data["enterprise_id"] = $this->user["uid"];
  754. $id = TalentModel::insertGetId($data);
  755. $whr = [];
  756. $whr[] = ["fileId", "in", $files];
  757. $upd_checklog["mainId"] = $id;
  758. Db::table("new_talent_checklog")->where($whr)->save($upd_checklog);
  759. }
  760. TalentLogApi::write(1, $id, $checkState, "确认提交审核", 1);
  761. } else {
  762. throw new ValidateException($error_msg);
  763. }
  764. if ($id) {
  765. if ($deletes) {
  766. //删除多余的附件,一般是选择人才类型留下来的
  767. $whr = [];
  768. $whr[] = ["typeId", "in", $deletes];
  769. $whr[] = ["id", "in", $files];
  770. $_wait_del_files = Db::table("new_talent_file")->where($whr)->select()->toArray();
  771. $_logfileIds[] = [];
  772. foreach ($_wait_del_files as $_del_file) {
  773. $_logfileIds[] = $_del_file["id"];
  774. @unlink("storage/" . $_del_file["url"]);
  775. }
  776. Db::table("new_talent_file")->where($whr)->delete();
  777. if ($_logfileIds) {
  778. $whr = [];
  779. $whr[] = ["fileId", "in", $_logfileIds];
  780. $_upd_checklog["description"] = "删除附件";
  781. $_upd_checklog["updateUser"] = sprintf("%s(%s)", $this->user["account"], $this->user["companyName"] ?: $this->user["rolename"]);
  782. $_upd_checklog["updateTime"] = date("Y-m-d H:i:s");
  783. Db::table("new_talent_checklog")->where($whr)->save($_upd_checklog);
  784. }
  785. }
  786. $whr = [];
  787. $whr[] = ["id", "in", $files];
  788. Db::table("new_talent_file")->where($whr)->save(["mainId" => $id]);
  789. $res = ["code" => 200, "msg" => $success_msg, "obj" => ["id" => $id, "checkState" => $checkState]];
  790. $callback = $checkState == TalentState::SCND_SAVE ? "infoCallback" : "submitCallback";
  791. echo sprintf("<script>parent.TalentInfoInfoDlg.{$callback}(%s);</script>", json_encode($res));
  792. exit();
  793. } else {
  794. throw new ValidateException($error_msg);
  795. }
  796. } catch (ValidateException $e) {
  797. $res = ["msg" => $e->getMessage()];
  798. $callback = $checkState == TalentState::SCND_SAVE ? "infoCallback" : "submitCallback";
  799. echo sprintf("<script>parent.TalentInfoInfoDlg.{$callback}(%s);</script>", json_encode($res));
  800. exit();
  801. }
  802. }
  803. private function icSave($info, \think\Request $request, $checkState) {
  804. try {
  805. $batch = \app\common\api\BatchApi::getValidBatch(1, $this->user["type"]);
  806. if (!$batch) {
  807. throw new ValidateException("不在人才认定申报申请时间内");
  808. }
  809. $param = $request->param();
  810. validate(TalentInfo::class)->check($param);
  811. $id = $param["id"];
  812. if ($id) {
  813. if (!$info || $info["id"] != $id || $info["enterprise_id"] != $this->user["uid"]) {
  814. throw new ValidateException("没有对应的人才认定申报信息");
  815. }
  816. }
  817. $files = $param["uploadFiles"];
  818. $data["headimgurl"] = $info["headimgurl"];
  819. if ($request->file()) {
  820. $headimg = $request->file("photo");
  821. $upload = new \app\common\api\UploadApi();
  822. $result = $upload->uploadOne($headimg, "image", "talent/photo");
  823. $file = imagecreatefromstring(file_get_contents("storage/" . $result->filepath));
  824. $width = imagesx($file);
  825. $height = imagesy($file);
  826. //免冠二寸照长宽413:579
  827. if ($width * 579 != $height * 413) {
  828. @unlink("storage/" . $result->filepath); //像素不符合,删除上传文件
  829. throw new ValidateException("近期免冠半身彩照(二寸)不符合二寸像素标准。*<span style='color:#ff0000;'>二寸像素标准[413*579]</span>");
  830. }
  831. if ($info && $info["headimgurl"]) {
  832. //如果新照片符合像素要求,则删除旧照片
  833. $old_head_url = "storage/" . $info["headimgurl"];
  834. if (file_exists($old_head_url))
  835. @unlink($old_head_url);
  836. }
  837. $data["headimgurl"] = $result->filepath;
  838. }
  839. if (!$data["headimgurl"] && $checkState == TalentState::SCND_SUBMIT)
  840. throw new ValidateException("请上传头像。*<span style='color:#ff0000;'>二寸像素标准[413*579]</span>");
  841. $data["apply_year"] = $batch["batch"];
  842. $all_valid_keys = ["name", "card_type", "card_number", "sex", "birthday", "nationality", "province", "city", "county", "nation", "politics", "experience", "education", "break_faith",
  843. "phone", "email", "highest_degree", "graduate_school", "major", "study_abroad",
  844. "position", "cur_entry_time", "labor_contract_rangetime",
  845. "talent_arrange", "talent_condition", "identifyConditionName", "identifyGetTime", "title", "pro_qua",
  846. "bank", "bank_branch_name", "bank_account", "description"];
  847. foreach ($all_valid_keys as $key) {
  848. $value = trim($param[$key]);
  849. if ($value) {
  850. $data[$key] = $value;
  851. }
  852. }
  853. if ($info["real_state"] == TalentState::FST_VERIFY_REJECT) {
  854. //真实状态11是驳回,需要判断什么字段可以提交
  855. $modify_fields = array_filter(explode(",", $info["modify_fields"]));
  856. $tmp_data = $data;
  857. $data = [];
  858. foreach ($modify_fields as $field) {
  859. $data[$field] = $tmp_data[$field];
  860. }
  861. }
  862. $data["checkState"] = $checkState;
  863. $data["id"] = $id;
  864. $success_msg = "提交成功";
  865. $error_msg = "提交失败";
  866. if ($checkState == TalentState::SCND_SAVE) {
  867. $success_msg = "保存成功";
  868. if ($data["id"]) {
  869. //编辑
  870. TalentModel::update($data);
  871. $last_log = TalentLogApi::getLastLog($data["id"], 1);
  872. if ($last_log["new_state"] != TalentState::SCND_SAVE) {
  873. TalentLogApi::write(1, $data["id"], $checkState, "保存未提交", 1);
  874. } else {
  875. TalentLogApi::setActive($last_log["id"], 1); //更新修改时间
  876. }
  877. } else {
  878. //新增
  879. $data["enterprise_id"] = $this->user["uid"];
  880. $id = TalentModel::insertGetId($data);
  881. TalentLogApi::write(1, $id, $checkState, "保存未提交", 1);
  882. $whr = [];
  883. $whr[] = ["fileId", "in", $files];
  884. $upd_checklog["mainId"] = $id;
  885. Db::table("new_talent_checklog")->where($whr)->save($upd_checklog);
  886. }
  887. $res = ["code" => 200, "msg" => $success_msg, "obj" => ["id" => $data["id"], "checkState" => $checkState]];
  888. echo sprintf("<script>parent.TalentInfoInfoDlg.infoCallback(%s);</script>", json_encode($res));
  889. exit();
  890. } else if ($checkState == TalentState::SCND_SUBMIT) {
  891. $data["new_submit_time"] = date("Y-m-d H:i:s");
  892. TalentModel::update($data);
  893. TalentLogApi::write(1, $data["id"], $checkState, "确认提交审核", 1);
  894. return json(["msg" => $success_msg, "code" => 200]);
  895. } else {
  896. throw new ValidateException($error_msg);
  897. }
  898. } catch (ValidateException $e) {
  899. if ($checkState == TalentState::SCND_SAVE) {
  900. $res = ["msg" => $e->getMessage()];
  901. echo sprintf("<script>parent.TalentInfoInfoDlg.infoCallback(%s);</script>", json_encode($res));
  902. exit();
  903. } else {
  904. return json(["msg" => $e->getMessage()], 500);
  905. }
  906. }
  907. }
  908. public function delete() {
  909. $id = $this->request->param("talentInfoId");
  910. $info = Talent::chkIsOwner($id, $this->user["uid"]);
  911. if (!$info) {
  912. return json(["msg" => "操作失败"]);
  913. }
  914. $checkState = $info["checkState"];
  915. if (in_array($checkState, [0, 1])) {
  916. $log = TalentLogApi::getLastLog($id, 1);
  917. if ($log["state"] > 1) {
  918. //有提交审核记录
  919. return json(["msg" => "该申报已提交审核,无法删除"]);
  920. }
  921. }
  922. $data["id"] = $id;
  923. $data["delete"] = 1;
  924. TalentModel::update($data);
  925. return json(["msg" => "删除成功"]);
  926. }
  927. public function mixDelete() {
  928. $id = $this->request->param("talentInfoId");
  929. $info = Talent::chkIsOwner($id, $this->user["uid"]);
  930. if (!$info) {
  931. return json(["msg" => "操作失败"]);
  932. }
  933. $checkState = $info["checkState"];
  934. if (in_array($checkState, [0, TalentState::SCND_SAVE])) {
  935. $log = TalentLogApi::getLastLog($id, 1);
  936. if ($log["state"] > 1) {
  937. //有提交审核记录
  938. return json(["msg" => "该申报已提交审核,无法删除"]);
  939. }
  940. }
  941. $data["id"] = $id;
  942. $data["delete"] = 1;
  943. TalentModel::update($data);
  944. return json(["msg" => "删除成功"]);
  945. }
  946. }