GhsController.php 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542
  1. <?php
  2. namespace hd\controllers;
  3. use biz\ghs\classes\GhsClass;
  4. use biz\shop\classes\ShopClass;
  5. use bizGhs\custom\classes\AccountMoneyClass;
  6. use bizGhs\custom\classes\CustomClass;
  7. use bizGhs\custom\classes\CustomLevelClass;
  8. use bizGhs\merchant\classes\WlClass;
  9. use bizGhs\shop\classes\GhsNoticeClass;
  10. use bizHd\purchase\classes\PurchaseClass;
  11. use bizHd\shop\classes\ShopExtClass;
  12. use bizGhs\stat\classes\StatVisitClass;
  13. use common\components\dict;
  14. use common\components\imgUtil;
  15. use common\components\mapUtil;
  16. use common\components\noticeUtil;
  17. use common\components\qrCodeUtil;
  18. use common\components\stringUtil;
  19. use common\components\util;
  20. use Yii;
  21. class GhsController extends BaseController
  22. {
  23. public $guestAccess = ['info', 'get-ghs-data', 'detail', 'common-info', 'ghs-notice-detail'];
  24. //提示花店有多个供货商
  25. public function actionRemindMoreGhs()
  26. {
  27. $where = [];
  28. $where['ownShopId'] = $this->shopId;
  29. $where['delStatus'] = 0;
  30. $count = GhsClass::getCount($where);
  31. $needNotice = 0;
  32. if ($count > 1) {
  33. $admin = $this->admin;
  34. $noticeHasMoreGhs = $admin->noticeHasMoreGhs ?? 0;
  35. if ($noticeHasMoreGhs == 0) {
  36. $needNotice = 1;
  37. }
  38. }
  39. util::success(['needNotice' => $needNotice]);
  40. }
  41. public static $levelMap = [
  42. 'pt' => ['name' => '普店', 'num' => 0, 'amount' => 0, 'key' => ''],
  43. 'hj' => ['name' => '银店', 'num' => 0, 'amount' => 0, 'key' => 'hj'],
  44. 'zs' => ['name' => '金店', 'num' => 0, 'amount' => 0, 'key' => 'zs'],
  45. ];
  46. //未登录获取供货商信息 ssh 20240507
  47. public function actionGetGhsData()
  48. {
  49. $get = Yii::$app->request->get();
  50. $id = $get['id'] ?? 0;
  51. $salt = $get['salt'] ?? '';
  52. $ghs = GhsClass::getById($id);
  53. if (empty($ghs)) {
  54. util::fail('没有找到供货商的信息哦');
  55. }
  56. if (!empty($salt)) {
  57. if (!isset($ghs['salt']) || $ghs['salt'] != $salt) {
  58. util::fail('不是您的供货商哈');
  59. }
  60. } else {
  61. if (!isset($ghs['ownShopId']) || $ghs['ownShopId'] != $this->shopId) {
  62. util::fail('不是你的供货商呢');
  63. }
  64. }
  65. $customId = $ghs['customId'] ?? 0;
  66. $custom = CustomClass::getById($customId);
  67. if (empty($custom)) {
  68. util::fail('供货商信息不完整');
  69. }
  70. // 挂账已并入净 balance:按 appVersion 格式化金额字段(v3 下 balance 负值=待结)
  71. $ghs = AccountMoneyClass::formatMoneyForClient(is_array($ghs) ? $ghs : $ghs->getAttributes());
  72. $custom = AccountMoneyClass::formatMoneyForClient(is_array($custom) ? $custom : $custom->getAttributes());
  73. //有同个地方要同步修改,关键词 custom_go_ghs_gathering_code
  74. if (getenv('YII_ENV') == 'production') {
  75. $url = "https://mall.huahb.cn/#/admin/ghs/pay?id={$id}&salt={$salt}";
  76. } else {
  77. $url = "https://mall.huaml.com/#/admin/ghs/pay?id={$id}&salt={$salt}";
  78. }
  79. $unique = "recharge_to_ghs_" . $id;
  80. $imgUrl = qrCodeUtil::generateRechargeQrCode($url, $unique);
  81. $imageUrl = imgUtil::groupImg($imgUrl);
  82. util::success(['ghs' => $ghs, 'custom' => $custom, 'imgUrl' => $imageUrl]);
  83. }
  84. //获取物流列表 ssh 20230608
  85. public function actionGetWlList()
  86. {
  87. $get = Yii::$app->request->get();
  88. $id = $get['id'] ?? 0;
  89. $ghs = GhsClass::getById($id, true);
  90. if (empty($ghs)) {
  91. util::success(['list' => []]);
  92. }
  93. $mainId = $ghs->mainId ?? 0;
  94. $list = WlClass::getAllByCondition(['mainId' => $mainId, 'delStatus' => 0], null, '*');
  95. util::success(['list' => $list]);
  96. }
  97. //添加虚拟的供货商 ssh 20230305
  98. public function actionAddGhs()
  99. {
  100. $post = Yii::$app->request->post();
  101. $name = $post['name'] ?? '';
  102. if (empty($name)) {
  103. util::fail('请填写名称');
  104. }
  105. if (stringUtil::getWordNum($name) > 8) {
  106. util::fail('名称不能超过8个汉字');
  107. }
  108. $connection = Yii::$app->db;
  109. $transaction = $connection->beginTransaction();
  110. try {
  111. $shopId = $this->shopId;
  112. $has = GhsClass::getByCondition(['ownShopId' => $shopId, 'name' => $name], true);
  113. if (!empty($has)) {
  114. util::fail($name . ' 已经存在了');
  115. }
  116. \bizHd\ghs\services\GhsService::addVirtualGhs($post, $this->shop);
  117. $transaction->commit();
  118. util::complete('添加成功');
  119. } catch (\Exception $e) {
  120. $transaction->rollBack();
  121. Yii::error("添加失败原因:" . $e->getMessage());
  122. util::fail('添加失败');
  123. }
  124. }
  125. //是否屏蔽 ssh 20230226
  126. public function actionChangeDelStatus()
  127. {
  128. $get = Yii::$app->request->get();
  129. $ghsId = $get['ghsId'] ?? 0;
  130. $delStatus = $get['delStatus'] ?? 0;
  131. $ghs = GhsClass::getById($ghsId, true);
  132. if (empty($ghs)) {
  133. util::fail('没有找到供货商');
  134. }
  135. $ownMainId = $ghs->ownMainId ?? 0;
  136. if ($ownMainId != $this->mainId) {
  137. util::fail('不是你的供货商,无法操作');
  138. }
  139. $ghs->delStatus = $delStatus;
  140. $ghs->save();
  141. util::complete('操作成功');
  142. }
  143. //获取供货商物流 ssh 20230105
  144. public function actionGetAllWl()
  145. {
  146. $get = Yii::$app->request->get();
  147. $id = $get['id'] ?? 0;
  148. $ghs = GhsClass::getById($id, true);
  149. if (empty($ghs) || $ghs->ownMainId != $this->mainId) {
  150. util::success(['list' => []]);
  151. }
  152. $ghsMainId = $ghs->mainId ?? 0;
  153. $list = \bizGhs\merchant\classes\WlClass::getAllByCondition(['mainId' => $ghsMainId, 'delStatus' => 0], 'inTurn DESC', 'id,name');
  154. util::success(['list' => $list]);
  155. }
  156. //采购选分类有变化通知
  157. public function actionGetClassRemind()
  158. {
  159. $cacheKey = 'class_change_remind_' . $this->shopAdminId;
  160. $has = Yii::$app->redis->executeCommand('GET', [$cacheKey]);
  161. $hasStatus = !empty($has) ? 1 : 0;
  162. util::success(['hasRemind' => $hasStatus]);
  163. }
  164. //采购选分类有变化通知
  165. public function actionHasClassRemind()
  166. {
  167. $cacheKey = 'class_change_remind_' . $this->shopAdminId;
  168. Yii::$app->redis->executeCommand('SET', [$cacheKey, 'has']);
  169. util::complete();
  170. }
  171. //供货商列表 ssh 2021.1.24
  172. public function actionList()
  173. {
  174. $get = Yii::$app->request->get();
  175. $delStatus = isset($get['delStatus']) && is_numeric($get['delStatus']) ? $get['delStatus'] : 0;
  176. $where = [];
  177. $where['ownShopId'] = $this->shopId;
  178. $where['delStatus'] = $delStatus;
  179. $name = $get['name'] ?? '';
  180. if (stringUtil::isLetter($name)) {
  181. $where['py'] = ['like', $name];
  182. } else {
  183. $where['name'] = ['like', $name];
  184. }
  185. $respond = GhsClass::getGhsList($where);
  186. //广告列表
  187. $apiHost = Yii::$app->params['hdImgHost'];
  188. //$ad = [['banner' => $apiHost . '/ljh/banner2.jpg', 'url' => '/admin/ljh/info']];
  189. $ad = [];
  190. $respond['ad'] = $ad;
  191. //默认显示广告
  192. $showAd = 1;
  193. if (isset($respond['list']) && !empty($respond['list'])) {
  194. foreach ($respond['list'] as $key => $ghs) {
  195. if (getenv('YII_ENV') == 'production') {
  196. //海翔、源花汇先不显示广告
  197. $noAdShopId = [42345, 10649];
  198. } else {
  199. $noAdShopId = [0];
  200. }
  201. if (isset($ghs['shopId']) && in_array($ghs['shopId'], $noAdShopId)) {
  202. $showAd = 0;
  203. }
  204. }
  205. }
  206. $respond['showAd'] = $showAd;
  207. util::success($respond);
  208. }
  209. //详情 ssh 2021.4.11
  210. public function actionDetail()
  211. {
  212. $id = Yii::$app->request->get('id');
  213. $salt = Yii::$app->request->get('salt');
  214. $ghsInfo = GhsClass::getGhsInfo($id);
  215. $giveLevel = $ghsInfo['giveLevel'] ?? 0;
  216. $levelMap = CustomClass::$nickNameMap;
  217. $giveLevelName = $levelMap[$giveLevel] ?? '散客';
  218. $ghsInfo['giveLevelName'] = $giveLevelName;
  219. if (!empty($salt)) {
  220. if (!isset($ghsInfo['salt']) || $ghsInfo['salt'] != $salt) {
  221. util::fail('不是您的批发店哈');
  222. }
  223. } else {
  224. if (!isset($ghsInfo['ownShopId']) || $ghsInfo['ownShopId'] != $this->shopId) {
  225. util::fail('不是你的批发店呢');
  226. }
  227. }
  228. //是否有充值送红包活动
  229. $ghsShopId = $ghsInfo['shopId'] ?? 0;
  230. $ghsShop = ShopClass::getById($ghsShopId, true);
  231. $ghsInfo['hasRechargeHb'] = $ghsShop->recharge ?? 0;
  232. $ghsInfo['hasRechargeHbAmount'] = 0;
  233. $ghsInfo['xrFl'] = $ghsShop->xrFl ?? 0;
  234. $ghsInfo['xrFlAmount'] = $ghsShop->xrFlAmount ?? 0;
  235. $ghsInfo['tjFl'] = $ghsShop->tjFl ?? 0;
  236. $ghsInfo['tjFlAmount'] = $ghsShop->tjFlAmount ?? 0;
  237. $ghsInfo['packCost'] = $ghsShop->packCost ? floatval($ghsShop->packCost) : 0;
  238. $lackExpend = $ghsShop->lackExpend ? floatval($ghsShop->lackExpend) : 0;
  239. $customId = $ghsInfo['customId'] ?? 0;
  240. $needAdd = \bizHd\shop\classes\ShopClass::needAddPackCost($ghsShop, $customId, 4);
  241. //昆明批发,需要算打包费和运费
  242. $needAddPackFreight = 1;
  243. if (!$needAdd) {
  244. $lackExpend = 0;
  245. //昆明批发,不需要算打包费和运费
  246. $needAddPackFreight = 0;
  247. }
  248. $ghsInfo['needAddPackFreight'] = $needAddPackFreight;
  249. $ghsInfo['lackExpend'] = $lackExpend;
  250. $ghsInfo['showSold'] = $ghsShop->showSold ?? 0;
  251. $ghsInfo['lsShopId'] = $ghsShop->lsShopId ?? 0;
  252. //预订单的最低公斤数和每公斤服务费
  253. $ghsInfo['kiloFee'] = $ghsShop->kiloFee ?? 0;
  254. $ghsInfo['miniKilo'] = $ghsShop->miniKilo ?? 0;
  255. //这个多处要补充的地方 add_pfLevel_many_place
  256. $ghsInfo['pfLevel'] = $ghsShop->pfLevel ?? 0;
  257. $ghsInfo['afterSale'] = $ghsShop->afterSale ?? 1;
  258. //联系电话
  259. $ghsInfo['telephone'] = $ghsShop->telephone ?? '';
  260. $shareLogo = imgUtil::groupImg('buy_logo.jpg');
  261. if (!empty($ghsShop->shareLogo)) {
  262. $shareLogo = imgUtil::groupImg($ghsShop->shareLogo);
  263. }
  264. $ghsInfo['shareLogo'] = $shareLogo;
  265. $ghsInfo['superWx'] = '';
  266. if (!empty($ghsShop->superWx)) {
  267. $ghsInfo['superWx'] = imgUtil::groupImg($ghsShop->superWx) . "?x-oss-process=image/resize,w_150";
  268. }
  269. $ghsMainId = $ghsShop->mainId ?? 0;
  270. $kmPackCost = PurchaseClass::getKmPackCost($ghsMainId);
  271. $ghsInfo['kmPackCost'] = $kmPackCost;
  272. $ghsInfo['transCost'] = dict::getDict('transCost', null, null, $ghsShop->mainId);
  273. //杭州斗南鲜花批发 免运费活动
  274. if (isset($ghsInfo['shopId']) && $ghsInfo['shopId'] == 4608) {
  275. $current = time();
  276. if ($current < strtotime('2023-4-8 00:00:00')) {
  277. $ghsInfo['hasAct'] = 1;
  278. }
  279. }
  280. $shopExt = ShopExtClass::getByCondition(['shopId' => $ghsShopId], false, false, 'purchaseGuide,purchaseGuideText,hcFreeKm,hcMap');
  281. $ghsInfo['buyNotice'] = $ghsShop->buyNotice ?? 0;
  282. $ghsInfo['buyNoticeText'] = $shopExt['purchaseGuideText'] ?? '';
  283. //判断是否开启同城配送功能
  284. $intraCityRet = ShopClass::hasIntraCity($ghsShop);
  285. $openIntraCity = $intraCityRet['openIntraCity'];
  286. $ghsInfo['openIntraCity'] = $openIntraCity;
  287. //花材的免费配送设置
  288. $hcFreeKm = $shopExt['hcFreeKm'] ?? 0;
  289. $ghsInfo['hcFreeKm'] = $hcFreeKm;
  290. $hcMapString = $shopExt['hcMap'] ?? '';
  291. $hcMap = [];
  292. if (!empty($hcMapString)) {
  293. $hcMap = json_decode($hcMapString, true);
  294. }
  295. $ghsInfo['hcMap'] = $hcMap;
  296. //是否使用新的配送方式,关键词 sh_method_area
  297. $newShMethod = dict::getNewMethodShop();
  298. $ghsInfo['useNewShMethod'] = in_array($ghsShopId, $newShMethod) ? 1 : 0;
  299. util::success($ghsInfo);
  300. }
  301. //根据门店获取供货商信息 ssh 2021.4.14
  302. public function actionInfo()
  303. {
  304. $shopId = Yii::$app->request->get('shopId');
  305. if (!empty($this->shopId)) {
  306. $current = ShopClass::getById($shopId, true);
  307. if (empty($current)) {
  308. util::fail('没有找到批发店,rid-186-' . $shopId);
  309. }
  310. if ($current->ptStyle != dict::getDict('ptStyle', 'ghs')) {
  311. util::fail('没有找到批发店,rid-195-' . $shopId);
  312. }
  313. $ghs = GhsClass::build($shopId, $this->shopId);
  314. //是否有充值送红包活动
  315. $ghsShopId = $ghs['shopId'] ?? 0;
  316. $ghsShop = ShopClass::getById($ghsShopId, true);
  317. $ghs['hasRechargeHb'] = $ghsShop->recharge ?? 0;
  318. $ghs['hasRechargeHbAmount'] = 0;
  319. $avatar = $ghs['avatar'] ?? '';
  320. $ghs['avatar'] = imgUtil::groupImg($avatar);
  321. $map = CustomClass::$nickNameMap;
  322. $giveLevel = $ghs['giveLevel'] ?? 0;
  323. $ghs['giveLevelName'] = $map[$giveLevel] ?? '';
  324. $ghs['showSold'] = $ghsShop->showSold ?? 0;
  325. $ghs['buyNotice'] = $ghsShop->buyNotice ?? 0;
  326. $shopExt = ShopExtClass::getByCondition(['shopId' => $ghsShopId], true, false, 'id,shopId,purchaseGuideText');
  327. $ghs['buyNoticeText'] = $shopExt->purchaseGuideText ?? '';
  328. $ghs['xrFl'] = $ghsShop->xrFl ?? 0;
  329. $ghs['xrFlAmount'] = $ghsShop->xrFlAmount ?? 0;
  330. $ghs['tjFl'] = $ghsShop->tjFl ?? 0;
  331. $ghs['tjFlAmount'] = $ghsShop->tjFlAmount ?? 0;
  332. $ghs['lsShopId'] = $ghsShop->lsShopId ?? 0;
  333. $ghs['presell'] = $ghsShop->presell ?? 0;
  334. $shareLogo = imgUtil::groupImg('buy_logo.jpg');
  335. if (isset($ghsShop->shareLogo) && !empty($ghsShop->shareLogo)) {
  336. $shareLogo = imgUtil::groupImg($ghsShop->shareLogo);
  337. }
  338. $ghs['shareLogo'] = $shareLogo;
  339. $ghs['telephone'] = $ghsShop->telephone ?? '';
  340. $ghs['superWx'] = '';
  341. if (!empty($ghsShop->superWx)) {
  342. $ghs['superWx'] = imgUtil::groupImg($ghsShop->superWx);
  343. }
  344. $ghs['transCost'] = dict::getDict('transCost', null, null, $ghsShop->mainId);
  345. //这个多处要补充的地方 add_pfLevel_many_place
  346. $ghs['pfLevel'] = $ghsShop->pfLevel ?? 0;
  347. //是否使用新的配送方式,关键词 sh_method_area
  348. $newShMethod = dict::getNewMethodShop();
  349. $ghs['useNewShMethod'] = in_array($ghsShopId, $newShMethod) ? 1 : 0;
  350. } else {
  351. //没有开店也给显示供货商信息
  352. $shop = ShopClass::getShopInfo($shopId);
  353. $shopName = $shop['shopName'] ?? '';
  354. $sjName = $shop['merchantName'] ?? '';
  355. $avatar = $shop['avatar'] ?? '';
  356. $default = $shop['default'] ?? 0;
  357. $name = $default == 1 && $shopName == '首店' ? $sjName : $sjName . ' ' . $shopName;
  358. $ghs = [
  359. 'id' => 0,
  360. 'name' => $name,
  361. 'debtAmount' => 0.00,
  362. 'expendAmount' => 0.00,
  363. 'giveLevel' => 0,
  364. 'giveLevelName' => '普通',
  365. 'xrFl' => 0,
  366. 'xrFlAmount' => 0,
  367. 'tjFl' => 0,
  368. 'tjFlAmount' => 0,
  369. 'avatar' => $avatar,
  370. 'showSold' => 0,
  371. 'buyNotice' => 0,
  372. 'lsShopId' => 0,
  373. 'presell' => 0,
  374. 'shareLogo' => '',
  375. 'superWx' => '',
  376. 'transCost' => [],
  377. ];
  378. }
  379. util::success($ghs);
  380. }
  381. //获取客户等级 ssh 20211016
  382. public function actionGetCustomLevel()
  383. {
  384. $id = Yii::$app->request->get('id');
  385. $info = GhsClass::getById($id, true);
  386. GhsClass::valid($info, $this->shopId);
  387. $ghsShopId = $info->shopId ?? 0;
  388. $info = CustomLevelClass::getByCondition(['shopId' => $ghsShopId]);
  389. $map = self::$levelMap;
  390. foreach ($map as $key => $val) {
  391. $flag = $val['key'] ?? '';
  392. if (empty($flag)) {
  393. $map[$key]['num'] = $info["num"] ?? 0;
  394. $map[$key]['amount'] = $info["amount"] ?? 0;
  395. } else {
  396. $map[$key]['num'] = $info[$flag . "Num"] ?? 0;
  397. $map[$key]['amount'] = $info[$flag . "Amount"] ?? 0;
  398. }
  399. }
  400. util::success(['list' => $map]);
  401. }
  402. //访问供货商的商城 ssh 20211022
  403. public function actionVisitMall()
  404. {
  405. $id = Yii::$app->request->get('id');
  406. $info = GhsClass::getById($id, true);
  407. GhsClass::valid($info, $this->shopId);
  408. $customId = $info->customId ?? 0;
  409. $custom = CustomClass::getById($customId, true);
  410. if (empty($custom)) {
  411. util::fail('没有找到客户');
  412. }
  413. if ($custom->black == 1) {
  414. //没有列入黑名单的,增加访客记录
  415. StatVisitClass::addGhsCustomVisit($info, $custom);
  416. }
  417. util::complete();
  418. }
  419. //补充缺失的供货商 ssh 20211027
  420. public function actionBcGhs()
  421. {
  422. util::fail('过几天再试');
  423. GhsClass::bcGhs($this->shopId);
  424. util::complete('载入成功');
  425. }
  426. //寻找附近批发店
  427. public function actionSearchNearbyGhs()
  428. {
  429. //util::complete();
  430. $get = Yii::$app->request->get();
  431. $locationType = $get['locationType'];
  432. $toLat = $get['lat'] ?? '';
  433. $toLnt = $get['long'] ?? '';
  434. if ($toLat == '' || $toLnt == '') {
  435. util::fail('未获取到定位数据');
  436. }
  437. if ($locationType == 'wgs84') {
  438. // WGS84 → GCJ-02 转换
  439. $re = mapUtil::wgs84ToGcj02($toLnt, $toLat);
  440. $toLat = $re['lat'];
  441. $toLnt = $re['lng'];
  442. }
  443. $gs = GhsClass::getByCondition(['ownShopId' => $this->shopId], true);
  444. if (!empty($gs)) {
  445. util::fail('已有批发商了');
  446. }
  447. $shop = $this->shop;
  448. $mobile = $shop->mobile;
  449. $name = $shop->merchantName ?? '';
  450. $city = $shop->city ?? '';
  451. $address = $shop->address ?? '';
  452. noticeUtil::push("有新花店上来 {$this->shopId} {$toLat} {$toLnt} {$locationType} {$city}{$address}", '15280215347');
  453. // 找出附近批发店,之后自动给建立关系,然后补充二个店之间的距离
  454. GhsClass::buildNearbyGhsRelations($this->shopId, $this->shop->pfShopId ?? 0, $toLat, $toLnt);
  455. noticeUtil::push("花店 {$name} {$mobile} 新注册,已推荐批发店", '15280215347');
  456. util::complete();
  457. }
  458. public function actionCommonInfo()
  459. {
  460. $get = Yii::$app->request->get();
  461. $ghsId = intval($get['ghsId'] ?? 0);
  462. $ghs = GhsClass::getById($ghsId);
  463. if (empty($ghs)) {
  464. util::fail('没有找到批发店');
  465. }
  466. if ($ghs['ownMainId'] != $this->mainId) {
  467. util::fail('不是你的批发店');
  468. }
  469. $mainId = $ghs['mainId'] ?? 0;
  470. // 通用接口返回全部有效公告,前端按 positions 字段筛选展示位置
  471. $ghsNoticeList = GhsNoticeClass::getClientNoticeList($mainId);
  472. util::success(['ghsNoticeList' => $ghsNoticeList]);
  473. }
  474. /**
  475. * 批发商公告详情(零售端采购页查看)
  476. */
  477. public function actionGhsNoticeDetail()
  478. {
  479. $id = intval(Yii::$app->request->get('id', 0));
  480. if ($id <= 0) {
  481. util::fail('公告id不对');
  482. }
  483. util::success(GhsNoticeClass::getClientDetail($id));
  484. }
  485. }