Setting.php 23KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | Description: 客户模块设置
  4. // +----------------------------------------------------------------------
  5. // | Author: Michael_xu | gengxiaoxu@5kcrm.com
  6. // +----------------------------------------------------------------------
  7. namespace app\crm\controller;
  8. use app\admin\controller\ApiCommon;
  9. use app\admin\model\Message;
  10. use think\Hook;
  11. use think\Request;
  12. use think\Db;
  13. class Setting extends ApiCommon
  14. {
  15. /**
  16. * 用于判断权限
  17. * @permission 无限制
  18. * @allow 登录用户可访问
  19. * @other 其他根据系统设置
  20. **/
  21. public function _initialize()
  22. {
  23. $action = [
  24. 'permission' => [''],
  25. 'allow' => [
  26. 'config',
  27. 'configdata',
  28. 'team',
  29. 'teamsave',
  30. 'contractday',
  31. 'recordlist',
  32. 'recordedit',
  33. 'customerconfiglist',
  34. 'customerconfigsave',
  35. 'customerconfigupdate',
  36. 'customerconfigdelete',
  37. 'numberSequenceAdd',
  38. 'quitteam',
  39. 'setvisitday',
  40. 'getvisitday',
  41. 'setnumber',
  42. 'customerconfigdel',
  43. 'numbersequencelist'
  44. ]
  45. ];
  46. Hook::listen('check_auth', $action);
  47. $request = Request::instance();
  48. $a = strtolower($request->action());
  49. if (!in_array($a, $action['permission'])) {
  50. parent::_initialize();
  51. }
  52. }
  53. /**
  54. * 客户相关配置
  55. *
  56. * @return \think\response\Json
  57. */
  58. public function config()
  59. {
  60. //权限判断
  61. if (!checkPerByAction('admin', 'crm', 'pool')) {
  62. header('Content-Type:application/json; charset=utf-8');
  63. exit(json_encode(['code' => 102, 'error' => '无权操作']));
  64. }
  65. $configModel = model('ConfigData');
  66. $param = $this->param;
  67. if ((int)$param['follow_day'] > (int)$param['deal_day']) {
  68. return resultArray(['error' => '成交设置时长不能大于跟进设置时长']);
  69. }
  70. $res = $configModel->createData($param);
  71. if ($res) {
  72. return resultArray(['data' => '设置成功']);
  73. } else {
  74. return resultArray(['error' => $configModel->getError()]);
  75. }
  76. }
  77. /**
  78. * 客户相关配置(详情)
  79. *
  80. * @return \think\response\Json
  81. */
  82. public function configData()
  83. {
  84. $configModel = model('ConfigData');
  85. $data = $configModel->getData();
  86. return resultArray(['data' => $data]);
  87. }
  88. /**
  89. * 相关团队列表
  90. *
  91. * @return \think\response\Json
  92. * @throws \think\db\exception\DataNotFoundException
  93. * @throws \think\db\exception\ModelNotFoundException
  94. * @throws \think\exception\DbException
  95. */
  96. public function team()
  97. {
  98. $param = $this->param;
  99. $userModel = new \app\admin\model\User();
  100. if (!$param['types'] || !$param['types_id']) {
  101. return resultArray(['error' => '参数错误']);
  102. }
  103. switch ($param['types']) {
  104. case 'crm_leads' :
  105. $dataModel = new \app\crm\model\Leads();
  106. break;
  107. case 'crm_customer' :
  108. $dataModel = new \app\crm\model\Customer();
  109. break;
  110. case 'crm_contacts' :
  111. $dataModel = new \app\crm\model\Contacts();
  112. break;
  113. case 'crm_business' :
  114. $dataModel = new \app\crm\model\Business();
  115. break;
  116. case 'crm_contract' :
  117. $dataModel = new \app\crm\model\Contract();
  118. break;
  119. }
  120. $resData = $dataModel->getDataById($param['types_id']);
  121. $ro_user_ids = $resData['ro_user_id'] ? array_filter(explode(',', $resData['ro_user_id'])) : []; //只读权限
  122. $rw_user_ids = $resData['rw_user_id'] ? array_filter(explode(',', $resData['rw_user_id'])) : []; //读写权限
  123. $ro_user_arr = [];
  124. $rw_user_arr = [];
  125. $owner_user_arr = ['1' => ['user_id' => $resData['owner_user_id'], 'type' => 0, 'group_name' => '负责人', 'authority' => '负责人权限']]; //负责人
  126. //转换为二维数组
  127. foreach ($ro_user_ids as $k => $v) {
  128. $ro_user_arr[$k]['user_id'] = $v;
  129. $ro_user_arr[$k]['type'] = 1;
  130. $ro_user_arr[$k]['group_name'] = '普通成员';
  131. $ro_user_arr[$k]['authority'] = '只读';
  132. }
  133. foreach ($rw_user_ids as $k => $v) {
  134. $rw_user_arr[$k]['user_id'] = $v;
  135. $rw_user_arr[$k]['type'] = 2;
  136. $rw_user_arr[$k]['group_name'] = '普通成员';
  137. $rw_user_arr[$k]['authority'] = '读写';
  138. }
  139. $user_list = array_merge($owner_user_arr, $rw_user_arr, $ro_user_arr);
  140. $new_user_list = [];
  141. foreach ($user_list as $k => $v) {
  142. if ($v['user_id']) {
  143. $userInfo = [];
  144. $userInfo = $userModel->getUserById($v['user_id']) ?: [];
  145. $userInfo['group_name'] = $v['group_name'];
  146. $userInfo['authority'] = $v['authority'];
  147. $userInfo['type'] = $v['type'];
  148. $new_user_list[] = $userInfo;
  149. }
  150. }
  151. return resultArray(['data' => $new_user_list]);
  152. }
  153. /**
  154. * 退出团队
  155. *
  156. * @return \think\response\Json
  157. * @throws \think\Exception
  158. * @throws \think\db\exception\DataNotFoundException
  159. * @throws \think\db\exception\ModelNotFoundException
  160. * @throws \think\exception\DbException
  161. * @throws \think\exception\PDOException
  162. */
  163. public function quitTeam()
  164. {
  165. if (empty($this->param['types']) || empty($this->param['types_id'])) return resultArray(['error' => '参数错误']);
  166. if (!in_array($this->param['types'], ['crm_customer', 'crm_contacts', 'crm_business', 'crm_contract'])) {
  167. return resultArray(['error' => '参数错误']);
  168. }
  169. $userId = $this->userInfo['id'];
  170. $primaryKey = ['crm_customer' => 'customer_id', 'crm_contacts' => 'contacts_id', 'crm_business' => 'business_id', 'crm_contract' => 'contract_id'];
  171. $data = Db::name($this->param['types'])->field([$primaryKey[$this->param['types']], 'ro_user_id', 'rw_user_id', 'owner_user_id,name'])
  172. ->where($primaryKey[$this->param['types']], $this->param['types_id'])->find();
  173. if ($data['owner_user_id'] == $userId) return resultArray(['error' => '负责人不能退出团队!']);
  174. $data[$primaryKey[$this->param['types']]] = $this->param['types_id'];
  175. $data['ro_user_id'] = str_replace(',' . $userId, '', $data['ro_user_id']);
  176. $data['rw_user_id'] = str_replace(',' . $userId, '', $data['rw_user_id']);
  177. if (!Db::name($this->param['types'])->update($data)) {
  178. return resultArray(['error' => '操作失败!']);
  179. }
  180. $type = '';
  181. switch ($this->param['types']) {
  182. case 'crm_customer':
  183. $type = Message::CUSTOMER_PASS;
  184. break;
  185. case 'crm_business':
  186. $type = Message::BUSINESS_PASS;
  187. break;
  188. case 'crm_contract':
  189. $type = Message::CONTRACT_END;
  190. break;
  191. }
  192. //站内信
  193. $send_user_id = stringToArray($userId);
  194. if ($send_user_id && empty($param['check_status'])) {
  195. (new Message())->send(
  196. $type,
  197. [
  198. 'title' => $data['name'],
  199. 'action_id' => $this->param['types_id']
  200. ],
  201. $send_user_id
  202. );
  203. }
  204. return resultArray(['data' => '操作成功!']);
  205. }
  206. /**
  207. * 相关团队创建
  208. *
  209. * @return \think\response\Json
  210. * @throws \think\db\exception\DataNotFoundException
  211. * @throws \think\db\exception\ModelNotFoundException
  212. * @throws \think\exception\DbException
  213. */
  214. public function teamSave()
  215. {
  216. $param = $this->param;
  217. $userInfo = $this->userInfo;
  218. $settingModel = model('Setting');
  219. $userModel = new \app\admin\model\User();
  220. $types_id = $param['types_id'];
  221. if (!$param['types'] || !$types_id) {
  222. return resultArray(['error' => '参数错误']);
  223. }
  224. if (!$param['user_id']) {
  225. return resultArray(['error' => '请先选择协作人']);
  226. }
  227. $errorMessage = [];
  228. foreach ($types_id as $k => $v) {
  229. $error = false;
  230. $typesName = '';
  231. //权限判断
  232. switch ($param['types']) {
  233. case 'crm_customer' :
  234. $typesName = '客户';
  235. $customerModel = new \app\crm\model\Customer();
  236. $dataInfo = db('crm_customer')->where(['customer_id' => $v])->find();
  237. //判断权限
  238. $auth_user_ids = $userModel->getUserByPer('crm', 'customer', 'teamSave');
  239. //判断是否客户池数据
  240. $wherePool = $customerModel->getWhereByPool();
  241. $resPool = db('crm_customer')->alias('customer')->where(['customer.customer_id' => $v])->where($wherePool)->find();
  242. if (!$resPool && !in_array($dataInfo['owner_user_id'], $auth_user_ids)) {
  243. $error = true;
  244. $errorMessage = "客户'" . $dataInfo['name'] . "'操作失败,错误原因:无权操作";
  245. }
  246. if (in_array($dataInfo['owner_user_id'], $param['user_id'])) {
  247. $error = true;
  248. $errorMessage = "客户'" . $dataInfo['name'] . "'操作失败,错误原因:不能对负责人进行添加或移出操作!";
  249. }
  250. $message_type = Message::TEAM_CUSTOMER;
  251. continue;
  252. case 'crm_business' :
  253. $typesName = '商机';
  254. $businessModel = new \app\crm\model\Business();
  255. $dataInfo = db('crm_business')->where(['business_id' => $v])->find();
  256. //判断权限
  257. $auth_user_ids = $userModel->getUserByPer('crm', 'business', 'teamSave');
  258. if (!in_array($dataInfo['owner_user_id'], $auth_user_ids)) {
  259. $error = true;
  260. $errorMessage = "商机'" . $dataInfo['name'] . "'操作失败,错误原因:无权操作";
  261. }
  262. if (in_array($dataInfo['owner_user_id'], $param['user_id'])) {
  263. $error = true;
  264. $errorMessage = "商机'" . $dataInfo['name'] . "'操作失败,错误原因:不能对负责人进行添加或移出操作!";
  265. }
  266. $message_type = Message::TEAM_BUSINESS;
  267. continue;
  268. case 'crm_contract' :
  269. $typesName = '合同';
  270. $contractModel = new \app\crm\model\Contract();
  271. $dataInfo = db('crm_contract')->where(['contract_id' => $v])->find();
  272. //判断权限
  273. $auth_user_ids = $userModel->getUserByPer('crm', 'contract', 'teamSave');
  274. if (!in_array($dataInfo['owner_user_id'], $auth_user_ids)) {
  275. $error = true;
  276. $errorMessage = "合同'" . $dataInfo['name'] . "'操作失败,错误原因:无权操作";
  277. }
  278. if (in_array($dataInfo['owner_user_id'], $param['user_id'])) {
  279. $error = true;
  280. $errorMessage = "合同'" . $dataInfo['name'] . "'操作失败,错误原因:不能对负责人进行添加或移出操作!";
  281. }
  282. $message_type = Message::TEAM_CONTRACT;
  283. continue;
  284. }
  285. if ($error !== true) {
  286. $param['type_id'] = $v;
  287. $param['type'] = $param['type'] ?: 1;
  288. $param['is_del'] = $param['is_del'] ?: 3;
  289. $param['owner_user_id'] = $userInfo['id'];
  290. if (!$param['is_del']) {
  291. $res = $settingModel->createTeamData($param);
  292. if (!$res) {
  293. $errorMessage = $typesName . $dataInfo['name'] . "'操作失败,错误原因:修改失败";
  294. } else {
  295. (new Message())->send(
  296. $message_type,
  297. [
  298. 'title' => $dataInfo['name'],
  299. 'action_id' => $v
  300. ],
  301. $param['user_id']
  302. );
  303. }
  304. } else {
  305. $res = $settingModel->createTeamData($param);
  306. if (!$res) {
  307. $errorMessage = $typesName . $dataInfo['name'] . "'操作失败,错误原因:修改失败";
  308. }
  309. }
  310. }
  311. }
  312. if ($errorMessage) {
  313. return resultArray(['error' => $errorMessage]);
  314. } else {
  315. return resultArray(['data' => '保存成功']);
  316. }
  317. }
  318. /**
  319. * 合同到期提醒天数
  320. *
  321. * @return \think\response\Json
  322. * @throws \think\Exception
  323. * @throws \think\exception\PDOException
  324. */
  325. public function contractDay()
  326. {
  327. //权限判断
  328. if (!checkPerByAction('admin', 'crm', 'setting')) {
  329. header('Content-Type:application/json; charset=utf-8');
  330. exit(json_encode(['code' => 102, 'error' => '无权操作']));
  331. }
  332. $param = $this->param;
  333. $data = [];
  334. $contract_day = $param['contract_day'] ? intval($param['contract_day']) : 0;
  335. $contract_config = $param['contract_config'] ? intval($param['contract_config']) : 0;
  336. $res = db('crm_config')->where(['name' => 'contract_config'])->update(['value' => $contract_config]);
  337. if ($contract_day && $contract_config == 1) $res = db('crm_config')->where(['name' => 'contract_day'])->update(['value' => $contract_day]);
  338. return resultArray(['data' => '设置成功']);
  339. }
  340. /**
  341. * 记录类型编辑
  342. *
  343. * @return \think\response\Json
  344. * @throws \think\Exception
  345. * @throws \think\db\exception\DataNotFoundException
  346. * @throws \think\db\exception\ModelNotFoundException
  347. * @throws \think\exception\DbException
  348. * @throws \think\exception\PDOException
  349. */
  350. public function recordEdit()
  351. {
  352. $param = $this->param;
  353. //权限判断
  354. if (!checkPerByAction('admin', 'crm', 'setting')) {
  355. header('Content-Type:application/json; charset=utf-8');
  356. exit(json_encode(['code' => 102, 'error' => '无权操作']));
  357. }
  358. if ($param['value']) {
  359. $array = json_encode($param['value']);
  360. $record_type = db('crm_config')->where(['name' => 'record_type'])->find();
  361. if ($record_type) {
  362. $res = db('crm_config')->where(['name' => 'record_type'])->update(['value' => $array]);
  363. } else {
  364. $data = array();
  365. $data['name'] = 'record_type';
  366. $data['value'] = $array;
  367. $data['description'] = '跟进记录类型';
  368. $res = db('crm_config')->insert($data);
  369. }
  370. if ($res) {
  371. return resultArray(['data' => '设置成功']);
  372. } else {
  373. return resultArray(['error' => '设置失败,请重试!']);
  374. }
  375. } else {
  376. $record_type = db('crm_config')->where(['name' => 'record_type'])->find();
  377. $record_type['value'] = json_decode($record_type['value']);
  378. return resultArray(['data' => $record_type]);
  379. }
  380. }
  381. /**
  382. * 跟进记录 记录方式展示
  383. *
  384. * @return \think\response\Json
  385. * @throws \think\db\exception\DataNotFoundException
  386. * @throws \think\db\exception\ModelNotFoundException
  387. * @throws \think\exception\DbException
  388. */
  389. public function recordList()
  390. {
  391. $record_type = db('crm_config')->where(['name' => 'record_type'])->find();
  392. if ($record_type) {
  393. $arr = json_decode($record_type['value']);
  394. return resultArray(['data' => $arr]);
  395. } else {
  396. return resultArray(['data' => array()]);
  397. }
  398. }
  399. /**
  400. * 拥有、锁定客户数限制列表
  401. *
  402. * @return \think\response\Json
  403. * @throws \think\Exception
  404. * @throws \think\db\exception\DataNotFoundException
  405. * @throws \think\db\exception\ModelNotFoundException
  406. * @throws \think\exception\DbException
  407. */
  408. public function customerConfigList()
  409. {
  410. $param = $this->param;
  411. $param['types'] = $param['types'] ?: 1;
  412. $customerConfigModel = new \app\crm\model\CustomerConfig();
  413. $data = $customerConfigModel->getDataList($param);
  414. return resultArray(['data' => $data]);
  415. }
  416. /**
  417. * 拥有、锁定客户数限制 创建/编辑 todo 创建和编辑走一个接口,前端非要这么搞
  418. *
  419. * @return \think\response\Json
  420. * @throws \think\db\exception\DataNotFoundException
  421. * @throws \think\db\exception\ModelNotFoundException
  422. * @throws \think\exception\DbException
  423. */
  424. public function customerConfigSave()
  425. {
  426. //权限判断
  427. if (!checkPerByAction('admin', 'crm', 'setting')) {
  428. header('Content-Type:application/json; charset=utf-8');
  429. exit(json_encode(['code' => 102, 'error' => '无权操作']));
  430. }
  431. $customerConfigModel = new \app\crm\model\CustomerConfig();
  432. if (!$customerConfigModel->createData($this->param)) {
  433. return resultArray(['error' => $customerConfigModel->getError()]);
  434. }
  435. return resultArray(['data' => empty($param['id']) ? '创建成功!' : '编辑成功!']);
  436. }
  437. /**
  438. * 拥有、锁定客户数限制 编辑 todo 编辑不走这个接口,前端非要走创建接口
  439. *
  440. * @return \think\response\Json
  441. */
  442. public function customerConfigUpdate()
  443. {
  444. //权限判断
  445. if (!checkPerByAction('admin', 'crm', 'setting')) {
  446. header('Content-Type:application/json; charset=utf-8');
  447. exit(json_encode(['code' => 102, 'error' => '无权操作']));
  448. }
  449. $param = $this->param;
  450. $customerConfigModel = new \app\crm\model\CustomerConfig();
  451. $res = $customerConfigModel->updateDataById($param, $param['id']);
  452. if (!$res) {
  453. return resultArray(['error' => $customerConfigModel->getError()]);
  454. }
  455. return resultArray(['data' => '编辑成功']);
  456. }
  457. /**
  458. * 拥有、锁定客户数限制 删除
  459. *
  460. * @return \think\response\Json
  461. */
  462. public function customerConfigDel()
  463. {
  464. //权限判断
  465. if (!checkPerByAction('admin', 'crm', 'setting')) {
  466. header('Content-Type:application/json; charset=utf-8');
  467. exit(json_encode(['code' => 102, 'error' => '无权操作']));
  468. }
  469. $param = $this->param;
  470. $customerConfigModel = new \app\crm\model\CustomerConfig();
  471. $res = $customerConfigModel->delDataById($param['id']);
  472. if (!$res) {
  473. return resultArray(['error' => $customerConfigModel->getError()]);
  474. }
  475. return resultArray(['data' => '删除成功']);
  476. }
  477. /**
  478. * 编号列表
  479. *
  480. * @return \think\response\Json
  481. * @throws \think\db\exception\DataNotFoundException
  482. * @throws \think\db\exception\ModelNotFoundException
  483. * @throws \think\exception\DbException
  484. */
  485. public function numberSequenceList()
  486. {
  487. $param = $this->param;
  488. $numberSequenceModel = new \app\crm\model\NumberSequence();
  489. $data = $numberSequenceModel->getDataList($param);
  490. return resultArray(['data' => $data]);
  491. }
  492. /**
  493. * 编号添加
  494. *
  495. * @return \think\response\Json
  496. */
  497. public function numberSequenceAdd()
  498. {
  499. //权限判断
  500. if (!checkPerByAction('admin', 'crm', 'setting')) {
  501. header('Content-Type:application/json; charset=utf-8');
  502. exit(json_encode(['code' => 102, 'error' => '无权操作']));
  503. }
  504. $userInfo = $this->userInfo;
  505. $param = $this->param;
  506. $param['user_id'] = $userInfo['id'];
  507. $numberSequenceModel = new \app\crm\model\NumberSequence();
  508. $res = $numberSequenceModel->createData($param);
  509. if (!$res) {
  510. return resultArray(['error' => $numberSequenceModel->getError()]);
  511. }
  512. return resultArray(['data' => '创建成功']);
  513. }
  514. /**
  515. * 编号修改
  516. *
  517. * @return \think\response\Json
  518. */
  519. public function numberSequenceUpdate()
  520. {
  521. //权限判断
  522. if (!checkPerByAction('admin', 'crm', 'setting')) {
  523. header('Content-Type:application/json; charset=utf-8');
  524. exit(json_encode(['code' => 102, 'error' => '无权操作']));
  525. }
  526. $param = $this->param;
  527. $numberSequenceModel = new \app\crm\model\NumberSequence();
  528. $res = $numberSequenceModel->numberSequenceUpdate($param, $param['id']);
  529. if (!$res) {
  530. return resultArray(['error' => $numberSequenceModel->getError()]);
  531. }
  532. return resultArray(['data' => '编辑成功']);
  533. }
  534. /**
  535. * 编号删除
  536. *
  537. * @return \think\response\Json
  538. */
  539. public function numberSequenceDel()
  540. {
  541. //权限判断
  542. if (!checkPerByAction('admin', 'crm', 'setting')) {
  543. header('Content-Type:application/json; charset=utf-8');
  544. exit(json_encode(['code' => 102, 'error' => '无权操作']));
  545. }
  546. $param = $this->param;
  547. $numberSequenceModel = new \app\crm\model\NumberSequence();
  548. $res = $numberSequenceModel->delDataById($param['id']);
  549. if (!$res) {
  550. return resultArray(['error' => $numberSequenceModel->getError()]);
  551. }
  552. return resultArray(['data' => '删除成功']);
  553. }
  554. /**
  555. * 设置回访提醒
  556. *
  557. * @return \think\response\Json
  558. * @throws \think\Exception
  559. * @throws \think\exception\PDOException
  560. */
  561. public function setVisitDay()
  562. {
  563. $status = !empty($this->param['status']) ? $this->param['status'] : 0;
  564. $day = !empty($this->param['day']) ? $this->param['day'] : 0;
  565. $settingModel = new \app\crm\model\Setting();
  566. if (!$settingModel->setVisitDay($status, $day)) return resultArray(['error' => '操作失败!']);
  567. return resultArray(['data' => '操作成功!']);
  568. }
  569. /**
  570. * 获取回访提醒
  571. *
  572. * @return \think\response\Json
  573. */
  574. public function getVisitDay()
  575. {
  576. $settingModel = new \app\crm\model\Setting();
  577. $data = $settingModel->getVisitDay();
  578. return resultArray(['data' => $data]);
  579. }
  580. /**
  581. * 设置自动编号
  582. *
  583. * @return \think\response\Json
  584. */
  585. public function setNumber()
  586. {
  587. if (empty($this->param) || !is_array($this->param)) return resultArray(['error' => '参数错误!']);
  588. $settingModel = new \app\crm\model\Setting();
  589. if ($settingModel->setNumber($this->param) === false) return resultArray(['error' => '操作失败!']);
  590. return resultArray(['data' => '操作成功!']);
  591. }
  592. }