Talent.php 47 KB

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