VerifyApi.php 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497
  1. <?php
  2. namespace app\common\api;
  3. use app\enterprise\model\Talent;
  4. use app\common\api\DictApi;
  5. use app\admin\model\Enterprise;
  6. use think\facade\Db;
  7. use app\common\model\TalentCondition;
  8. /**
  9. * Description of VerifyApi
  10. *
  11. * @author sgq
  12. */
  13. class VerifyApi {
  14. public static function getTalentInfoById($id) {
  15. $where = [];
  16. $where[] = ["id", "=", $id];
  17. $info = Talent::findOrEmpty($id)->toArray();
  18. if ($info) {
  19. if ($info["talent_type"]) {
  20. $info["talentTypeName"] = DictApi::selectByParentCode("talent_type")[$info["talent_type"]];
  21. }
  22. if ($info["nationality"]) {
  23. $info["nationalityName"] = DictApi::selectByParentCode("nationality")[$info["nationality"]];
  24. }
  25. if ($info["nation"]) {
  26. $info["nationName"] = DictApi::selectByParentCode("nation")[$info["nation"]];
  27. }
  28. if ($info["politics"]) {
  29. $info["politicsName"] = DictApi::selectByParentCode("politics")[$info["politics"]];
  30. }
  31. if ($info["province"]) {
  32. $info["provinceName"] = Db::table("un_common_location")->where("code", "=", $info["province"])->findOrEmpty()["name"];
  33. }
  34. if ($info["city"]) {
  35. $info["cityName"] = Db::table("un_common_location")->where("code", "=", $info["city"])->findOrEmpty()["name"];
  36. }
  37. if ($info["county"]) {
  38. $info["countyName"] = Db::table("un_common_location")->where("code", "=", $info["county"])->findOrEmpty()["name"];
  39. }
  40. $enterprise = Enterprise::findOrEmpty($info["enterprise_id"])->toArray();
  41. $info["enterpriseName"] = $enterprise["name"];
  42. $info["enterpriseTag"] = $enterprise["enterpriseTag"];
  43. if ($enterprise["street"]) {
  44. $info["street"] = $enterprise["street"];
  45. $info["streetName"] = DictApi::selectByParentCode("street")[$enterprise["street"]];
  46. }
  47. if ($enterprise["industryFieldNew"]) {
  48. $info["industryFieldName"] = DictApi::selectByParentCode("industry_field")[$enterprise["industryFieldNew"]];
  49. }
  50. if ($enterprise["enterpriseTag"]) {
  51. $info["enterpriseTagName"] = DictApi::selectByParentCode("enterprise_tag")[$enterprise["enterpriseTag"]];
  52. }
  53. if ($info["headimgurl"]) {
  54. $info["headimgurl"] = "/storage/" . $info["headimgurl"];
  55. }
  56. if ($info["talent_arrange"]) {
  57. $info["talentArrangeName"] = DictApi::selectByParentCode("talent_arrange")[$info["talent_arrange"]];
  58. }
  59. if ($info["import_way"]) {
  60. $info["importWayName"] = DictApi::selectByParentCode("import_way")[$info["import_way"]];
  61. }
  62. if ($info["source"]) {
  63. $info["sourceName"] = DictApi::selectByParentCode("source")[$info["source"]];
  64. }
  65. if ($info["source_city"]) {
  66. $info["sourceCityName"] = Db::table("un_common_location")->where("code", "=", $info["source_city"])->findOrEmpty()["name"];
  67. }
  68. if ($info["source_county"]) {
  69. $info["sourceCountyName"] = Db::table("un_common_location")->where("code", "=", $info["source_county"])->findOrEmpty()["name"];
  70. }
  71. if ($info["highest_degree"]) {
  72. $info["highestDegreeName"] = DictApi::selectByParentCode("highest_degree")[$info["highest_degree"]];
  73. }
  74. if ($info["talent_condition"]) {
  75. $talent_condition = \app\common\model\TalentCondition::findOrEmpty($info["talent_condition"]);
  76. $info["talentConditionName"] = $talent_condition["name"];
  77. $info["talent_arrange_category"] = $talent_condition["talentLevelCat"];
  78. $info["talentArrangeCatName"] = DictApi::selectByParentCode("talent_condition_cats")[$talent_condition["talentLevelCat"]];
  79. }
  80. }
  81. return $info;
  82. }
  83. public static function getOne($id) {
  84. return Talent::findOrEmpty($id);
  85. }
  86. public static function getDeptList($params, $where = []) {
  87. $order = $params["order"] ?: "desc";
  88. $offset = $params["offset"] ?: 0;
  89. $limit = $params["limit"] ?: 10;
  90. $companyId = session("user")["companyId"];
  91. $enterprise_tag_kvs = DictApi::selectByParentCode("enterprise_tag");
  92. $count = Talent::alias("ti")
  93. ->leftJoin("new_talent_condition tc", "tc.id=ti.talent_condition")
  94. ->leftJoin("new_enterprise e", "e.id=ti.enterprise_id")
  95. ->where($where)
  96. ->whereRaw("find_in_set(:companyId,companyIds)", ["companyId" => $companyId])->count();
  97. $list = Talent::alias("ti")
  98. ->leftJoin("new_talent_condition tc", "tc.id=ti.talent_condition")
  99. ->leftJoin("new_enterprise e", "e.id=ti.enterprise_id")
  100. ->where($where)
  101. ->whereRaw("find_in_set(:companyId,companyIds)", ["companyId" => $companyId])
  102. ->field("ti.*,e.name as enterprise_name,e.type as enterprise_type,enterpriseTag")
  103. ->limit($offset, $limit)->order("ti.createTime " . $order)
  104. ->select()->toArray();
  105. foreach ($list as &$item) {
  106. $item["talent_type"] = $item["enterprise_type"] == 1 ? "晋江优秀人才" : "集成电路优秀人才";
  107. $item["enterprise_tag"] = $enterprise_tag_kvs[$item["enterpriseTag"]];
  108. }unset($item);
  109. return ["total" => $count, "rows" => $list];
  110. }
  111. public static function getPublicList($params) {
  112. $order = $params["order"];
  113. $offset = $params["offset"];
  114. $limit = $params["limit"];
  115. $where = [];
  116. if ($params["name"]) {
  117. $where[] = ["ti.name", "like", "%" . $params["name"] . "%"];
  118. }
  119. if ($params["sex"]) {
  120. $where[] = ["ti.sex", "=", $params["sex"]];
  121. }
  122. if ($params["checkState"]) {
  123. $where[] = ["ti.checkState", "=", $params["checkState"]];
  124. }
  125. $type = $params["type"];
  126. switch ($type) {
  127. case 1:
  128. case 2:
  129. $where[] = ["ti.checkState", "=", TalentState::REVERIFY_PASS];
  130. break;
  131. case 3: //公示
  132. case 7: //公示预览
  133. $where[] = ["ti.checkState", "=", TalentState::ZX_PASS];
  134. break;
  135. case 4: //公示通过
  136. $where[] = ["ti.checkState", "=", TalentState::ANNOUNCED];
  137. break;
  138. case 5:
  139. case 8: //公布预览
  140. $where[] = ["ti.checkState", "=", TalentState::ANNOUNCED_REVERIFY_PASS];
  141. break;
  142. case 6:
  143. $where[] = ["ti.checkState", "=", TalentState::PUBLISH_PASS];
  144. break;
  145. }
  146. $enterprise_tag_kvs = DictApi::selectByParentCode("enterprise_tag");
  147. $count = Talent::alias("ti")->leftJoin("new_enterprise e", "e.id=ti.enterprise_id")->where($where)->count();
  148. $list = Talent::alias("ti")->leftJoin("new_enterprise e", "e.id=ti.enterprise_id")
  149. ->where($where)
  150. ->limit($offset, $limit)
  151. ->order("ti.createTime " . $order)->field("ti.*,e.name as enterpriseName,e.type as enterprise_type,enterpriseTag")->select()->toArray();
  152. foreach ($list as &$item) {
  153. $item["talent_type"] = $item["enterprise_type"] == 1 ? "晋江优秀人才" : "集成电路优秀人才";
  154. $item["enterprise_tag"] = $enterprise_tag_kvs[$item["enterpriseTag"]];
  155. }unset($item);
  156. return ["total" => $count, "rows" => $list];
  157. }
  158. public static function getListByIds($ids) {
  159. $where[] = ["id", "in", $ids];
  160. return Talent::where($where)->select()->toArray();
  161. }
  162. public static function getList($params) {
  163. $where = [];
  164. $order = $params["order"] ?: "desc";
  165. $offset = $params["offset"] ?: 0;
  166. $limit = $params["limit"] ?: 10;
  167. unset($params["order"]);
  168. unset($params["limit"]);
  169. unset($params["offset"]);
  170. if ($params["name"]) {
  171. $where[] = ["ti.name", "like", "%{$params["name"]}%"];
  172. }
  173. if ($params["card_number"]) {
  174. $where[] = ["ti.card_number", "like", "%" . $params["card_number"] . "%"];
  175. }
  176. if ($params["sex"]) {
  177. $where[] = ["ti.sex", "=", $params["sex"]];
  178. }
  179. if ($params["nation"]) {
  180. $where[] = ["ti.nation", "=", $params["nation"]];
  181. }
  182. if ($params["apply_year"]) {
  183. $where[] = ["ti.apply_year", "like", "{$params["apply_year"]}%"];
  184. }
  185. if ($params["phone"]) {
  186. $where[] = ["ti.phone", "like", "%{$params["phone"]}%"];
  187. }
  188. if ($params["email"]) {
  189. $where[] = ["ti.email", "like", "%{$params["email"]}%"];
  190. }
  191. if ($params["nationality"]) {
  192. $where[] = ["ti.nationality", "=", $params["nationality"]];
  193. }
  194. if ($params["province"]) {
  195. $where[] = ["ti.province", "=", $params["province"]];
  196. }
  197. if ($params["politics"]) {
  198. $where[] = ["ti.politics", "=", $params["politics"]];
  199. }
  200. if ($params["enterprise_id"]) {
  201. $where[] = ["ti.enterprise_id", "=", $params["enterprise_id"]];
  202. }
  203. if ($params["street"]) {
  204. $where[] = ["e.street", "=", $params["street"]];
  205. }
  206. if ($params["industry_field"]) {
  207. $where[] = ["e.industryFieldNew", "=", $params["industry_field"]];
  208. }
  209. if ($params["talent_type"]) {
  210. $where[] = ["ti.talent_type", "=", $params["talent_type"]];
  211. }
  212. if ($params["import_way"]) {
  213. $where[] = ["ti.import_way", "=", $params["import_way"]];
  214. }
  215. if ($params["highest_degree"]) {
  216. $where[] = ["ti.highest_degree", "=", $params["highest_degree"]];
  217. }
  218. if ($params["study_abroad"]) {
  219. $where[] = ["ti.study_abroad", "=", $params["study_abroad"]];
  220. }
  221. if ($params["source"]) {
  222. $where[] = ["ti.source", "=", $params["source"]];
  223. }
  224. if ($params["talent_arrange"]) {
  225. $where[] = ["ti.talent_arrange", "=", $params["talent_arrange"]];
  226. }
  227. $process = $params["process"];
  228. if ($process == 3) {
  229. switch ($params["checkState"]) {
  230. default:
  231. $where[] = ["ti.checkState", "=", 7];
  232. $where[] = ["ti.pass_dept_check", "=", 0];
  233. break;
  234. }
  235. return self::getDeptList($params, $where);
  236. }
  237. if ($process == 4) {
  238. $whereRaw = sprintf("(ti.checkState in (11,12,13)) or (ti.checkState=9 and ti.pass_dept_check=0) or (ti.checkState=7 and ti.pass_dept_check=1) or (ti.checkState=7 and (tc.companyIds is null or tc.companyIds = ''))");
  239. switch ($params["checkState"]) {
  240. case 1:
  241. $where[] = ["ti.checkState", "in", [7, 9]];
  242. break;
  243. case -1:
  244. $where[] = ["ti.checkState", "=", 13];
  245. break;
  246. }
  247. $count = Talent::alias("ti")
  248. ->leftJoin("new_enterprise e", "e.id=ti.enterprise_id")
  249. ->leftJoin("new_talent_condition tc", "tc.id=ti.talent_condition")
  250. ->leftJoin("new_talent_checklog tl", "tl.mainId=ti.id and tl.id=(select id from new_talent_checklog where mainId=ti.id and `step` is null and active=1 and typeFileId is null order by createTime desc limit 1)")
  251. ->whereRaw($whereRaw)->where($where)->count();
  252. $list = Talent::alias("ti")
  253. ->leftJoin("new_enterprise e", "e.id=ti.enterprise_id")
  254. ->leftJoin("new_talent_condition tc", "tc.id=ti.talent_condition")
  255. ->leftJoin("new_talent_checklog tl", "tl.mainId=ti.id and tl.id=(select id from new_talent_checklog where mainId=ti.id and `step` is null and active=1 and typeFileId is null order by createTime desc limit 1)")
  256. ->whereRaw($whereRaw)
  257. ->where($where)
  258. ->limit($offset, $limit)
  259. ->order("ti.createTime " . $order)
  260. ->field("ti.*,tl.last_state as 'lastState',tl.state as 'realState',e.name as enterprise_name,e.type as enterprise_type,enterpriseTag")
  261. ->select()->toArray();
  262. } else {
  263. switch ($process) {
  264. case 1:
  265. $where[] = ["ti.checkState", "in", [2, -1]];
  266. break;
  267. case 2:
  268. switch ($params["checkState"]) {
  269. case 1://待审核
  270. $where[] = ["ti.checkState", "=", 6];
  271. $where[] = ["tl.state", "=", 6];
  272. break;
  273. case 2://驳回
  274. $where[] = ["ti.checkState", "=", 6];
  275. $where[] = ["tl.state", "in", [10, 12]];
  276. break;
  277. default:
  278. $where[] = ["ti.checkState", "in", [6, -2]];
  279. }
  280. break;
  281. case 5:
  282. if ($params["checkState"]) {
  283. $where[] = ["ti.checkState", "=", $params["checkState"]];
  284. }
  285. break;
  286. }
  287. $count = Talent::alias("ti")
  288. ->leftJoin("new_enterprise e", "e.id=ti.enterprise_id")
  289. ->leftJoin("new_talent_checklog tl", "tl.mainId=ti.id and tl.id=(select id from new_talent_checklog where mainId=ti.id and `step` is null and active=1 and typeFileId is null order by createTime desc limit 1)")
  290. ->where($where)->count();
  291. $list = Talent::alias("ti")
  292. ->leftJoin("new_enterprise e", "e.id=ti.enterprise_id")
  293. ->leftJoin("new_talent_checklog tl", "tl.mainId=ti.id and tl.id=(select id from new_talent_checklog where mainId=ti.id and `step` is null and active=1 and typeFileId is null order by createTime desc limit 1)")
  294. ->where($where)->limit($offset, $limit)->order("ti.createTime " . $order)->field("ti.*,tl.last_state as 'lastState',tl.state as 'realState',e.name as enterprise_name,e.type as enterprise_type,enterpriseTag")->select()->toArray();
  295. }
  296. $talent_arrange_kvs = DictApi::selectByParentCode("talent_arrange");
  297. $enterprise_tag_kvs = DictApi::selectByParentCode("enterprise_tag");
  298. foreach ($list as &$item) {
  299. $item["talent_type"] = $item["enterprise_type"] == 1 ? "晋江优秀人才" : "集成电路优秀人才";
  300. $item["enterprise_tag"] = $enterprise_tag_kvs[$item["enterpriseTag"]];
  301. $item["talentArrangeName"] = $talent_arrange_kvs[$item["talent_arrange"]];
  302. $item["talentConditionName"] = TalentCondition::findOrEmpty($item["talent_condition"])["name"];
  303. //$last_log = TalentLogApi::getLastLog($item["id"], 1, 0, ["step", "=", null]);
  304. //$item["lastState"] = $last_log["last_state"];
  305. //$item["realState"] = $last_log["state"];
  306. }unset($item);
  307. return ["total" => $count, "rows" => $list];
  308. }
  309. public static function getExportDatas($process, $params) {
  310. $where[] = [];
  311. //特殊字段处理
  312. $fields = [];
  313. foreach ($params as $param) {
  314. if (!in_array($param, ["industryFieldNew", "enterpriseName", "enterpriseTag", "street", "talent_arrange_category", "checkMsg"])) {
  315. $fields[] = "ti." . $param;
  316. }
  317. }
  318. $fields[] = "e.name as enterpriseName";
  319. $fields[] = "e.industryFieldNew";
  320. $fields[] = "e.enterpriseTag";
  321. $fields[] = "e.street";
  322. $fields[] = "tc.talentLevelCat";
  323. $fields[] = "tl.description as checkMsg";
  324. $fields[] = "tc.name as talentConditionName";
  325. $fields[] = "tl.description as checkMsg";
  326. if (in_array("card_type", $params)) {
  327. $cardTypes = DictApi::selectByParentCode("card_type");
  328. }
  329. if (in_array("industryFieldNew", $params)) {
  330. $industry_fields = DictApi::selectByParentCode("industry_field");
  331. }
  332. if (in_array("enterpriseTag", $params)) {
  333. $enterpriseTags = DictApi::selectByParentCode("enterprise_tag");
  334. }
  335. if (in_array("street", $params)) {
  336. $streets = DictApi::selectByParentCode("street");
  337. }
  338. if (in_array("nation", $params)) {
  339. $nations = DictApi::selectByParentCode("nation");
  340. }
  341. if (in_array("nationality", $params)) {
  342. $nationalitys = DictApi::selectByParentCode("nationality");
  343. }
  344. if (in_array("politics", $params)) {
  345. $politics = DictApi::selectByParentCode("politics");
  346. }
  347. if (in_array("talent_type", $params)) {
  348. $talentTypes = DictApi::selectByParentCode("talent_type");
  349. }
  350. if (in_array("talent_arrange_category", $params)) {
  351. $talentArrangeCategories = DictApi::selectByParentCode("talent_condition_cats");
  352. }
  353. if (in_array("highest_degree", $params)) {
  354. $highest_degree = DictApi::selectByParentCode("highest_degree");
  355. }
  356. if (in_array("import_way", $params)) {
  357. $import_way = DictApi::selectByParentCode("import_way");
  358. }
  359. if (in_array("source", $params)) {
  360. $source = DictApi::selectByParentCode("source");
  361. }
  362. if (in_array("source_city", $params)) {
  363. $source_city = DictApi::selectByParentCode("source_city");
  364. }
  365. if (in_array("source_county", $params)) {
  366. $source_county = DictApi::selectByParentCode("source_county");
  367. }
  368. if (in_array("talent_arrange", $params)) {
  369. $talent_arrange = DictApi::selectByParentCode("talent_arrange");
  370. }
  371. $sex = [1 => "男", 2 => "女"];
  372. $pre_import_type = [1 => "意向合同", 2 => "创业企业名称预核准"];
  373. $study_abroad = [1 => "是", 2 => "否"];
  374. $where = [];
  375. switch ($process) {
  376. case 1:
  377. $where = "ti.checkState in (2,-1)";
  378. break;
  379. case 2:
  380. $where = "ti.checkState in (6,-2)";
  381. break;
  382. case 3:
  383. $companyId = session("user")["companyId"];
  384. $where = "ti.checkState = 7 and ti.pass_dept_check=0 and find_in_set({$companyId},tc.companyIds)";
  385. break;
  386. case 4:
  387. $where = sprintf("(ti.checkState in (11,12,13)) or (ti.checkState=9 and ti.pass_dept_check=0) or (ti.checkState=7 and ti.pass_dept_check=1) or (ti.checkState=7 and (tc.companyIds is null or tc.companyIds = ''))");
  388. break;
  389. case 5:
  390. $where = "ti.checkState >= 11";
  391. break;
  392. }
  393. $list = Talent::alias("ti")
  394. ->field($fields)
  395. ->leftJoin("new_enterprise e", "e.id=ti.enterprise_id")
  396. ->leftJoin("new_talent_condition tc", "tc.id=ti.talent_condition")
  397. ->leftJoin("new_talent_checklog tl", "tl.mainId=ti.id and tl.id=(select id from new_talent_checklog where mainId=ti.id and `step` is null and active=1 and typeFileId is null order by createTime desc limit 1)")
  398. ->whereRaw($where)
  399. ->select()->toArray();
  400. foreach ($list as &$item) {
  401. $item["card_type"] = $cardTypes[$item["card_type"]];
  402. $item["industryFieldNew"] = $industry_fields[$item["industryFieldNew"]];
  403. $item["enterpriseTag"] = $enterpriseTags[$item["enterpriseTag"]];
  404. $item["street"] = $streets[$item["street"]];
  405. $item["nation"] = $nations[$item["nation"]];
  406. $item["nationality"] = $nationalitys[$item["nationality"]];
  407. $item["politics"] = $politics[$item["politics"]];
  408. $item["talent_type"] = $talentTypes[$item["talent_type"]];
  409. $item["talent_arrange_category"] = $talentArrangeCategories[$item["talentLevelCat"]];
  410. $item["sex"] = $sex[$item["sex"]];
  411. $item["highest_degree"] = $highest_degree[$item["highest_degree"]];
  412. $item["import_way"] = $import_way[$item["import_way"]];
  413. $item["pre_import_type"] = $pre_import_type[$item["pre_import_type"]];
  414. $item["study_abroad"] = $study_abroad[$item["study_abroad"]];
  415. $item["source"] = $source[$item["source"]];
  416. $item["talent_arrange"] = $talent_arrange[$item["talent_arrange"]];
  417. $item["talent_condition"] = $item["talentConditionName"];
  418. if (in_array("source_city", $params)) {
  419. $item["source_city"] = Db::table("un_common_location")->where("code", "=", $item["source_city"])->findOrEmpty()["name"];
  420. }
  421. if (in_array("source_county", $params)) {
  422. $item["source_county"] = Db::table("un_common_location")->where("code", "=", $item["source_county"])->findOrEmpty()["name"];
  423. }
  424. if (in_array("province", $params)) {
  425. $item["province"] = Db::table("un_common_location")->where("code", "=", $item["province"])->findOrEmpty()["name"];
  426. }
  427. if (in_array("city", $params)) {
  428. $item["city"] = Db::table("un_common_location")->where("code", "=", $item["city"])->findOrEmpty()["name"];
  429. }
  430. if (in_array("county", $params)) {
  431. $item["county"] = Db::table("un_common_location")->where("code", "=", $item["county"])->findOrEmpty()["name"];
  432. }
  433. $item["checkState"] = TalentState::getStateName($item["checkState"]);
  434. }unset($item);
  435. return $list;
  436. }
  437. public static function getListByProcess($process) {
  438. switch ($process) {
  439. case 1:
  440. $where[] = ["ti.checkState", "in", [2, -1]];
  441. break;
  442. case 2:
  443. $where[] = ["ti.checkState", "in", [6, -2]];
  444. break;
  445. default:
  446. return null;
  447. }
  448. return Talent::alias("ti")->leftJoin("new_enterprise e", "e.id=ti.enterprise_id")->where($where)->field("ti.*,e.agentName,e.agentPhone")->select()->toArray();
  449. }
  450. public static function setPublic($mainId, $state, $msg, $batch = null, $type = 1) {
  451. $data["id"] = $mainId;
  452. $data["checkState"] = $state;
  453. switch ($state) {
  454. case TalentState::ZX_PASS:
  455. case TalentState::ZX_FAIL:
  456. $data["isPublic"] = 2;
  457. break;
  458. case TalentState::ANNOUNCED:
  459. $data["isPublic"] = 3;
  460. $data["publicBatch"] = $batch;
  461. break;
  462. case TalentState::ANNOUNCED_REVERIFY_PASS:
  463. case TalentState::ANNOUNCED_REVERIFY_FAIL:
  464. $data["isPublic"] = 3;
  465. break;
  466. case TalentState::PUBLISH_PASS:
  467. $data["isPublic"] = 4;
  468. $data["certificateGetTime"] = $batch;
  469. $data["certificateExpireTime"] = date("Y-m-d", strtotime(sprintf("%s +6 years", $batch)));
  470. break;
  471. case TalentState::PUBLISH_FAIL:
  472. $data["isPublic"] = 4;
  473. break;
  474. }
  475. if (Talent::update($data)) {
  476. TalentLogApi::write($type, $mainId, $state, $msg, 1);
  477. return true;
  478. }
  479. return false;
  480. }
  481. }