SystemConfig.php 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
  4. // +----------------------------------------------------------------------
  5. // | Copyright (c) 2016~2026 https://www.crmeb.com All rights reserved.
  6. // +----------------------------------------------------------------------
  7. // | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
  8. // +----------------------------------------------------------------------
  9. // | Author: CRMEB Team <admin@crmeb.com>
  10. // +----------------------------------------------------------------------
  11. namespace app\adminapi\controller\v1\setting;
  12. use app\adminapi\controller\AuthController;
  13. use app\Request;
  14. use app\services\system\config\SystemConfigServices;
  15. use app\services\system\config\SystemConfigTabServices;
  16. use app\services\system\SystemPemServices;
  17. use crmeb\services\CacheService;
  18. use crmeb\services\easywechat\orderShipping\MiniOrderService;
  19. use think\facade\App;
  20. /**
  21. * 系统配置
  22. * Class SystemConfig
  23. * @package app\adminapi\controller\v1\setting
  24. */
  25. class SystemConfig extends AuthController
  26. {
  27. /** @var SystemConfigServices */
  28. protected $services;
  29. /**
  30. * SystemConfig constructor.
  31. * @param App $app
  32. * @param SystemConfigServices $configServices
  33. */
  34. public function __construct(App $app, SystemConfigServices $configServices)
  35. {
  36. parent::__construct($app);
  37. $this->services = $configServices;
  38. }
  39. /**
  40. * 显示资源列表
  41. * @return \think\Response
  42. * @throws \think\db\exception\DataNotFoundException
  43. * @throws \think\db\exception\DbException
  44. * @throws \think\db\exception\ModelNotFoundException
  45. */
  46. public function index()
  47. {
  48. $where = $this->request->getMore([
  49. ['tab_id', 0],
  50. ['config_name', ''],
  51. ['status', -1]
  52. ]);
  53. if (!$where['tab_id'] && $where['config_name'] == '') {
  54. return app('json')->fail('参数错误');
  55. }
  56. if ($where['status'] == -1) {
  57. unset($where['status']);
  58. }
  59. return app('json')->success($this->services->getConfigList($where));
  60. }
  61. /**
  62. * 显示创建资源表单页.
  63. * @return \think\Response
  64. * @throws \FormBuilder\Exception\FormBuilderException
  65. * @throws \think\db\exception\DataNotFoundException
  66. * @throws \think\db\exception\DbException
  67. * @throws \think\db\exception\ModelNotFoundException
  68. */
  69. public function create()
  70. {
  71. [$type, $tabId] = $this->request->getMore([
  72. [['type', 'd'], ''],
  73. [['tab_id', 'd'], 1]
  74. ], true);
  75. return app('json')->success($this->services->addFieldForm($type, $tabId));
  76. }
  77. /**
  78. * 保存新建的资源
  79. * @return \think\Response
  80. */
  81. public function save()
  82. {
  83. $data = $this->request->postMore([
  84. ['menu_name', ''],
  85. ['type', ''],
  86. ['input_type', 'input'],
  87. ['config_tab_id', 0],
  88. ['parameter', ''],
  89. ['upload_type', 1],
  90. ['required', 0],
  91. ['rule', ''], // 输入框验证
  92. ['min', null], // 数字最小值
  93. ['max', null], // 数字最大值
  94. ['width', 0],
  95. ['high', 0],
  96. ['value', ''],
  97. ['info', ''],
  98. ['desc', ''],
  99. ['sort', 0],
  100. ['level', 0],
  101. ['link_data', []],
  102. ['status', 0]
  103. ]);
  104. if (is_array($data['config_tab_id'])) $data['config_tab_id'] = end($data['config_tab_id']);
  105. if (!$data['info']) return app('json')->fail('请输入配置名称');
  106. if (!$data['menu_name']) return app('json')->fail('请输入字段名称');
  107. if (!$data['desc']) return app('json')->fail('请输入配置简介');
  108. if ($data['sort'] < 0) {
  109. $data['sort'] = 0;
  110. }
  111. if ($data['type'] == 'textarea') {
  112. if (!$data['width']) return app('json')->fail('请输入多行文本框的宽度');
  113. if (!$data['high']) return app('json')->fail('请输入多行文本框的高度');
  114. if ($data['width'] < 0) return app('json')->fail('请输入正确的多行文本框的宽度');
  115. if ($data['high'] < 0) return app('json')->fail('请输入正确的多行文本框的宽度');
  116. }
  117. if ($data['type'] == 'radio' || $data['type'] == 'checkbox') {
  118. if (!$data['parameter']) return app('json')->fail('请输入配置参数');
  119. $this->services->valiDateRadioAndCheckbox($data);
  120. }
  121. // 关联顶级选项
  122. if ($data['level'] == 1) {
  123. if (!$data['link_data']) return app('json')->fail('请选择关联顶级选项');
  124. $data['link_id'] = $data['link_data'][0];
  125. $data['link_value'] = $data['link_data'][1];
  126. }
  127. // 合并必填、格式规则和数字范围为 JSON 格式
  128. $requiredRules = [];
  129. if ($data['required']) {
  130. $requiredRules['required'] = true;
  131. } else {
  132. $requiredRules['required'] = false;
  133. }
  134. if ($data['rule']) {
  135. $requiredRules['regex'] = $data['rule'];
  136. }
  137. if ($data['type'] == 'text' && $data['input_type'] == 'number') {
  138. if ($data['min'] !== null) {
  139. $requiredRules['min'] = (int)$data['min'];
  140. }
  141. if ($data['max'] !== null) {
  142. $requiredRules['max'] = (int)$data['max'];
  143. }
  144. }
  145. // min不能大于max
  146. if ($data['min'] !== null && $data['max'] !== null && $data['min'] > $data['max']) {
  147. return app('json')->fail('最小值不能大于最大值');
  148. }
  149. $data['required'] = json_encode($requiredRules);
  150. unset($data['rule'], $data['min'], $data['max']);
  151. $data['value'] = json_encode($data['value']);
  152. $config = $this->services->getOne(['menu_name' => $data['menu_name']]);
  153. if ($config) {
  154. $this->services->update($config['id'], $data, 'id');
  155. } else {
  156. $this->services->save($data);
  157. }
  158. CacheService::clear();
  159. return app('json')->success('添加配置成功');
  160. }
  161. /**
  162. * 显示指定的资源
  163. *
  164. * @param int $id
  165. * @return \think\Response
  166. */
  167. public function read($id)
  168. {
  169. if (!$id) {
  170. return app('json')->fail('参数错误');
  171. }
  172. $info = $this->services->getReadList((int)$id);
  173. return app('json')->success(compact('info'));
  174. }
  175. /**
  176. * 显示编辑资源表单页.
  177. *
  178. * @param int $id
  179. * @return \think\Response
  180. */
  181. public function edit($id)
  182. {
  183. if (!$id) {
  184. return app('json')->fail('参数错误');
  185. }
  186. return app('json')->success($this->services->editFieldForm((int)$id));
  187. }
  188. /**
  189. * 保存更新的资源
  190. *
  191. * @param int $id
  192. * @return \think\Response
  193. */
  194. public function update($id)
  195. {
  196. $type = request()->post('type');
  197. if ($type == 'text' || $type == 'textarea' || $type == 'radio' || ($type == 'upload' && (request()->post('upload_type') == 1 || request()->post('upload_type') == 3))) {
  198. $value = request()->post('value');
  199. } else {
  200. $value = request()->post('value/a');
  201. }
  202. if (!$value) $value = request()->post(request()->post('menu_name'));
  203. $data = $this->request->postMore([
  204. ['menu_name', ''],
  205. ['type', ''],
  206. ['input_type', 'input'],
  207. ['config_tab_id', 0],
  208. ['parameter', ''],
  209. ['upload_type', 1],
  210. ['required', 0],
  211. ['regex', ''], // 输入框验证
  212. ['min', ''], // 数字最小值
  213. ['max', ''], // 数字最大值
  214. ['width', 0],
  215. ['high', 0],
  216. ['value', $value],
  217. ['info', ''],
  218. ['desc', ''],
  219. ['sort', 0],
  220. ['level', 0],
  221. ['link_data', []],
  222. ['status', 0]
  223. ]);
  224. if (is_array($data['config_tab_id'])) $data['config_tab_id'] = end($data['config_tab_id']);
  225. if (!$this->services->get($id)) {
  226. return app('json')->fail('数据不存在');
  227. }
  228. // 合并必填、格式规则和数字范围为 JSON 格式
  229. $requiredRules = [];
  230. if ($data['required']) {
  231. $requiredRules['required'] = true;
  232. } else {
  233. $requiredRules['required'] = false;
  234. }
  235. // 正则表达式验证
  236. if ($data['regex']) {
  237. $requiredRules['regex'] = $data['regex'];
  238. }
  239. // 数字类型额外保存 min 和 max
  240. if ($data['type'] == 'text' && $data['input_type'] == 'number') {
  241. if ($data['min'] !== '') {
  242. $requiredRules['min'] = (int)$data['min'];
  243. }
  244. if ($data['max'] !== '') {
  245. $requiredRules['max'] = (int)$data['max'];
  246. }
  247. }
  248. // min不能大于max
  249. if ($data['min'] !== '' && $data['max'] !== '' && $data['min'] > $data['max']) {
  250. return app('json')->fail('最小值不能大于最大值');
  251. }
  252. $data['required'] = json_encode($requiredRules);
  253. unset($data['regex'], $data['min'], $data['max']);
  254. // 关联选项
  255. if ($data['level'] == 1) {
  256. if (!$data['link_data']) return app('json')->fail('请选择关联顶级选项');
  257. $data['link_id'] = $data['link_data'][0];
  258. $data['link_value'] = $data['link_data'][1];
  259. }
  260. $data['value'] = json_encode($data['value']);
  261. $this->services->update($id, $data);
  262. CacheService::clear();
  263. return app('json')->success('修改成功');
  264. }
  265. /**
  266. * 删除指定资源
  267. * @param int $id
  268. * @return \think\Response
  269. */
  270. public function delete($id)
  271. {
  272. if (!$this->services->delete($id))
  273. return app('json')->fail('删除失败');
  274. else {
  275. CacheService::clear();
  276. return app('json')->success('删除成功');
  277. }
  278. }
  279. /**
  280. * 修改状态
  281. * @param $id
  282. * @param $status
  283. * @return mixed
  284. */
  285. public function set_status($id, $status)
  286. {
  287. if ($status == '' || $id == 0) {
  288. return app('json')->fail('参数错误');
  289. }
  290. $this->services->update($id, ['status' => $status]);
  291. CacheService::clear();
  292. return app('json')->success('设置成功');
  293. }
  294. /**
  295. * 基础配置
  296. * */
  297. public function edit_basics(Request $request)
  298. {
  299. $tabId = $this->request->param('tab_id', 1);
  300. if (!$tabId) {
  301. return app('json')->fail('参数错误');
  302. }
  303. $url = $request->baseUrl();
  304. return app('json')->success($this->services->getConfigForm($url, $tabId));
  305. }
  306. /**
  307. * 保存数据 true
  308. * */
  309. public function save_basics(Request $request)
  310. {
  311. $post = $this->request->post();
  312. foreach ($post as $k => $v) {
  313. if (is_array($v)) {
  314. $res = $this->services->getUploadTypeList($k);
  315. foreach ($res as $kk => $vv) {
  316. if ($kk == 'upload') {
  317. if ($vv == 1 || $vv == 3) {
  318. $post[$k] = $v[0];
  319. }
  320. }
  321. }
  322. }
  323. }
  324. $this->validate($post, \app\adminapi\validate\setting\SystemConfigValidata::class);
  325. if (isset($post['upload_type'])) {
  326. $this->services->checkThumbParam($post);
  327. }
  328. if (isset($post['extract_type']) && !count($post['extract_type'])) {
  329. return app('json')->fail('提现方式最少选一种');
  330. }
  331. // 检查佣金绑定状态
  332. if (isset($post['store_brokerage_binding_status'])) {
  333. $this->services->checkBrokerageBinding($post);
  334. }
  335. // 检查一级返佣比例和二级返佣比例是否大于100%
  336. if (isset($post['store_brokerage_ratio']) && isset($post['store_brokerage_two'])) {
  337. $num = $post['store_brokerage_ratio'] + $post['store_brokerage_two'];
  338. if ($num > 100) {
  339. return app('json')->fail('一二级返佣比例不能大于100%');
  340. }
  341. }
  342. if (isset($post['spread_banner'])) {
  343. $num = count($post['spread_banner']);
  344. if ($num > 5) {
  345. return app('json')->fail('分销海报不能多于5张');
  346. }
  347. }
  348. if (isset($post['user_extract_min_price'])) {
  349. if (!preg_match('/[0-9]$/', $post['user_extract_min_price'])) {
  350. return app('json')->fail('提现最低金额只能为数字');
  351. }
  352. }
  353. if (isset($post['wss_open'])) {
  354. $this->services->saveSslFilePath((int)$post['wss_open'], $post['wss_local_pk'] ?? '', $post['wss_local_cert'] ?? '');
  355. }
  356. if (isset($post['store_brokerage_price']) && $post['store_brokerage_statu'] == 3) {
  357. if ($post['store_brokerage_price'] === '') {
  358. return app('json')->fail('满额分销最低金额不能为空');
  359. }
  360. if ($post['store_brokerage_price'] < 0) {
  361. return app('json')->fail('满额分销最低金额不能小于0');
  362. }
  363. }
  364. if (isset($post['store_brokerage_binding_time']) && $post['store_brokerage_binding_status'] == 2) {
  365. if (!preg_match("/^[0-9][0-9]*$/", $post['store_brokerage_binding_time'])) {
  366. return app('json')->fail('绑定有效期请填写正整数');
  367. }
  368. }
  369. if (isset($post['uni_brokerage_price']) && $post['uni_brokerage_price'] < 0) {
  370. return app('json')->fail('推广佣金单价不能小于0');
  371. }
  372. if (isset($post['day_brokerage_price_upper']) && $post['day_brokerage_price_upper'] < -1) {
  373. return app('json')->fail('每日推广佣金上限不能小于-1');
  374. }
  375. if (isset($post['pay_new_weixin_open']) && (bool)$post['pay_new_weixin_open']) {
  376. if (empty($post['pay_new_weixin_mchid'])) {
  377. return app('json')->fail('商户号不能为空');
  378. }
  379. }
  380. if (isset($post['uni_brokerage_price']) && preg_match('/\.[0-9]{2,}[1-9][0-9]*$/', (string)$post['uni_brokerage_price']) > 0) {
  381. return app('json')->fail('金额最多两位小数');
  382. }
  383. if (isset($post['weixin_ckeck_file'])) {
  384. $from = public_path() . $post['weixin_ckeck_file'];
  385. $to = public_path() . array_reverse(explode('/', $post['weixin_ckeck_file']))[0];
  386. @copy($from, $to);
  387. }
  388. if (isset($post['ico_path'])) {
  389. $from = public_path() . $post['ico_path'];
  390. $toAdmin = public_path('admin') . 'favicon.ico';
  391. $toHome = public_path('home') . 'favicon.ico';
  392. $toPublic = public_path() . 'favicon.ico';
  393. @copy($from, $toAdmin);
  394. @copy($from, $toHome);
  395. @copy($from, $toPublic);
  396. }
  397. if (isset($post['reward_integral']) || isset($post['reward_money'])) {
  398. if ($post['reward_money'] < 0) return app('json')->fail('赠送余额不能小于0元');
  399. if ($post['reward_integral'] < 0) return app('json')->fail('赠送积分不能小于0');
  400. }
  401. if (isset($post['sign_give_point'])) {
  402. if (!is_int($post['sign_give_point']) || $post['sign_give_point'] < 0) {
  403. return app('json')->fail('签到赠送积分请填写大于等于0的整数');
  404. }
  405. }
  406. if (isset($post['sign_give_exp'])) {
  407. if ((int)$post['sign_give_exp'] < 0) {
  408. return app('json')->fail('签到赠送经验请填写大于等于0的整数');
  409. }
  410. }
  411. if (isset($post['integral_frozen'])) {
  412. if (!ctype_digit($post['integral_frozen']) || $post['integral_frozen'] < 0) {
  413. return app('json')->fail('积分冻结天数请填写大于等于0的整数');
  414. }
  415. }
  416. if (isset($post['store_free_postage'])) {
  417. if (!is_int($post['store_free_postage']) || $post['store_free_postage'] < 0) {
  418. return app('json')->fail('满额包邮请填写大于等于0的整数');
  419. }
  420. }
  421. if (isset($post['withdrawal_fee'])) {
  422. if ($post['withdrawal_fee'] < 0 || $post['withdrawal_fee'] > 100) {
  423. return app('json')->fail('提现手续费范围在0-100之间');
  424. }
  425. }
  426. if (isset($post['routine_auth_type']) && count($post['routine_auth_type']) == 0) {
  427. return app('json')->fail('微信和手机号登录开关至少开启一个');
  428. }
  429. if (isset($post['integral_max_num'])) {
  430. if (!ctype_digit($post['integral_max_num']) || $post['integral_max_num'] < 0) {
  431. return app('json')->fail('积分抵扣上限请填写大于等于0的整数');
  432. }
  433. }
  434. if (isset($post['customer_phone'])) {
  435. if (!ctype_digit($post['customer_phone']) || strlen($post['customer_phone']) > 11) {
  436. return app('json')->fail('客服手机号为11位数字');
  437. }
  438. }
  439. if (isset($post['refund_time_available'])) {
  440. if (!ctype_digit($post['refund_time_available'])) {
  441. return app('json')->fail('售后期限必须为大于0的整数');
  442. }
  443. }
  444. if (isset($post['sms_save_type']) && sys_config('sms_account', '') != '') {
  445. return app('json')->success('修改成功');
  446. }
  447. if (isset($post['param_filter_data'])) {
  448. $post['param_filter_data'] = base64_encode($post['param_filter_data']);
  449. }
  450. if (isset($post['product_type_config'])) {
  451. if (count($post['product_type_config']) == 0) {
  452. return app('json')->fail('商品类型至少选择一项');
  453. }
  454. }
  455. if (isset($post['yue_pay_status']) && $post['yue_pay_status'] == 1) {
  456. $post['balance_func_status'] = 1;
  457. }
  458. if (isset($post['pay_weixin_client_cert'])) {
  459. $certData = [
  460. 'type' => 'wechat',
  461. 'name' => 'pay_weixin_client_cert',
  462. 'path' => 'cert' . time() . rand(1000, 9999),
  463. 'content' => $post['pay_weixin_client_cert'] != '' ? file_get_contents($this->getPemPath($post['pay_weixin_client_cert'])) : '',
  464. ];
  465. $keyData = [
  466. 'type' => 'wechat',
  467. 'name' => 'pay_weixin_client_key',
  468. 'path' => 'key' . time() . rand(1000, 9999),
  469. 'content' => $post['pay_weixin_client_key'] != '' ? file_get_contents($this->getPemPath($post['pay_weixin_client_key'])) : '',
  470. ];
  471. $systemPemServices = app()->make(SystemPemServices::class);
  472. $systemPemServices->savePem($certData);
  473. $systemPemServices->savePem($keyData);
  474. }
  475. if (isset($post['merchant_cert_path'])) {
  476. $merchantCertData = [
  477. 'type' => 'alipay',
  478. 'name' => 'merchant_cert_path',
  479. 'path' => 'merchant_cert' . time() . rand(1000, 9999),
  480. 'content' => $post['merchant_cert_path'] != '' ? file_get_contents($this->getPemPath($post['merchant_cert_path'])) : '',
  481. ];
  482. $alipayCertData = [
  483. 'type' => 'alipay',
  484. 'name' => 'alipay_cert_path',
  485. 'path' => 'alipay_cert' . time() . rand(1000, 9999),
  486. 'content' => $post['alipay_cert_path'] != '' ? file_get_contents($this->getPemPath($post['alipay_cert_path'])) : '',
  487. ];
  488. $alipayRootCertData = [
  489. 'type' => 'alipay',
  490. 'name' => 'alipay_root_cert_path',
  491. 'path' => 'alipay_root_cert' . time() . rand(1000, 9999),
  492. 'content' => $post['alipay_root_cert_path'] != '' ? file_get_contents($this->getPemPath($post['alipay_root_cert_path'])) : '',
  493. ];
  494. $systemPemServices = app()->make(SystemPemServices::class);
  495. $systemPemServices->savePem($merchantCertData);
  496. $systemPemServices->savePem($alipayCertData);
  497. $systemPemServices->savePem($alipayRootCertData);
  498. }
  499. foreach ($post as $k => $v) {
  500. $config_one = $this->services->getOne(['menu_name' => $k]);
  501. if ($config_one) {
  502. $config_one['value'] = $v;
  503. $this->services->valiDateValue($config_one);
  504. $this->services->update($k, ['value' => json_encode($v)], 'menu_name');
  505. }
  506. }
  507. CacheService::clear();
  508. return app('json')->success('修改成功');
  509. }
  510. /**
  511. * 获取证书文件路径
  512. * @param string $path
  513. * @return string
  514. * @author wuhaotian
  515. * @email 442384644@qq.com
  516. * @date 2024/10/21
  517. */
  518. public function getPemPath(string $path)
  519. {
  520. if (strstr($path, 'http://') || strstr($path, 'https://')) {
  521. $path = parse_url($path)['path'] ?? '';
  522. }
  523. $path = root_path('runtime/pem') . ltrim($path, '/');
  524. if (!file_exists($path)) {
  525. $path = public_path('uploads') . ltrim($path, '/');
  526. }
  527. return $path;
  528. }
  529. /**
  530. * 获取系统设置头部分类
  531. * @param SystemConfigTabServices $services
  532. * @return mixed
  533. * @throws \think\db\exception\DataNotFoundException
  534. * @throws \think\db\exception\DbException
  535. * @throws \think\db\exception\ModelNotFoundException
  536. */
  537. public function header_basics(SystemConfigTabServices $services)
  538. {
  539. [$type, $pid] = $this->request->getMore([
  540. [['type', 'd'], 0],
  541. [['pid', 'd'], 0]
  542. ], true);
  543. if ($type == 3) {//其它分类
  544. $config_tab = [];
  545. } else {
  546. $config_tab = $services->getConfigTab($pid);
  547. if (empty($config_tab)) $config_tab[] = $services->get($pid, ['id', 'id as value', 'title as label', 'pid', 'icon', 'type']);
  548. }
  549. return app('json')->success(compact('config_tab'));
  550. }
  551. /**
  552. * 获取单个配置的值
  553. * @param $name
  554. * @return mixed
  555. */
  556. public function get_system($name)
  557. {
  558. $value = sys_config($name);
  559. return app('json')->success(compact('value'));
  560. }
  561. /**
  562. * 获取某个分类下的所有配置
  563. * @param $tabId
  564. * @return mixed
  565. */
  566. public function get_config_list($tabId)
  567. {
  568. $list = $this->services->getReadList($tabId);
  569. $data = [];
  570. foreach ($list as $item) {
  571. $data[$item['menu_name']] = json_decode($item['value']);
  572. }
  573. return app('json')->success($data);
  574. }
  575. /**
  576. * 获取版本号信息
  577. * @return mixed
  578. */
  579. public function getVersion()
  580. {
  581. $version = get_crmeb_version();
  582. return app('json')->success([
  583. 'version' => $version,
  584. 'label' => 19,
  585. 'spread_uid' => (int)(parse_ini_file(app()->getRootPath() . '.version')['spread_uid'] ?? 0)
  586. ]);
  587. }
  588. }