GoodsController.php 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537
  1. <?php
  2. namespace backend\controllers;
  3. use biz\goods\services\CategoryRelateService;
  4. use biz\goods\services\GoodsUsageService;
  5. use biz\goods\services\UsageRelationService;
  6. use biz\tool\services\CouponModelService;
  7. use Yii;
  8. use yii\helpers\Json;
  9. use common\services\xhGoodsSettingService;
  10. use common\components\configDict;
  11. use common\services\xhRecommendService;
  12. use common\components\util;
  13. use common\components\qrCodeUtil;
  14. use common\models\xhGoods;
  15. use common\services\xhGoodsService;
  16. use common\services\xhGoodsPriceService;
  17. use common\services\xhTMessageService;
  18. use common\services\xhCategoryService;
  19. use common\components\page;
  20. use common\services\xhAdminToMerchantService;
  21. use common\services\xhWxOpenService;
  22. use common\components\weixinUtil;
  23. use common\services\xhAdminService;
  24. use common\services\xhMerchantService;
  25. class GoodsController extends BackendController
  26. {
  27. public function actionSold()
  28. {
  29. $get = Yii::$app->request->get();
  30. $query = xhGoods::find();
  31. $merchantId = $this->merchantId;
  32. $status = isset($get['status']) ? $get['status'] : -1;
  33. $query->where(['merchantId' => $merchantId]);
  34. if (isset($get['status']) && $get['status'] != -1) {
  35. $query->andWhere(['status' => $get['status']]);
  36. }
  37. $query->andWhere(['delStatus' => 0]);
  38. if (isset($get['goodsName']) && !empty($get['goodsName'])) {
  39. $query->andWhere(['like', 'goodsName', $get['goodsName']]);
  40. }
  41. $query->orderBy('id desc');
  42. $countQuery = clone $query;
  43. $count = $countQuery->count();
  44. $page = isset($get['page']) ? $get['page'] : 1;
  45. $pageSize = 20;
  46. $offset = ($page - 1) * $pageSize;
  47. $models = $query->offset($offset)->limit($pageSize)->asArray()->all();
  48. $page = new page($count, $page, $pageSize);
  49. $paging = $page->fpage();
  50. $goodsSet = xhGoodsSettingService::getByMerchantId($merchantId);//商品配置信息,包括涨价的
  51. $riseColumn = false;//未涨价前提前显示涨价栏目
  52. $rising = false;
  53. if (!empty($goodsSet)) {
  54. $setUpdateTime = $goodsSet['updateTime'];
  55. $endRiseTime = $goodsSet['endRiseTime'];
  56. $startRiseTime = $goodsSet['startRiseTime'];
  57. $noRise = configDict::getConfig('riseType', 'noRise');//不涨价
  58. $goodsSetRiseType = $goodsSet['riseType'];
  59. $now = time();
  60. if ($now > $setUpdateTime && $endRiseTime > $now && $goodsSetRiseType != $noRise) {//在修改涨价时间和结束涨价的期间,显示涨价栏目
  61. $riseColumn = true;
  62. }
  63. if ($now > $startRiseTime && $endRiseTime > $now && $goodsSetRiseType != $noRise) {//在开始涨价和结束涨价期间,价格上涨
  64. $rising = true;
  65. }
  66. }
  67. $riseType = configDict::getConfig('riseType');
  68. return $this->render('sold', ['models' => $models, 'riseColumn' => $riseColumn,
  69. 'riseType' => $riseType,
  70. 'goodsSet' => $goodsSet,
  71. 'paging' => $paging,
  72. 'status' => $status,
  73. 'rising' => $rising,
  74. ]);
  75. }
  76. public function actionPut()
  77. {
  78. $get = Yii::$app->request->get();
  79. $query = xhGoods::find();
  80. $merchantId = $this->merchantId;
  81. $status = isset($get['status']) ? $get['status'] : -1;
  82. $query->where(['merchantId' => $merchantId]);
  83. if (isset($get['status']) && $get['status'] != -1) {
  84. $query->andWhere(['status' => $get['status']]);
  85. }
  86. $query->andWhere(['delStatus' => 0]);
  87. if (isset($get['goodsName']) && !empty($get['goodsName'])) {
  88. $query->andWhere(['like', 'goodsName', $get['goodsName']]);
  89. }
  90. $query->orderBy('id desc');
  91. $countQuery = clone $query;
  92. $count = $countQuery->count();
  93. $page = isset($get['page']) ? $get['page'] : 1;
  94. $pageSize = 20;
  95. $offset = ($page - 1) * $pageSize;
  96. $models = $query->offset($offset)->limit($pageSize)->asArray()->all();
  97. $page = new page($count, $page, $pageSize);
  98. $paging = $page->fpage();
  99. $goodsSet = xhGoodsSettingService::getByMerchantId($merchantId);//商品配置信息,包括涨价的
  100. $riseColumn = false;//未涨价前提前显示涨价栏目
  101. $rising = false;
  102. if (!empty($goodsSet)) {
  103. $setUpdateTime = $goodsSet['updateTime'];
  104. $endRiseTime = $goodsSet['endRiseTime'];
  105. $startRiseTime = $goodsSet['startRiseTime'];
  106. $noRise = configDict::getConfig('riseType', 'noRise');//不涨价
  107. $goodsSetRiseType = $goodsSet['riseType'];
  108. $now = time();
  109. if ($now > $setUpdateTime && $endRiseTime > $now && $goodsSetRiseType != $noRise) {//在修改涨价时间和结束涨价的期间,显示涨价栏目
  110. $riseColumn = true;
  111. }
  112. if ($now > $startRiseTime && $endRiseTime > $now && $goodsSetRiseType != $noRise) {//在开始涨价和结束涨价期间,价格上涨
  113. $rising = true;
  114. }
  115. }
  116. $riseType = configDict::getConfig('riseType');
  117. return $this->render('put', ['models' => $models, 'riseColumn' => $riseColumn,
  118. 'riseType' => $riseType,
  119. 'goodsSet' => $goodsSet,
  120. 'paging' => $paging,
  121. 'status' => $status,
  122. 'rising' => $rising,
  123. ]);
  124. }
  125. /**
  126. * 商品列表
  127. */
  128. public function actionList()
  129. {
  130. $get = Yii::$app->request->get();
  131. $query = xhGoods::find();
  132. $merchantId = $this->merchantId;
  133. $status = isset($get['status']) ? $get['status'] : -1;
  134. $query->where(['merchantId' => $merchantId]);
  135. if (isset($get['status']) && $get['status'] != -1) {
  136. $query->andWhere(['status' => $get['status']]);
  137. }
  138. $query->andWhere(['delStatus' => 0]);
  139. if (isset($get['goodsName']) && !empty($get['goodsName'])) {
  140. $query->andWhere(['like', 'goodsName', $get['goodsName']]);
  141. }
  142. $query->orderBy('id desc');
  143. $countQuery = clone $query;
  144. $count = $countQuery->count();
  145. $page = isset($get['page']) ? $get['page'] : 1;
  146. $pageSize = 20;
  147. $offset = ($page - 1) * $pageSize;
  148. $models = $query->offset($offset)->limit($pageSize)->asArray()->all();
  149. $page = new page($count, $page, $pageSize);
  150. $paging = $page->fpage();
  151. $goodsSet = xhGoodsSettingService::getByMerchantId($merchantId);//商品配置信息,包括涨价的
  152. $riseColumn = false;//未涨价前提前显示涨价栏目
  153. $rising = false;
  154. if (!empty($goodsSet)) {
  155. $setUpdateTime = $goodsSet['updateTime'];
  156. $endRiseTime = $goodsSet['endRiseTime'];
  157. $startRiseTime = $goodsSet['startRiseTime'];
  158. $noRise = configDict::getConfig('riseType', 'noRise');//不涨价
  159. $goodsSetRiseType = $goodsSet['riseType'];
  160. $now = time();
  161. if ($now > $setUpdateTime && $endRiseTime > $now && $goodsSetRiseType != $noRise) {//在修改涨价时间和结束涨价的期间,显示涨价栏目
  162. $riseColumn = true;
  163. }
  164. if ($now > $startRiseTime && $endRiseTime > $now && $goodsSetRiseType != $noRise) {//在开始涨价和结束涨价期间,价格上涨
  165. $rising = true;
  166. }
  167. }
  168. $riseType = configDict::getConfig('riseType');
  169. return $this->render('list', ['models' => $models, 'riseColumn' => $riseColumn,
  170. 'riseType' => $riseType,
  171. 'goodsSet' => $goodsSet,
  172. 'paging' => $paging,
  173. 'status' => $status,
  174. 'rising' => $rising,
  175. ]);
  176. }
  177. public function actionModifyRisePrice()
  178. {
  179. $get = Yii::$app->request->get();
  180. $id = isset($get['id']) ? $get['id'] : 0;
  181. $riseAmount = isset($get['riseAmount']) ? $get['riseAmount'] : 0;
  182. $goods = xhGoodsService::getById($id);
  183. if ($goods['merchantId'] != $this->merchantId) {
  184. util::failInfo();
  185. }
  186. xhGoodsService::updateById($id, ['riseAmount' => $riseAmount]);
  187. $goods = xhGoodsService::getById($id);
  188. util::successInfo('修改成功', 'A0001', $goods);
  189. }
  190. /**
  191. * 添加商品
  192. */
  193. public function actionAdd()
  194. {
  195. //取分类
  196. $categoryList = CategoryRelateService::getCategoryList();
  197. $usageList = UsageRelationService::getMyUsage();
  198. return $this->render('add', ['categoryList' => $categoryList, 'usageList' => $usageList]);
  199. }
  200. /**
  201. * 保存添加的商品
  202. */
  203. public function actionSaveAdd()
  204. {
  205. $post = Yii::$app->request->post();
  206. if ($post['content'] == '') {
  207. util::failInfo('商品简介未填写');
  208. }
  209. $imgList = [];
  210. if (isset($post['shopImg1']) && !empty($post['shopImg1'])) {
  211. $imgList[] = $post['shopImg1'];
  212. }
  213. if (isset($post['shopImg2']) && !empty($post['shopImg2'])) {
  214. $imgList[] = $post['shopImg2'];
  215. }
  216. if (isset($post['shopImg3']) && !empty($post['shopImg3'])) {
  217. $imgList[] = $post['shopImg3'];
  218. }
  219. $post['shopImg'] = json_encode($imgList);
  220. //处理价格的选项
  221. if ($post['priceType'] == 'single') {
  222. $post['multiPrice'] = '';
  223. } elseif ($post['priceType'] == 'multi') {
  224. $post['price'] = min($post['multiPrice']);//保存一个最小价,用于展示(解决价格为0的问题)
  225. $goodTitle = $post['goodTitle'];
  226. $multiPrice = $post['multiPrice'];
  227. $multiImg = $post['multiImg'];;
  228. $idStr = xhGoodsPriceService::goodsMultiPriceAdd($goodTitle, $multiPrice, $multiImg);
  229. $post['multiPrice'] = $idStr;
  230. } else {
  231. throw new \Exception('价格的选项错误');
  232. exit();
  233. }
  234. $post['categoryId'] = implode(',', $post['categoryId']);
  235. $post['usageId'] = implode(',', $post['usageId']);
  236. xhGoodsService::addByAdmin($post, $this->merchant, $this->admin);
  237. $value = ['code' => 'A0001', 'msg' => '添加成功!', 'data' => []];
  238. echo Json::encode($value);
  239. }
  240. /**
  241. * 修改商品
  242. * @return
  243. */
  244. public function actionEdit()
  245. {
  246. $get = Yii::$app->request->get();
  247. if (isset($get['id']) == false) {
  248. $this->redirect(Yii::$app->request->referrer, true);
  249. Yii::$app->end();
  250. }
  251. $id = isset($get['id']) ? $get['id'] : 0;
  252. $aId = $this->adminId;
  253. $goods = xhGoodsService::getById($id);
  254. if (!empty($goods) && $goods['merchantId'] != $this->merchantId) {
  255. echo '访问出错,请联系网站管理员';
  256. Yii::$app->end();
  257. }
  258. $goodsCategory = [];
  259. $categoryString = isset($goods['categoryId']) ? $goods['categoryId'] : '';
  260. if (!empty($categoryString)) {
  261. $categoryArr = explode(',', $categoryString);
  262. $goodsCategory = array_filter($categoryArr);//删除空元素
  263. }
  264. $categoryList = CategoryRelateService::getCategoryList();
  265. //用途
  266. $usageList = UsageRelationService::getMyUsage();
  267. $goodsUsageList = GoodsUsageService::getGoodsUsageList($id);
  268. $goodsUsageIdList = array_column($goodsUsageList, 'usageId');
  269. //单个价格 与 多个价格的区分
  270. if ($goods['multiPrice'] != '') {
  271. $goods['price'] = 0;
  272. $multiPriceStr = $goods['multiPrice'];
  273. $goodsPriceArr = xhGoodsPriceService::getByIds($multiPriceStr);
  274. return $this->render('edit', [
  275. 'goods' => $goods, 'categoryList' => $categoryList, 'goodsCategory' => $goodsCategory, 'goodsPriceArr' => $goodsPriceArr,
  276. 'usageList' => $usageList, 'goodsUsageIdList' => $goodsUsageIdList,
  277. ]);
  278. }
  279. return $this->render('edit', [
  280. 'goods' => $goods, 'categoryList' => $categoryList, 'goodsCategory' => $goodsCategory, 'usageList' => $usageList, 'goodsUsageIdList' => $goodsUsageIdList,
  281. ]);
  282. }
  283. public function actionSaveEdit()
  284. {
  285. $post = Yii::$app->request->post();
  286. if ($post['content'] == '') {
  287. util::failInfo('商品简介未填写');
  288. }
  289. $id = isset($post['id']) ? $post['id'] : 0;
  290. $imgList = [];
  291. if (isset($post['shopImg1']) && !empty($post['shopImg1'])) {
  292. $imgList[] = $post['shopImg1'];
  293. }
  294. unset($post['shopImg1']);
  295. if (isset($post['shopImg2']) && !empty($post['shopImg2'])) {
  296. $imgList[] = $post['shopImg2'];
  297. }
  298. unset($post['shopImg2']);
  299. if (isset($post['shopImg3']) && !empty($post['shopImg3'])) {
  300. $imgList[] = $post['shopImg3'];
  301. }
  302. unset($post['shopImg3']);
  303. $post['shopImg'] = json_encode($imgList);
  304. $goods = xhGoodsService::getById($id);
  305. if (empty($goods) || $goods['merchantId'] != $this->merchantId) {
  306. util::failInfo('访问出错');
  307. }
  308. $multiPriceIds = $goods['multiPrice'];
  309. //单个价格 与 多个价格的区分与处理
  310. if ($post['priceType'] == 'single') {
  311. //清缓存 及 软删除之前的多价格数据
  312. xhGoodsPriceService::softDeleteIds($multiPriceIds);
  313. $post['multiPrice'] = '';
  314. } elseif ($post['priceType'] == 'multi') {
  315. $post['price'] = min($post['multiPrice']);//保存一个最小价,用于展示(解决价格为0的问题)
  316. $beforeIdArr = empty($multiPriceIds) ? $multiPriceIds : explode(',', $multiPriceIds);
  317. $idStr = xhGoodsPriceService::updateMultiPrice($beforeIdArr, $post);
  318. $post['multiPrice'] = (string)$idStr;
  319. } else {
  320. throw new \Exception('价格的选项错误');
  321. exit();
  322. }
  323. $post['status'] = (integer)$post['status'];
  324. $post['sold'] = (integer)$post['sold'];
  325. $post['categoryId'] = implode(',', $post['categoryId']);
  326. xhGoodsService::updateAllById($id, $post, $this->merchantId);
  327. util::successInfo('修改成功!');
  328. }
  329. /**
  330. * ajax查看商品详细
  331. * @return string
  332. */
  333. public function actionDetailAjax()
  334. {
  335. $get = Yii::$app->request->get();
  336. $id = isset($get['id']) ? $get['id'] : 0;
  337. $goods = xhGoodsService::getById($id);
  338. if (empty($goods) || $goods['merchantId'] != $this->merchantId) {
  339. echo '访问出错了,请联系网站管理员';
  340. Yii::$app->end();
  341. }
  342. $aId = $this->adminId;
  343. $category = xhCategoryService::getList($this->merchantId);//分类 id name数组
  344. return $this->renderPartial('detailAjax', ['goods' => $goods, 'category' => $category]);
  345. }
  346. /**
  347. * 根据id删除商品
  348. */
  349. public function actionDelAjax()
  350. {
  351. $aId = $this->adminId;
  352. $get = Yii::$app->request->get();
  353. $id = isset($get['id']) ? $get['id'] : 0;
  354. $goods = xhGoodsService::getById($id);
  355. if (empty($goods) || $goods['merchantId'] != $this->merchantId) {
  356. util::stop('非法删除');
  357. }
  358. xhGoodsService::delGoods($goods);
  359. util::successInfo('删除成功');
  360. }
  361. /**
  362. * 更新商品状态
  363. */
  364. public function actionUpdateStatus()
  365. {
  366. $get = Yii::$app->request->get();
  367. $id = isset($get['id']) ? $get['id'] : 0;
  368. $status = isset($get['status']) ? $get['status'] : 0;
  369. $goodsInfo = xhGoodsService::getById($id);
  370. if ($goodsInfo['merchantId'] != $this->merchantId) {
  371. util::failInfo();
  372. }
  373. xhGoodsService::updateById($id, ['status' => $status]);
  374. if ($status == 1) {//下架商品,首页推荐商品去除
  375. xhRecommendService::wipeGoodsId($id, $this->merchantId);
  376. }
  377. util::successInfo('更新成功');
  378. }
  379. /**
  380. * 生成商品的二维码地址
  381. */
  382. public function actionShowGoodsQrcode()
  383. {
  384. $get = Yii::$app->request->get();
  385. $id = isset($get['id']) ? $get['id'] : 0;
  386. $url = $this->frontUrl . '/mobile/goods-detail?id=' . $id . '&account=' . $this->merchant['id'];
  387. $merchantId = $this->merchantId;
  388. $logo = Yii::getAlias("@app") . '/../images' . $this->merchant['logo'];//取商家的logo
  389. $imgUrl = qrCodeUtil::generate($url, 'backend_shop_url_' . $merchantId . '_' . $id, $logo);
  390. $goods = xhGoodsService::getById($id);
  391. if (empty($goods) || $goods['merchantId'] != $merchantId) {
  392. echo Json::encode(['code' => 'A0002', 'msg' => '非法访问', 'data' => []]);
  393. Yii::$app->end();
  394. }
  395. xhGoodsService::updateById($id, ['urlQrCode' => $imgUrl]);
  396. echo Json::encode(['code' => 'A0001', 'msg' => 'success', 'data' => ['url' => $imgUrl]]);
  397. }
  398. public function actionGenerateShortUrl()
  399. {
  400. $get = Yii::$app->request->get();
  401. $goodsId = isset($get['goodsId']) ? $get['goodsId'] : 0;
  402. $goods = xhGoodsService::getById($goodsId);
  403. if (empty($goods['shortUrl'])) {
  404. $url = Yii::$app->params['frontUrl'] . "/mobile/goods-detail?id={$goodsId}&account=" . $this->merchant['id'];
  405. $wx = new weixinUtil($this->merchant);
  406. $return = $wx->generateShortUrl($url);
  407. if ($return['code'] == 'A0001') {
  408. xhGoodsService::updateById($goodsId, ['shortUrl' => $return['data']['shortUrl']]);
  409. util::encode($return);
  410. }
  411. util::failInfo();
  412. } else {
  413. util::successInfo('操作成功', 'A0001', ['shortUrl' => $goods['shortUrl']]);
  414. }
  415. }
  416. /**
  417. * 发送短链接到微信
  418. */
  419. public function actionSendUrl()
  420. {
  421. $get = Yii::$app->request->get();
  422. $goodsId = isset($get['goodsId']) ? $get['goodsId'] : 0;
  423. $goodsInfo = xhGoodsService::getById($goodsId);
  424. if (empty($goodsInfo['shortUrl'])) {
  425. util::failInfo();
  426. }
  427. $shortUrl = $goodsInfo['shortUrl'];
  428. $admin = xhAdminToMerchantService::getAdminByMerchantId($this->merchantId);
  429. weixinUtil::sendMsg($shortUrl, $this->merchant, $admin['openId']);
  430. util::successInfo();
  431. }
  432. /**
  433. * 发送模板消息链接到微信
  434. */
  435. public function actionSendGoodsUrl()
  436. {
  437. $get = Yii::$app->request->get();
  438. $goodsId = isset($get['goodsId']) ? $get['goodsId'] : 0;
  439. $goods = xhGoodsService::getById($goodsId);
  440. $name = $goods['goodsName'];
  441. $url = Yii::$app->params['frontUrl'] . "/mobile/goods-detail?id={$goodsId}&account=" . $this->merchant['id'];
  442. $admin = xhAdminToMerchantService::getAdminByMerchantId($this->merchantId);
  443. $openMerchant = xhWxOpenService::getMerchant();
  444. xhTMessageService::sendUrl($url, $name, $openMerchant, $admin);
  445. util::successInfo('已发送');
  446. }
  447. public function actionSetting()
  448. {
  449. $set = xhGoodsSettingService::getByMerchantId($this->merchantId);
  450. $riseTypeName = configDict::getConfig('riseTypeName');
  451. $byPercent = configDict::getConfig('riseType', 'percent');//按百分比涨价
  452. $byAmount = configDict::getConfig('riseType', 'amount');//按金额涨价
  453. $noRise = configDict::getConfig('riseType', 'noRise');//不涨价
  454. return $this->render('setting', ['set' => $set, 'riseTypeName' => $riseTypeName, 'noRise' => $noRise, 'byPercent' => $byPercent, 'byAmount' => $byAmount]);
  455. }
  456. public function actionPriceSetting()
  457. {
  458. {
  459. $set = xhGoodsSettingService::getByMerchantId($this->merchantId);
  460. $riseTypeName = configDict::getConfig('riseTypeName');
  461. $byPercent = configDict::getConfig('riseType', 'percent');//按百分比涨价
  462. $byAmount = configDict::getConfig('riseType', 'amount');//按金额涨价
  463. $noRise = configDict::getConfig('riseType', 'noRise');//不涨价
  464. return $this->render('priceSetting', ['set' => $set, 'riseTypeName' => $riseTypeName, 'noRise' => $noRise, 'byPercent' => $byPercent, 'byAmount' => $byAmount]);
  465. }
  466. }
  467. /**
  468. * 更新商品设置
  469. */
  470. public function actionSettingReplace()
  471. {
  472. $post = Yii::$app->request->post();
  473. $post['riseAmount'] = empty($post['riseAmount']) ? 0 : $post['riseAmount'];
  474. $post['startRiseTime'] = !empty($post['startRiseTime']) ? strtotime($post['startRiseTime']) : 0;
  475. $post['endRiseTime'] = !empty($post['endRiseTime']) ? strtotime($post['endRiseTime']) : 0;
  476. unset($post['_csrf']);
  477. $set = xhGoodsSettingService::getByMerchantId($this->merchantId);
  478. if (empty($set)) {
  479. $post['addTime'] = time();
  480. $post['createTime'] = date("Y-m-d H:i:s");
  481. $post['merchantId'] = $this->merchantId;
  482. xhGoodsSettingService::add($post, $this->merchantId);
  483. } else {
  484. xhGoodsSettingService::updateByMerchantId($this->merchantId, $post);
  485. }
  486. util::successInfo();
  487. }
  488. public function actionCategory()
  489. {
  490. $list = CategoryRelateService::getCategoryList();
  491. $categoryClassifyName = configDict::getConfig('categoryClassifyName');//商品、文章、图片等分类
  492. $categoryClassify = configDict::getConfig('categoryClassify');
  493. $couponList = CouponModelService::getCategoryCoupon();
  494. return $this->render('category', ['list' => $list, 'categoryClassifyName' => $categoryClassifyName, 'categoryClassify' => $categoryClassify, 'couponList' => $couponList]);
  495. }
  496. //商品用途 shish 2019.8.17
  497. public function actionUsage()
  498. {
  499. $list = UsageRelationService::getMyUsage();
  500. $couponList = CouponModelService::getUsageCoupon();
  501. return $this->render('usage', ['list' => $list, 'couponList' => $couponList]);
  502. }
  503. }