Enterprise.php 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538
  1. <?php
  2. namespace app\admin\controller;
  3. use app\admin\common\AdminController;
  4. use app\common\api\ChuanglanSmsApi;
  5. use app\common\api\DictApi;
  6. use app\common\api\EnterpriseApi;
  7. use app\common\model\MessageRecord;
  8. use app\common\model\TalentChecklog;
  9. use app\common\api\TalentState;
  10. use app\common\api\CompanyApi;
  11. use think\facade\Db;
  12. class Enterprise extends AdminController {
  13. public function gotoEnterprisePage() {
  14. return view("", []);
  15. }
  16. public function findEnterpriseByPage() {
  17. $res = EnterpriseApi::getList($this->request);
  18. return json($res);
  19. }
  20. public function gotoEnterpriseDetailPage() {
  21. $id = trim($this->request['id']);
  22. $ep = EnterpriseApi::getOne($id);
  23. if (!$ep) {
  24. return "无此企业";
  25. }
  26. //--------设置 审核状态---------------------------------------------------
  27. switch ($ep['checkState']) {
  28. case 1:
  29. $ep['checkStateName'] = "待审核";
  30. break;
  31. case 2:
  32. $ep['checkStateName'] = "审核驳回";
  33. break;
  34. case 3:
  35. $ep['checkStateName'] = "审核通过";
  36. break;
  37. case 4:
  38. $ep['checkStateName'] = "重新提交";
  39. break;
  40. }
  41. //-------设置账号状态----------------------------------------------------
  42. switch ($ep['active']) {
  43. case 1:
  44. $ep['activeName'] = "账号有效";
  45. break;
  46. case 2:
  47. $ep['activeName'] = "冻结/拉黑";
  48. break;
  49. }
  50. //---------设置 街道-----------------------------------------------------
  51. if (\StrUtil::isNotEmpAndNull($ep['street'])) {
  52. $street_info = DictApi::findByParentCodeAndCode('street', $ep['street']);
  53. if ($street_info != null) {
  54. $ep['streetName'] = $street_info['name'];
  55. }
  56. }
  57. if (\StrUtil::isNotEmpAndNull($ep['agencyType'])) {
  58. $agencyType = DictApi::findByParentCodeAndCode('agency_type', $ep['agencyType']);
  59. $ep["agencyTypeName"] = $agencyType["name"];
  60. }
  61. //---------设置产业领域 --------------------------------------------------
  62. if (\StrUtil::isNotEmpAndNull($ep['industryFieldNew'])) {
  63. $industryFieldNew = DictApi::findByParentCodeAndCode('industry_field', $ep['industryFieldNew']);
  64. if ($industryFieldNew != null) {
  65. $ep['industryFieldNewName'] = $industryFieldNew['name'];
  66. }
  67. }
  68. //---------设置行业领域 --------------------------------------------------
  69. if (\StrUtil::isNotEmpAndNull($ep['industryFieldOld'])) {
  70. $industryFieldOld = DictApi::findByParentCodeAndCode($ep['industryFieldNew'] . "_field", $ep['industryFieldOld']);
  71. if ($industryFieldOld != null) {
  72. $ep['industryFieldOldName'] = $industryFieldOld['name'];
  73. }
  74. }
  75. //---------设置单位标签 --------------------------------------------------
  76. if (\StrUtil::isNotEmpAndNull($ep['enterpriseTag'])) {
  77. $enterpriseTag = DictApi::findByParentCodeAndCode("enterprise_tag", $ep['enterpriseTag']);
  78. if ($enterpriseTag != null) {
  79. $ep['enterpriseTagName'] = $enterpriseTag['name'];
  80. }
  81. }
  82. //---------设置机构标签 --------------------------------------------------
  83. if (\StrUtil::isNotEmpAndNull($ep['organizationTag'])) {
  84. $organizationTag = DictApi::findByParentCodeAndCode("organization_tag", $ep['organizationTag']);
  85. if ($organizationTag != null) {
  86. $ep['organizationTagName'] = $organizationTag['name'];
  87. }
  88. }
  89. //---------设置事业单位标签 --------------------------------------------------
  90. if (\StrUtil::isNotEmpAndNull($ep['institutionTag'])) {
  91. $institutionTag = DictApi::findByParentCodeAndCode("institution_tag", $ep['institutionTag']);
  92. if ($institutionTag != null) {
  93. $ep['institutionTagName'] = $institutionTag['name'];
  94. }
  95. }
  96. //---------设置单位类型 --------------------------------------------------
  97. if (\StrUtil::isNotEmpAndNull($ep['enterpriseType'])) {
  98. $enterpriseType = DictApi::findByParentCodeAndCode("enterprise_type", $ep['enterpriseType']);
  99. if ($enterpriseType != null) {
  100. $ep['enterpriseTypeName'] = $enterpriseType['name'];
  101. }
  102. }
  103. $imgurl_info = pathinfo($ep['imgurl']);
  104. if (in_array($imgurl_info['extension'], ["jpeg", "jpg", "png", "gif"])) {
  105. $ep['imgurl_is_img'] = 1;
  106. } else {
  107. $ep['imgurl_is_img'] = 0;
  108. }
  109. $bankImg_info = pathinfo($ep['bankImg']);
  110. if (in_array($bankImg_info['extension'], ["jpeg", "jpg", "png", "gif"])) {
  111. $ep['bankImg_is_img'] = 1;
  112. } else {
  113. $ep['bankImg_is_img'] = 0;
  114. }
  115. $domainImg_info = pathinfo($ep['domainImg']);
  116. if (in_array($domainImg_info['extension'], ["jpeg", "jpg", "png", "gif"])) {
  117. $ep['domainImg_is_img'] = 1;
  118. } else {
  119. $ep['domainImg_is_img'] = 0;
  120. }
  121. $typeImg_info = pathinfo($ep['typeImg']);
  122. if (in_array($typeImg_info['extension'], ["jpeg", "jpg", "png", "gif"])) {
  123. $ep['typeImg_is_img'] = 1;
  124. } else {
  125. $ep['typeImg_is_img'] = 0;
  126. }
  127. $beian_info = pathinfo($ep['beian']);
  128. if (in_array($beian_info['extension'], ["jpeg", "jpg", "png", "gif"])) {
  129. $ep['beian_is_img'] = 1;
  130. } else {
  131. $ep['beian_is_img'] = 0;
  132. }
  133. return view("", ['ep' => $ep]);
  134. }
  135. public function gotoExaminePage() {
  136. $id = trim($this->request['id']);
  137. $ep = EnterpriseApi::getOne($id);
  138. $lastLog = \app\common\api\TalentLogApi::getLastLog($id, 10);
  139. if ($lastLog["active"] == 0) {
  140. $ep["checkState"] = $lastLog["state"];
  141. $ep["checkMsg"] = $lastLog["description"];
  142. }
  143. if (!$ep) {
  144. return "无此企业";
  145. }
  146. //---------设置产业领域 --------------------------------------------------
  147. if (\StrUtil::isNotEmpAndNull($ep['industryFieldNew'])) {
  148. $industryFieldNew = DictApi::findByParentCodeAndCode('industry_field', $ep['industryFieldNew']);
  149. if ($industryFieldNew != null) {
  150. $ep['industryFieldNewName'] = $industryFieldNew['name'];
  151. }
  152. }
  153. if ($ep->special == 0) {
  154. $fields = ["name" => "企业名称", "idCard" => "统一社会信用代码", "legal" => "法人代表", "address" => "企业地址", "street" => "所属街道", "ephone" => "企业电话", "bankCard" => "企业银行账号", "bank" => "企业开户银行", "bankNetwork" => "企业开户银行网点",
  155. "agencyType" => "机构类型", "industryFieldNew" => "产业领域", "industryFieldOld" => "行业领域", "enterpriseTag" => "企业标签", "enterpriseType" => "企业类型",
  156. "agentName" => "人才联络员姓名", "agentPhone" => "人才联络员电话", "agentEmail" => "人才联络员邮箱"];
  157. $files = ["imgurl" => "企业营业执照", "bankImg" => "开户许可证/基本存款账户信息", "domainImg" => "行业领域佐证材料", "beian" => "人才联络员信息备案表", "typeImg" => "规上、高新技术、专精特新企业上传材料"];
  158. } else {
  159. $fields = ["name" => "单位名称", "idCard" => "统一社会信用代码", "legal" => "法人代表", "address" => "单位地址", "street" => "所属街道", "ephone" => "单位电话", "bankCard" => "单位银行账号", "bank" => "单位开户银行", "bankNetwork" => "单位开户银行网点",
  160. "agentName" => "人才联络员姓名", "agentPhone" => "人才联络员电话", "agentEmail" => "人才联络员邮箱"];
  161. if ($ep->special == 1) {
  162. $fields["institutionTag"] = "单位标签";
  163. }
  164. if ($ep->special == 3) {
  165. $fields["organizationTag"] = "机构标签";
  166. }
  167. $files = ["imgurl" => "法人证或批文", "bankImg" => "开户许可证/基本存款账户信息", "beian" => "人才联络员备案表"];
  168. }
  169. $modify_fields = [];
  170. $modify_files = [];
  171. $_modify_fields = explode(",", $ep["modify_fields"]);
  172. foreach ($fields as $key => $value) {
  173. $checked = in_array($key, $_modify_fields);
  174. $modify_fields[$key] = ["field" => $key, "name" => $value, "checked" => $checked];
  175. }
  176. $_modify_files = explode(",", $ep["modify_files"]);
  177. foreach ($files as $key => $value) {
  178. $checked = in_array($key, $_modify_files);
  179. $modify_files[$key] = ["field" => $key, "name" => $value, "checked" => $checked];
  180. }
  181. return view("", ['ep' => $ep, 'checkUser' => session('user')['name'], 'fields' => $modify_fields, "files" => $modify_files]);
  182. }
  183. public function doExamine() {
  184. $id = trim($this->request['id']);
  185. $doSubmit = $this->request["submit"] == 1 ? true : false;
  186. if (!$id) {
  187. return json(["msg" => 'ID不能为空!']);
  188. }
  189. $ep = EnterpriseApi::getOne($id);
  190. if (!$ep) {
  191. return json(["msg" => '无此企业!']);
  192. }
  193. if (!in_array($ep["checkState"], [1]))
  194. return json(["msg" => "不在审核范围内"]);
  195. $checkState = $this->request['checkState'];
  196. if ($checkState == null || ($checkState != 2 && $checkState != 3)) {
  197. return json(["msg" => '请选择审核状态!']);
  198. }
  199. $checkMsg = $this->request['checkMsg'];
  200. $fields = $this->request['fields'];
  201. $files = $this->request['files'];
  202. if ($checkState == 2) {
  203. if (\StrUtil::isEmpOrNull($checkMsg)) {
  204. return json(["msg" => '请填写审核意见!']);
  205. }
  206. if (strlen($checkMsg) > 1000) {
  207. return json(["msg" => '审核意见最多1000个字符!']);
  208. }
  209. if (!$fields && !$files) {
  210. return json(["msg" => '请选择驳回修改的字段或者附件!']);
  211. }
  212. }
  213. try {
  214. $lastLog = \app\common\api\TalentLogApi::getLastLog($id, 10);
  215. $companyName = session('user')["companyName"] ?: session('user')["rolename"];
  216. if ($checkState == 3) {
  217. $fields = null;
  218. $files = null;
  219. }
  220. if ($doSubmit) {
  221. $checkData = [
  222. 'id' => $id,
  223. 'checkState' => $checkState,
  224. 'checkMsg' => $checkMsg,
  225. 'modify_fields' => $fields ? implode(",", $fields) : null,
  226. 'modify_files' => $files ? implode(",", $files) : null,
  227. 'checkUser' => session('user')['name'],
  228. 'updateUser' => session('user')['uid'],
  229. 'updateTime' => date("Y-m-d H:i:s")
  230. ];
  231. $res = EnterpriseApi::updateById($checkData);
  232. //短信入库数据
  233. $record_data = [
  234. 'id' => getStringId(),
  235. 'bizId' => getStringId(),
  236. 'userId' => $id,
  237. 'type' => 2,
  238. 'smsType' => 2,
  239. 'name' => $ep['name'],
  240. 'phone' => $ep['agentPhone'],
  241. 'params' => '机构注册信息',
  242. 'state' => 1,
  243. 'sendingDate' => date("Y-m-d H:i:s", time()),
  244. 'createTime' => date("Y-m-d H:i:s", time())
  245. ];
  246. if ($checkState == 2) {
  247. $record_data['templateCode'] = "【晋江市人才服务平台】您好!您提交的晋江市现代产业体系人才机构注册信息因信息填写错误或上传不完整已被退回,请及时登录“晋江市人才综合服务申报平台”根据审核意见修改并重新提交。退订回复TD。";
  248. }
  249. if ($checkState == 3) {
  250. $record_data['templateCode'] = "【晋江市人才服务平台】您好!您提交的晋江市现代产业体系人才机构注册信息已审核通过,可登录“晋江市人才综合服务申报平台”做相关事宜申报。退订回复TD。";
  251. }
  252. $smsapi = new ChuanglanSmsApi();
  253. $result = $smsapi->sendSMS($ep['agentPhone'], $record_data['templateCode']);
  254. MessageRecord::create($record_data);
  255. if ($lastLog["active"] === 0) {
  256. TalentChecklog::update([
  257. 'id' => $lastLog["id"],
  258. 'active' => 1,
  259. 'state' => $checkState,
  260. 'step' => 101,
  261. 'stateChange' => TalentState::stateEnum($checkState),
  262. 'description' => $checkMsg,
  263. 'updateTime' => date("Y-m-d H:i:s", time()),
  264. 'updateUser' => session('user')['name'] . "({$companyName})"
  265. ]);
  266. } else {
  267. TalentChecklog::create([
  268. 'id' => getStringId(),
  269. 'mainId' => $id,
  270. 'type' => 10,
  271. 'typeField' => null,
  272. 'active' => 1,
  273. 'state' => $checkState,
  274. 'step' => 101,
  275. 'stateChange' => TalentState::stateEnum($checkState),
  276. 'description' => $checkMsg,
  277. 'createTime' => date("Y-m-d H:i:s", time()),
  278. 'createUser' => session('user')['name'] . "({$companyName})"
  279. ]);
  280. }
  281. return json(["msg" => '操作成功!', "code" => 200]);
  282. } else {
  283. $checkData = [
  284. 'id' => $id,
  285. 'modify_fields' => $fields ? implode(",", $fields) : null,
  286. 'modify_files' => $files ? implode(",", $files) : null,
  287. 'checkUser' => session('user')['name'],
  288. 'updateUser' => session('user')['uid'],
  289. 'updateTime' => date("Y-m-d H:i:s")
  290. ];
  291. $res = EnterpriseApi::updateById($checkData);
  292. if ($lastLog["active"] === 0) {
  293. TalentChecklog::update([
  294. 'id' => $lastLog["id"],
  295. 'state' => $checkState,
  296. 'step' => 101,
  297. 'stateChange' => TalentState::stateEnum($checkState),
  298. 'description' => $checkMsg,
  299. 'updateTime' => date("Y-m-d H:i:s", time()),
  300. 'updateUser' => session('user')['name'] . "({$companyName})"
  301. ]);
  302. } else {
  303. TalentChecklog::create([
  304. 'id' => getStringId(),
  305. 'mainId' => $id,
  306. 'type' => 10,
  307. 'typeField' => null,
  308. 'active' => 0,
  309. 'state' => $checkState,
  310. 'step' => 101,
  311. 'stateChange' => TalentState::stateEnum($checkState),
  312. 'description' => $checkMsg,
  313. 'createTime' => date("Y-m-d H:i:s", time()),
  314. 'createUser' => session('user')['name'] . "({$companyName})"
  315. ]);
  316. }
  317. return json(["msg" => '保存成功!', "code" => 200]);
  318. }
  319. } catch (\Exception $e) {
  320. return json(["msg" => $e->getMessage()]);
  321. }
  322. }
  323. public function GotoActivePage() {
  324. $id = trim($this->request['id']);
  325. $ep = EnterpriseApi::getOne($id);
  326. return view("", ['ep' => $ep]);
  327. }
  328. public function setActive() {
  329. if (!$id = trim($this->request['id'])) {
  330. return json(["msg" => 'ID不能为空!', "code" => 500]);
  331. }
  332. $ep = EnterpriseApi::getOne($id);
  333. $active = $this->request['active'];
  334. if ($ep['active'] == null || ($ep['active'] != 1 && $ep['active'] != 2)) {
  335. return json(["msg" => '状态有误!', "code" => 500]);
  336. }
  337. if ($ep['active'] == 2) {
  338. $msg = trim($this->request['activeMsg']);
  339. if (empty($msg)) {
  340. return json(["msg" => '请填写拉黑/冻结原因!', "code" => 500]);
  341. }
  342. if (strlen($msg) > 100) {
  343. return json(["msg" => '拉黑/冻结原因 最多100个字符!', "code" => 500]);
  344. }
  345. }
  346. $company = CompanyApi::getOne(session('user')['companyId']);
  347. $ep->active = $active;
  348. $ep->activeMsg = $msg;
  349. $ep->updateUser = session('user')['uid'] . "";
  350. $ep->updateTime = date('y-m-d H:i:s');
  351. try {
  352. $ep->save();
  353. //添加日志
  354. TalentChecklog::create([
  355. 'id' => getStringId(),
  356. 'mainId' => $ep['id'],
  357. 'type' => 10,
  358. 'typeField' => null,
  359. 'active' => 1,
  360. 'state' => TalentState::RCRD_BASEIC_FROZEN,
  361. 'step' => 102,
  362. 'stateChange' => TalentState::stateEnum(10),
  363. 'description' => $msg,
  364. 'createTime' => date("Y-m-d H:i:s", time()),
  365. 'createUser' => session('user')['name'] . "({$company['name']})"
  366. ]);
  367. return json(["msg" => '操作成功!', "code" => 200]);
  368. } catch (\Exception $e) {
  369. return json(["msg" => $e->getMessage()]);
  370. }
  371. }
  372. public function resetPassword() {
  373. if (!$id = trim($this->request['id'])) {
  374. return json(["msg" => 'ID不能为空!', "code" => 500]);
  375. }
  376. $ep = EnterpriseApi::getOne($id);
  377. if (!$ep) {
  378. return json(["msg" => '找不到该用户!', "code" => 500]);
  379. }
  380. $ep->password = hash("md5", 'JJrc@123'); //默认密码
  381. $ep->updateUser = session('user')['uid'] . "";
  382. $ep->updateTime = date("Y-m-d H:i:s");
  383. $ep->save();
  384. $company = CompanyApi::getOne(session('user')['companyId']);
  385. TalentChecklog::create([
  386. 'id' => getStringId(),
  387. 'mainId' => $ep['id'],
  388. 'type' => 10,
  389. 'typeField' => null,
  390. 'active' => 1,
  391. 'state' => null,
  392. 'step' => 103,
  393. 'stateChange' => '重置密码',
  394. 'description' => '重置密码',
  395. 'createTime' => date("Y-m-d H:i:s", time()),
  396. 'createUser' => session('user')['name'] . "({$company['name']})"
  397. ]);
  398. return json(["msg" => '重置密码成功!', "code" => 200]);
  399. }
  400. public function export() {
  401. $res = EnterpriseApi::getList($this->request, true);
  402. $rows = $res["rows"];
  403. $columns = ["单位名称", " 统一社会信用代码", "产业领域", "单位标签", " 所属街道", "单位地址", " 法人代表", " 单位电话", "人才联络员", "人才联络员电话", "人才联络员邮箱", "审核状态", "账号状态", "注册时间", "备注"];
  404. $exportDatas = [];
  405. if ($res["rows"]) {
  406. $stateMaps = [1 => "未审核", 2 => "审核驳回", 3 => "审核通过", 4 => "重新提交"];
  407. $activeMaps = [1 => "账号有效", 2 => "拉黑/冻结"];
  408. foreach ($rows as $row) {
  409. $exportDatas[] = [
  410. $row['name'],
  411. $row['idCard'],
  412. $row['industryFieldNewName'],
  413. $row['enterpriseTagName'],
  414. $row['streetName'],
  415. $row['address'],
  416. $row['legal'],
  417. $row['ephone'],
  418. $row['agentName'],
  419. $row['agentPhone'],
  420. $row['agentEmail'],
  421. $stateMaps[$row["checkState"]],
  422. $activeMaps[$row["active"]],
  423. $row['createTime'],
  424. $row['description']
  425. ];
  426. }
  427. export($columns, $exportDatas, "企业用户信息");
  428. exit();
  429. }
  430. return json(["msg" => "没有可以导出的内容"]);
  431. }
  432. public function findFieldsAndFiles() {
  433. $id = $this->request->param("id");
  434. $ep = EnterpriseApi::getOne($id);
  435. if ($ep->special == 0) {
  436. $fields = ["name" => "企业名称", "idCard" => "统一社会信用代码", "legal" => "法人代表", "address" => "企业地址", "street" => "所属街道", "ephone" => "企业电话", "bankCard" => "企业银行账号", "bank" => "企业开户银行", "bankNetwork" => "企业开户银行网点",
  437. "agencyType" => "机构类型", "industryFieldNew" => "产业领域", "industryFieldOld" => "行业领域", "enterpriseTag" => "企业标签", "enterpriseType" => "企业类型",
  438. "agentName" => "人才联络员姓名", "agentPhone" => "人才联络员电话", "agentEmail" => "人才联络员邮箱"];
  439. $files = ["imgurl" => "企业营业执照", "bankImg" => "开户许可证/基本存款账户信息", "domainImg" => "行业领域佐证材料", "beian" => "人才联络员信息备案表", "typeImg" => "规上、高新技术、专精特新企业上传材料"];
  440. } else {
  441. $fields = ["name" => "单位名称", "idCard" => "统一社会信用代码", "legal" => "法人代表", "address" => "单位地址", "street" => "所属街道", "ephone" => "单位电话", "bankCard" => "单位银行账号", "bank" => "单位开户银行", "bankNetwork" => "单位开户银行网点",
  442. "agentName" => "人才联络员姓名", "agentPhone" => "人才联络员电话", "agentEmail" => "人才联络员邮箱"];
  443. if ($ep->special == 1) {
  444. $fields["institutionTag"] = "单位标签";
  445. }
  446. if ($ep->special == 3) {
  447. $fields["organizationTag"] = "机构标签";
  448. }
  449. $files = ["imgurl" => "法人证或批文", "bankImg" => "开户许可证/基本存款账户信息", "beian" => "人才联络员备案表"];
  450. }
  451. $modify_fields = [];
  452. $modify_files = [];
  453. $_modify_fields = explode(",", $ep["modify_fields"]);
  454. foreach ($fields as $key => $value) {
  455. $checked = in_array($key, $_modify_fields);
  456. $modify_fields[$key] = ["field" => $key, "name" => $value, "checked" => $checked];
  457. }
  458. $_modify_files = explode(",", $ep["modify_files"]);
  459. foreach ($files as $key => $value) {
  460. $checked = in_array($key, $_modify_files);
  461. $modify_files[$key] = ["field" => $key, "name" => $value, "checked" => $checked];
  462. }
  463. return json(["code" => 200, "files" => $modify_files, "fields" => $modify_fields]);
  464. }
  465. public function updateFieldsAndFiles() {
  466. try {
  467. $params = $this->request->param();
  468. $id = $params["id"];
  469. $ep = EnterpriseApi::getOne($id);
  470. if (!$ep) {
  471. throw new \think\Exception("没有对应的企业信息");
  472. }
  473. if ($ep["checkState"] != 2) {
  474. throw new \think\Exception("不是驳回状态,不能修改驳回字段!");
  475. }
  476. $fields = array_filter(explode(",", $params["fields"]));
  477. $files = array_filter(explode(",", $params["files"]));
  478. if (!$fields || !$files)
  479. throw new \think\Exception("请选择要驳回的字段或附件!");
  480. $data["id"] = $id;
  481. $data["modify_fields"] = $fields ? implode(",", $fields) : null;
  482. $data["modify_files"] = $files ? implode(",", $files) : null;
  483. $data["updateTime"] = date("Y-m-d H:i:s");
  484. $data["updateUser"] = session("user")["uid"];
  485. if (EnterpriseApi::updateById($data)) {
  486. return json(["code" => 200, "msg" => "修改成功!"]);
  487. }
  488. } catch (\think\Exception $e) {
  489. return json(["msg" => $e->getMessage()]);
  490. }
  491. }
  492. }