ProductController.php 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652
  1. <?php
  2. /**
  3. * User: admin
  4. * Date Time: 2021/1/15 20:36
  5. */
  6. namespace ghs\controllers;
  7. use biz\admin\classes\AdminRoleClass;
  8. use biz\ghs\classes\GhsClass;
  9. use biz\item\classes\PtItemClass;
  10. use bizGhs\custom\classes\CustomClass;
  11. use bizGhs\item\classes\ItemClassClass;
  12. use bizGhs\merchant\classes\ShopClass;
  13. use bizGhs\product\classes\ProductClass;
  14. use bizGhs\product\models\Product;
  15. use bizGhs\product\services\ProductService;
  16. use common\components\printUtil;
  17. use common\components\stringUtil;
  18. use common\components\util;
  19. use Yii;
  20. class ProductController extends BaseController
  21. {
  22. public $guestAccess = ['index'];
  23. //打印花材的标签 ssh 20220602
  24. public function actionPrint()
  25. {
  26. $get = Yii::$app->request->get();
  27. $id = $get['id'] ?? 0;
  28. $num = $get['num'] ?? 1;
  29. $info = ProductClass::getById($id, true);
  30. if (empty($info)) {
  31. util::fail('没有找到花材');
  32. }
  33. $name = $info->name ?? '';
  34. $ptItemId = $info->itemId ?? 0;
  35. $ext = $this->shopExt;
  36. $printLabelSn = $ext->printLabelSn ?? '';
  37. if (empty($printLabelSn)) {
  38. util::fail('请设置标签打印机');
  39. }
  40. $p = new printUtil($printLabelSn);
  41. $p->times = $num;
  42. $content = '<TEXT x="50" y="20" font="12" w="2" h="2" r="90">' . $name . '</TEXT>';
  43. $content .= '<BC128 x="50" y="90" h="80" s="1" r="90" n="2" w="2">' . $ptItemId . '</BC128>';
  44. $p->printLabelMsg($content);
  45. util::complete();
  46. }
  47. //按分类列出所有花材
  48. public function actionIndex()
  49. {
  50. $py = Yii::$app->request->get('py', '');
  51. $requestType = Yii::$app->request->get('requestType', 'common');
  52. //默认显示上架商品
  53. $status = Yii::$app->request->get('status', 1);
  54. //默认显示未删除商品
  55. $delStatus = Yii::$app->request->get('delStatus', 0);
  56. //获取所有当前供应商的分类 (全部、常用)
  57. //根据分类组装分类下的花材信息
  58. //中央ID
  59. $classIds = ItemClassClass::getGhsItemClassAll($this->mainId);
  60. $where['mainId'] = $this->mainId;
  61. if ($py) {
  62. $pyName = strtolower($py);
  63. $where['py'] = $pyName;
  64. }
  65. if ($requestType == 'changePrice') {
  66. //改价只显示库存大于0的
  67. $where['stock>'] = 0;
  68. }
  69. if (!empty($status)) {
  70. $where['status'] = $status;
  71. }
  72. $where['delStatus'] = $delStatus;
  73. //客户等级
  74. $customId = Yii::$app->request->get('customId', 0);
  75. $level = 1;
  76. if (!empty($customId)) {
  77. $custom = CustomClass::getById($customId, true);
  78. $level = $custom->level ?? 1;
  79. }
  80. $itemInfoData = ProductClass::getAllByCondition($where, ['inTurn' => SORT_DESC, 'actualSold' => SORT_DESC], "*");
  81. $itemInfoData = ProductClass::groupProductInfo($itemInfoData, $level);
  82. $data = ProductService::assembleData($classIds, $itemInfoData, true);
  83. util::success($data);
  84. }
  85. //所有花材分页和不分页
  86. public function actionList()
  87. {
  88. $where = [];
  89. $classId = Yii::$app->request->get('classId', 0);
  90. if (!empty($classId)) {
  91. $where['classId'] = $classId;
  92. }
  93. $name = Yii::$app->request->get('name', '');
  94. if (empty($name)) {
  95. $py = Yii::$app->request->get('py', '');
  96. $name = !empty($py) ? $py : '';
  97. }
  98. if (!empty($name)) {
  99. if (stringUtil::isLetter($name)) {
  100. $where['py'] = ['like', $name];
  101. } else {
  102. $where['name'] = ['like', $name];
  103. }
  104. }
  105. $status = Yii::$app->request->get('status', 0);
  106. if (!empty($status)) {
  107. $where['status'] = $status;
  108. }
  109. $delStatus = Yii::$app->request->get('delStatus', 0);
  110. if ($delStatus != 2) {
  111. $where['delStatus'] = $delStatus;
  112. }
  113. $where['mainId'] = $this->mainId;
  114. $productIds = Yii::$app->request->get('ids', '');
  115. if (!empty($productIds)) {
  116. $productIdArr = explode(',', $productIds);
  117. if (!empty($productIdArr)) {
  118. $where['id'] = ['in', $productIdArr];
  119. }
  120. }
  121. //输出标准会员价,即花店价,默认显示的是花店价
  122. $level = 1;
  123. $type = Yii::$app->request->get('type', '');
  124. $showPage = Yii::$app->request->get('showPage', 0);
  125. if ($showPage) {
  126. if ($type == 'waring') {
  127. $pro = Product::find()->where("mainId={$this->mainId}")->andWhere('`stock`<`stockWarning`')->select('id')->asArray()->all();
  128. $lackIds = array_column($pro, 'id');
  129. if (empty($lackIds)) {
  130. util::success([]);
  131. }
  132. $lackIds = array_filter(array_unique($lackIds));
  133. $where['id'] = ['in', $lackIds];
  134. $respond = ProductClass::getList("*", $where, "actualSold desc");
  135. } else {
  136. $respond = ProductClass::getList("*", $where, "inTurn desc");
  137. }
  138. $respond['list'] = ProductClass::groupProductInfo($respond['list'], $level);
  139. $respond['list'] = ProductClass::groupClassName($this->sjId, $respond['list']);
  140. util::success($respond);
  141. } else {
  142. if ($type == 'waring') {
  143. //库存预警 按库存从小到大排序
  144. $data = ProductClass::getAllByCondition($where, ['stock' => SORT_ASC, 'inTurn' => SORT_DESC], "*");
  145. } else {
  146. if (!empty($productIds)) {
  147. //优先按 $productIds 排序 "FIELD(`id`,4,5,6)"=>true
  148. $data = ProductClass::getAllByCondition($where, ["FIELD(`id`,$productIds)" => true, 'inTurn' => SORT_DESC], "*");
  149. } else {
  150. $data = ProductClass::getAllByCondition($where, ['actualSold' => SORT_DESC, 'inTurn' => SORT_DESC], "*");
  151. }
  152. }
  153. $data = ProductClass::groupProductInfo($data, $level);
  154. $data = ProductClass::groupClassName($this->sjId, $data);
  155. if ($type == 'waring') {
  156. //库存预警
  157. $newData = [];
  158. foreach ($data as $v) {
  159. if ($v['stock'] <= $v['stockWarning']) {
  160. $newData[] = $v;
  161. }
  162. }
  163. util::success(['list' => $newData]);
  164. }
  165. util::success(['list' => $data]);
  166. }
  167. }
  168. //所有花材
  169. public function actionAll()
  170. {
  171. $where = [];
  172. $where['mainId'] = $this->mainId;
  173. $classId = Yii::$app->request->get('classId', 0);
  174. if (!empty($classId)) {
  175. $where['classId'] = $classId;
  176. }
  177. $status = Yii::$app->request->get('status', 0);
  178. if (!empty($status)) {
  179. $where['status'] = $status;
  180. }
  181. $delStatus = Yii::$app->request->get('delStatus', 0);
  182. if ($delStatus != 2) {
  183. $where['delStatus'] = $delStatus;
  184. }
  185. //输出标准会员价,即花店价,默认显示的是花店价
  186. $level = 1;
  187. $data = ProductClass::getAllByCondition($where, ['actualSold' => SORT_DESC, 'inTurn' => SORT_DESC], "*");
  188. $data = ProductClass::groupProductInfo($data, $level);
  189. util::success(['list' => $data]);
  190. }
  191. //批量改价
  192. public function actionBatchChangePrice()
  193. {
  194. $shop = $this->shop;
  195. $join = $shop->join ?? 0;
  196. $default = $shop->default ?? 0;
  197. if ($join == 0 && $default == 0) {
  198. util::fail('请在总店操作');
  199. }
  200. $shopAdmin = $this->shopAdmin;
  201. if (isset($shopAdmin->super) == false || $shopAdmin->super != 1) {
  202. util::fail('超管才能修改');
  203. }
  204. $shop = $this->shop;
  205. $default = $shop->default ?? 0;
  206. $data = Yii::$app->request->post('data', '');
  207. if (empty($data)) {
  208. util::fail('没有修改');
  209. }
  210. $arr = json_decode($data, true);
  211. if (empty($arr)) {
  212. util::fail('没有修改哦');
  213. }
  214. $connection = Yii::$app->db;
  215. $transaction = $connection->beginTransaction();
  216. try {
  217. $ids = array_column($arr, 'id');
  218. $ids = array_unique(array_filter($ids));
  219. if (empty($ids)) {
  220. util::fail('请选择花材');
  221. }
  222. $sjId = $shop->sjId ?? 0;
  223. $chainShopList = [];
  224. if ($default == 1) {
  225. $chainShopList = ShopClass::getAllByCondition(['sjId' => $sjId, 'join' => 0], null, '*', null, true);
  226. }
  227. $productList = ProductClass::getAllByCondition(['id' => ['in', $ids]], null, '*', 'id', true);
  228. foreach ($arr as $product) {
  229. if (isset($product['price']) == false) {
  230. util::fail('没有价格');
  231. }
  232. if (isset($product['id']) == false) {
  233. util::fail('没有花材');
  234. }
  235. $price = $product['price'];
  236. $productId = $product['id'];
  237. $product = $productList[$productId] ?? [];
  238. if (empty($product)) {
  239. util::fail('没有找到花材');
  240. }
  241. if (isset($product->mainId) == false || $product->mainId != $this->mainId) {
  242. util::fail('没有权限访问');
  243. }
  244. if (empty($price)) {
  245. continue;
  246. }
  247. $ptItemId = $product->itemId;
  248. ProductClass::changeSinglePrice($shop, $ptItemId, $price);
  249. //在首店修改需要同步到所有直营店
  250. if ($default == 1) {
  251. foreach ($chainShopList as $chain) {
  252. if ($chain->id == $shop->id) {
  253. continue;
  254. }
  255. ProductClass::changeSinglePrice($chain, $ptItemId, $price);
  256. }
  257. }
  258. }
  259. $transaction->commit();
  260. util::complete('修改成功');
  261. } catch (\Exception $e) {
  262. $transaction->rollBack();
  263. Yii::info("修改失败原因:" . $e->getMessage());
  264. util::fail('修改失败');
  265. }
  266. }
  267. //改价
  268. public function actionChangePrice()
  269. {
  270. $shopAdmin = $this->shopAdmin;
  271. if (isset($shopAdmin->super) == false || $shopAdmin->super != 1) {
  272. util::fail('超管才能修改');
  273. }
  274. $productId = Yii::$app->request->post('productId', 0);
  275. $productInfo = ProductClass::getById($productId, true);
  276. if (empty($productInfo)) {
  277. util::fail("花材不存在");
  278. }
  279. if ($productInfo->mainId != $this->mainId) {
  280. util::fail('没有权限');
  281. }
  282. $price = Yii::$app->request->post('price', '');
  283. if (is_numeric($price) && $price > 0) {
  284. ProductClass::changeSinglePrice($productInfo, $price, ProductClass::PRICE_LABEL_CHANGE);
  285. } else {
  286. $price = bcadd($productInfo->cost, $productInfo->addPrice, 2);
  287. ProductClass::changeSinglePrice($productInfo, $price, ProductClass::PRICE_LABEL_AUTO);
  288. }
  289. util::success(['price' => $price]);
  290. }
  291. //恢复自动调价
  292. public function actionAutoPrice()
  293. {
  294. $productId = Yii::$app->request->post('productId', 0);
  295. $productData = ProductClass::getById($productId);
  296. if (!$productData) {
  297. util::fail("花材不存在");
  298. }
  299. //2021.04.06改为用product中的成本价+加价
  300. $price = bcadd($productData['cost'], $productData['addPrice'], 2);
  301. ProductClass::changeSinglePrice($productId, $this->shopId, $price, ProductClass::PRICE_LABEL_AUTO);
  302. util::complete("操作成功");
  303. }
  304. //修改加价
  305. public function actionChangeAddPrice()
  306. {
  307. $productId = Yii::$app->request->post('productId', 0);
  308. $addPrice = Yii::$app->request->post('addPrice', '');
  309. if ($addPrice < 0) {
  310. util::fail("加价不能小于0");
  311. }
  312. $productData = ProductClass::getProductData($productId, $this->mainId);
  313. if (!$productData) {
  314. util::fail("花材不存在");
  315. }
  316. ProductClass::changeAddPrice($productId, $addPrice);
  317. util::complete();
  318. }
  319. //批量修改更多,包括排序、重量和保质期 ssh 20211211
  320. public function actionBatchChangeMore()
  321. {
  322. $shop = $this->shop;
  323. $join = $shop->join ?? 0;
  324. $default = $shop->default ?? 0;
  325. if ($join == 0 && $default == 0) {
  326. util::fail('请在总店操作');
  327. }
  328. $shopAdmin = $this->shopAdmin;
  329. if (isset($shopAdmin->super) == false || $shopAdmin->super != 1) {
  330. util::fail('超管才能操作');
  331. }
  332. $addData = Yii::$app->request->post('addData', '');
  333. if (empty($addData)) {
  334. util::fail('没有花材');
  335. }
  336. $itemData = json_decode($addData, true);
  337. if (is_array($itemData) == false) {
  338. util::fail('没有花材...');
  339. }
  340. $ids = array_column($itemData, 'id');
  341. $infoList = ProductClass::getByIds($ids);
  342. if (empty($infoList)) {
  343. util::fail('没有花材');
  344. }
  345. foreach ($infoList as $info) {
  346. if (isset($info['mainId']) == false || $info['mainId'] != $this->mainId) {
  347. util::fail('非常访问,不是你的花材不能修改');
  348. }
  349. }
  350. foreach ($itemData as $key => $data) {
  351. $id = $data['id'] ?? 0;
  352. ProductClass::updateById($id, $data);
  353. }
  354. util::complete('修改成功');
  355. }
  356. //批量修改加价 ssh 20211211
  357. public function actionBatchChangeAddPrice()
  358. {
  359. $shop = $this->shop;
  360. $join = $shop->join ?? 0;
  361. $default = $shop->default ?? 0;
  362. if ($join == 0 && $default == 0) {
  363. util::fail('请在总店操作');
  364. }
  365. $shopAdmin = $this->shopAdmin;
  366. if (isset($shopAdmin->super) == false || $shopAdmin->super != 1) {
  367. util::fail('超管才能操作');
  368. }
  369. $addData = Yii::$app->request->post('addData', '');
  370. if (empty($addData)) {
  371. util::fail('没有花材');
  372. }
  373. $itemData = json_decode($addData, true);
  374. if (is_array($itemData) == false) {
  375. util::fail('没有花材...');
  376. }
  377. $ids = array_column($itemData, 'id');
  378. $infoList = ProductClass::getByIds($ids, null, 'id');
  379. if (empty($infoList)) {
  380. util::fail('没有花材');
  381. }
  382. foreach ($infoList as $info) {
  383. if (isset($info['mainId']) == false || $info['mainId'] != $this->mainId) {
  384. util::fail('不能修改别人的花材');
  385. }
  386. }
  387. //首店修改同步到所有直营店
  388. $sjId = $shop->sjId ?? 0;
  389. $chainShopList = ShopClass::getAllByCondition(['sjId' => $sjId], null, '*', null, true);
  390. foreach ($itemData as $key => $data) {
  391. $id = $data['id'] ?? 0;
  392. unset($data['id']);
  393. ProductClass::updateById($id, $data);
  394. $ptItemId = $infoList[$id]['itemId'] ?? 0;
  395. if (empty($ptItemId)) {
  396. continue;
  397. }
  398. if (isset($shop->default) && $shop->default == 1) {
  399. foreach ($chainShopList as $chainShop) {
  400. if (isset($chainShop->join) && $chainShop->join == 1) {
  401. continue;
  402. }
  403. $currentMainId = $chainShop->mainId ?? 0;
  404. if ($currentMainId == $shop->mainId) {
  405. //前面已经修改过了,不需要重复修改
  406. continue;
  407. }
  408. ProductClass::updateByCondition(['mainId' => $currentMainId, 'itemId' => $ptItemId], $data);
  409. }
  410. }
  411. }
  412. util::complete('修改成功');
  413. }
  414. public function actionUpdate()
  415. {
  416. $shop = $this->shop;
  417. $join = $shop->join ?? 0;
  418. $default = $shop->default ?? 0;
  419. if ($join == 0 && $default == 0) {
  420. util::fail('请在总店操作');
  421. }
  422. $shopAdmin = $this->shopAdmin;
  423. if (isset($shopAdmin->super) == false || $shopAdmin->super != 1) {
  424. util::fail('超管才能操作');
  425. }
  426. $post = Yii::$app->request->post();
  427. $post['adminId'] = $this->adminId;
  428. $post['staffName'] = $this->shopAdmin->name;
  429. ProductClass::updateProduct($post, $this->shop);
  430. util::complete();
  431. }
  432. //上下架状态控制 ssh 20210713
  433. public function actionStatusUpdate()
  434. {
  435. $post = Yii::$app->request->post();
  436. $shopAdmin = $this->shopAdmin;
  437. $roleId = $shopAdmin['roleId'] ?? 0;
  438. $role = AdminRoleClass::getById($roleId);
  439. $roleName = $role['roleName'] ?? '';
  440. if ($roleName == '员工') {
  441. util::fail('没有权限操作哦');
  442. }
  443. $id = $post['id'] ?? 0;
  444. $status = $post['status'] ?? 1;
  445. $product = ProductClass::getById($id, true);
  446. if ($product->mainId != $this->mainId) {
  447. util::fail('没有权限操作');
  448. }
  449. $product->status = $status;
  450. if ($status == 2) {
  451. $product->discountPrice = 0;
  452. }
  453. $product->save();
  454. util::complete();
  455. }
  456. //花材展示状态控制 ssh 20210804
  457. public function actionDelStatusUpdate()
  458. {
  459. $post = Yii::$app->request->post();
  460. $shopAdmin = $this->shopAdmin;
  461. $roleId = $shopAdmin['roleId'] ?? 0;
  462. $role = AdminRoleClass::getById($roleId);
  463. $roleName = $role['roleName'] ?? '';
  464. if ($roleName == '员工') {
  465. util::fail('没有权限操作');
  466. }
  467. $id = $post['id'] ?? 0;
  468. $delStatus = $post['delStatus'] ?? 0;
  469. $product = ProductClass::getById($id, true);
  470. if ($product->mainId != $this->mainId) {
  471. util::fail('没有权限操作');
  472. }
  473. $product->delStatus = $delStatus;
  474. $product->save();
  475. util::complete();
  476. }
  477. //详情 ruidian 2021.5.3
  478. public function actionDetail()
  479. {
  480. $id = Yii::$app->request->get('id', 0);
  481. $respond = ProductClass::getItemInfo($id);
  482. $ptItemId = $respond['itemId'] ?? 0;
  483. $ptItemInfo = PtItemClass::getById($ptItemId);
  484. $respond['ptItemInfo'] = $ptItemInfo;
  485. util::success($respond);
  486. }
  487. //新增花材 2021.6.21
  488. public function actionAdd()
  489. {
  490. $post = Yii::$app->request->post();
  491. $shop = $this->shop;
  492. $join = $shop->join ?? 0;
  493. $default = $shop->default ?? 0;
  494. if ($join == 0 && $default == 0) {
  495. util::fail('请在总店操作');
  496. }
  497. $shopAdmin = $this->shopAdmin;
  498. if (isset($shopAdmin->super) == false || $shopAdmin->super != 1) {
  499. util::fail('管理员才能添加花材');
  500. }
  501. $post['sjId'] = $this->sjId;
  502. $post['adminId'] = $this->adminId;
  503. $post['mainId'] = $this->mainId;
  504. $price = $post['price'] ?? 0;
  505. $addPrice = $post['addPrice'] ?? 0;
  506. if ($addPrice > $price) {
  507. util::fail('加价不能大于售价');
  508. }
  509. $cost = bcsub($price, $addPrice, 2);
  510. $post['cost'] = $cost;
  511. $post['staffName'] = $shopAdmin->name ?? '';
  512. ProductClass::addProduct($post, $this->shop);
  513. util::complete('添加成功');
  514. }
  515. //获取拼音缩写 ssh 20210707
  516. public function actionPy()
  517. {
  518. $name = Yii::$app->request->get('name');
  519. $py = stringUtil::py($name);
  520. util::success(['py' => $py]);
  521. }
  522. //(客户端-批发商)复制花材
  523. public function actionClone()
  524. {
  525. $post = Yii::$app->request->post();
  526. $shop = $this->shop;
  527. $join = $shop->join ?? 0;
  528. $default = $shop->default ?? 0;
  529. if ($join == 0 && $default == 0) {
  530. util::fail('请在总店操作');
  531. }
  532. $shopAdmin = $this->shopAdmin;
  533. if (isset($shopAdmin->super) == false || $shopAdmin->super != 1) {
  534. util::fail('管理员才能添加花材');
  535. }
  536. $shop = $this->shop;
  537. $default = $shop->default ?? 0;
  538. if ($default != 1) {
  539. util::fail('请在总店添加');
  540. }
  541. $post['sjId'] = $this->sjId;
  542. $post['adminId'] = $this->adminId;
  543. $post['mainId'] = $this->mainId;
  544. $post['staffName'] = $shopAdmin->name ?? '';
  545. $price = $post['price'] ?? 0;
  546. $addPrice = $post['addPrice'] ?? 0;
  547. if ($addPrice > $price) {
  548. util::fail('加价不能大于售价');
  549. }
  550. $cost = bcsub($price, $addPrice, 2);
  551. $post['cost'] = $cost;
  552. $post['copy'] = 1; //复制标识
  553. //去除无用的字段
  554. unset($post['viewNum']);
  555. unset($post['actualSold']);
  556. unset($post['itemId']);
  557. unset($post['id']);
  558. unset($post['delStatus']);
  559. ProductClass::addProduct($post, $this->shop);
  560. util::complete('复制成功');
  561. }
  562. //下载价格表 ssh 20210922
  563. public function actionGeneratePriceTable()
  564. {
  565. $level = Yii::$app->request->get('level', 0);
  566. $respond = ProductService::generatePriceTable($this->sjId, $level, $this->mainId);
  567. $file = $respond['file'] ?? '';
  568. $shortFile = $respond['shortFile'] ?? '';
  569. $fileUrl = Yii::$app->params['ghsHost'] . $file;
  570. util::success(['file' => $fileUrl, 'shortFile' => $shortFile]);
  571. }
  572. //下载条形码 lqh 20211227
  573. public function actionGenerateBarcodeTable()
  574. {
  575. $respond = ProductService::generateBarcodeTable($this->sjId, $this->shopId, $this->mainId);
  576. $file = $respond['file'] ?? '';
  577. $shortFile = $respond['shortFile'] ?? '';
  578. $fileUrl = Yii::$app->params['ghsHost'] . $file;
  579. util::success(['file' => $fileUrl, 'shortFile' => $shortFile]);
  580. }
  581. }