StoreIntegralServices.php 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
  4. // +----------------------------------------------------------------------
  5. // | Copyright (c) 2016~2020 https://www.crmeb.com All rights reserved.
  6. // +----------------------------------------------------------------------
  7. // | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
  8. // +----------------------------------------------------------------------
  9. // | Author: CRMEB Team <admin@crmeb.com>
  10. // +----------------------------------------------------------------------
  11. declare (strict_types=1);
  12. namespace app\services\activity\integral;
  13. use app\Request;
  14. use app\services\BaseServices;
  15. use app\dao\activity\integral\StoreIntegralDao;
  16. use app\services\diy\DiyServices;
  17. use app\services\product\ensure\StoreProductEnsureServices;
  18. use app\services\product\label\StoreProductLabelServices;
  19. use app\services\product\product\StoreDescriptionServices;
  20. use app\services\product\product\StoreProductServices;
  21. use app\services\product\sku\StoreProductAttrResultServices;
  22. use app\services\product\sku\StoreProductAttrServices;
  23. use app\services\product\sku\StoreProductAttrValueServices;
  24. use app\jobs\product\ProductLogJob;
  25. use crmeb\exceptions\AdminException;
  26. use crmeb\services\CacheService;
  27. use think\exception\ValidateException;
  28. /**
  29. *
  30. * Class StoreIntegralServices
  31. * @package app\services\activity\integral
  32. * @mixin StoreIntegralDao
  33. */
  34. class StoreIntegralServices extends BaseServices
  35. {
  36. const THODLCEG = 'ykGUKB';
  37. /**
  38. * 商品活动类型
  39. */
  40. const TYPE = 4;
  41. /**
  42. * StoreIntegralServices constructor.
  43. * @param StoreIntegralDao $dao
  44. */
  45. public function __construct(StoreIntegralDao $dao)
  46. {
  47. $this->dao = $dao;
  48. }
  49. /**
  50. * 获取指定条件下的条数
  51. * @param array $where
  52. */
  53. public function getCount(array $where)
  54. {
  55. $this->dao->count($where);
  56. }
  57. /**
  58. * 积分商品添加
  59. * @param int $id
  60. * @param array $data
  61. */
  62. public function saveData(int $id, array $data)
  63. {
  64. if ($data['freight'] == 2 && !$data['postage']) {
  65. throw new AdminException('请设置运费金额');
  66. }
  67. if ($data['freight'] == 3 && !$data['temp_id']) {
  68. throw new AdminException('请选择运费模版');
  69. }
  70. /** @var StoreProductServices $storeProductServices */
  71. $storeProductServices = app()->make(StoreProductServices::class);
  72. $productInfo = $storeProductServices->getOne(['is_show' => 1, 'is_del' => 0, 'is_verify' => 1, 'id' => $data['product_id']]);
  73. if (!$productInfo) {
  74. throw new AdminException('原商品已下架或移入回收站');
  75. }
  76. if ($productInfo['is_vip_product'] || $productInfo['is_presale_product']) {
  77. throw new AdminException('该商品是预售或svip专享');
  78. }
  79. $data['product_type'] = $productInfo['product_type'];
  80. if (!$data['delivery_type']) {
  81. $data['delivery_type'] = $productInfo['delivery_type'];
  82. }
  83. $data['type'] = $productInfo['type'] ?? 0;
  84. $data['relation_id'] = $productInfo['relation_id'] ?? 0;
  85. $custom_form = $productInfo['custom_form'] ?? [];
  86. $data['custom_form'] = is_array($custom_form) ? json_encode($custom_form) : $custom_form;
  87. $data['system_form_id'] = $productInfo['system_form_id'] ?? 0;
  88. $store_label_id = $productInfo['store_label_id'] ?? [];
  89. $data['store_label_id'] = is_array($store_label_id) ? implode(',', $store_label_id) : $store_label_id;
  90. $ensure_id = $productInfo['ensure_id'] ?? [];
  91. $data['ensure_id'] = is_array($ensure_id) ? implode(',', $ensure_id) : $ensure_id;
  92. $specs = $productInfo['specs'] ?? [];
  93. $data['specs'] = is_array($specs) ? json_encode($specs) : $specs;
  94. $description = $data['description'];
  95. $detail = $data['attrs'];
  96. if ($detail) {
  97. foreach ($detail as $attr) {
  98. if ($attr['quota'] > $attr['stock']) {
  99. throw new AdminException('限量超过了商品库存');
  100. }
  101. }
  102. }
  103. $items = $data['items'];
  104. $data['image'] = $data['images'][0] ?? '';
  105. $data['images'] = json_encode($data['images']);
  106. $integral_data = array_column($detail, 'integral', 'price');
  107. $data['integral'] = $integral_data ? (int)min($integral_data) : 0;
  108. $data['price'] = array_search($data['integral'], $integral_data);
  109. $data['quota'] = $data['quota_show'] = array_sum(array_column($detail, 'quota'));
  110. if ($data['quota'] > $storeProductServices->value(['id' => $data['product_id']], 'stock')) {
  111. throw new ValidateException('限量不能超过商品库存');
  112. }
  113. $data['stock'] = array_sum(array_column($detail, 'stock'));
  114. unset($data['section_time'], $data['description'], $data['attrs'], $data['items']);
  115. /** @var StoreDescriptionServices $storeDescriptionServices */
  116. $storeDescriptionServices = app()->make(StoreDescriptionServices::class);
  117. /** @var StoreProductAttrServices $storeProductAttrServices */
  118. $storeProductAttrServices = app()->make(StoreProductAttrServices::class);
  119. $this->transaction(function () use ($id, $data, $description, $detail, $items, $storeDescriptionServices, $storeProductAttrServices, $storeProductServices) {
  120. if ($id) {
  121. $res = $this->dao->update($id, $data);
  122. if (!$res) throw new AdminException('修改失败');
  123. } else {
  124. if (!$storeProductServices->getOne(['is_show' => 1, 'is_del' => 0, 'is_verify' => 1, 'id' => $data['product_id']])) {
  125. throw new AdminException('原商品已下架或移入回收站');
  126. }
  127. $data['add_time'] = time();
  128. $res = $this->dao->save($data);
  129. if (!$res) throw new AdminException('添加失败');
  130. $id = (int)$res->id;
  131. }
  132. $storeDescriptionServices->saveDescription((int)$id, $description, 4);
  133. $skuList = $storeProductAttrServices->validateProductAttr($items, $detail, (int)$id, 4);
  134. $valueGroup = $storeProductAttrServices->saveProductAttr($skuList, (int)$id, 4);
  135. $res = true;
  136. foreach ($valueGroup as $item) {
  137. $res = $res && CacheService::setStock($item['unique'], (int)$item['quota_show'], 4);
  138. }
  139. if (!$res) {
  140. throw new AdminException('占用库存失败');
  141. }
  142. });
  143. }
  144. /**
  145. * 批量添加商品
  146. * @param array $data
  147. */
  148. public function saveBatchData(array $data)
  149. {
  150. /** @var StoreProductServices $service */
  151. $service = app()->make(StoreProductServices::class);
  152. /** @var StoreDescriptionServices $storeDescriptionServices */
  153. $storeDescriptionServices = app()->make(StoreDescriptionServices::class);
  154. /** @var StoreProductAttrResultServices $storeProductAttrResultServices */
  155. $storeProductAttrResultServices = app()->make(StoreProductAttrResultServices::class);
  156. if (!$data) {
  157. throw new ValidateException('请先添加产品!');
  158. }
  159. $attrs = [];
  160. foreach ($data['attrs'] as $k => $v) {
  161. $attrs[$v['product_id']][] = $v;
  162. }
  163. foreach ($attrs as $k => $v) {
  164. $productInfo = $service->getOne(['id' => $k]);
  165. $productInfo = is_object($productInfo) ? $productInfo->toArray() : [];
  166. if ($productInfo) {
  167. $product = [];
  168. $result = $storeProductAttrResultServices->getResult(['product_id' => $productInfo['id'], 'type' => 0]);
  169. $product['product_id'] = $productInfo['id'];
  170. $product['description'] = $storeDescriptionServices->getDescription(['product_id' => $productInfo['id'], 'type' => 0]);
  171. $product['attrs'] = $v;
  172. $product['items'] = $result['attr'];
  173. $product['is_show'] = isset($data['is_show']) ? $data['is_show'] : 0;
  174. $product['title'] = $productInfo['store_name'];
  175. $product['unit_name'] = $productInfo['unit_name'];
  176. $product['image'] = $productInfo['image'];
  177. $product['images'] = $productInfo['slider_image'];
  178. $product['num'] = 0;
  179. $product['is_host'] = 0;
  180. $product['once_num'] = 0;
  181. $product['sort'] = 0;
  182. $this->saveData(0, $product);
  183. }
  184. }
  185. return true;
  186. }
  187. /**
  188. * 积分商品列表
  189. * @param array $where
  190. * @return array
  191. */
  192. public function systemPage(array $where)
  193. {
  194. [$page, $limit] = $this->getPageValue();
  195. $list = $this->dao->getList($where, $page, $limit);
  196. $count = $this->dao->count($where);
  197. return compact('list', 'count');
  198. }
  199. /**
  200. * 获取详情
  201. * @param int $id
  202. * @return array|\think\Model|null
  203. */
  204. public function getInfo(int $id)
  205. {
  206. $info = $this->dao->get($id);
  207. if (!$info) {
  208. throw new ValidateException('查看的商品不存在!');
  209. }
  210. if ($info->is_del) {
  211. throw new ValidateException('您查看的积分商品已被删除!');
  212. }
  213. $info['price'] = floatval($info['price']);
  214. /** @var StoreDescriptionServices $storeDescriptionServices */
  215. $storeDescriptionServices = app()->make(StoreDescriptionServices::class);
  216. $info['description'] = $storeDescriptionServices->getDescription(['product_id' => $id, 'type' => 4]);
  217. $info['attrs'] = $this->attrList($id, $info['product_id']);
  218. return $info;
  219. }
  220. /**
  221. * 获取规格
  222. * @param int $id
  223. * @param int $pid
  224. * @return mixed
  225. */
  226. public function attrList(int $id, int $pid)
  227. {
  228. /** @var StoreProductAttrResultServices $storeProductAttrResultServices */
  229. $storeProductAttrResultServices = app()->make(StoreProductAttrResultServices::class);
  230. $combinationResult = $storeProductAttrResultServices->value(['product_id' => $id, 'type' => 4], 'result');
  231. $items = json_decode($combinationResult, true)['attr'];
  232. $productAttr = $this->getAttr($items, $pid, 0);
  233. $combinationAttr = $this->getAttr($items, $id, 4);
  234. foreach ($productAttr as $pk => $pv) {
  235. foreach ($combinationAttr as &$sv) {
  236. if ($pv['detail'] == $sv['detail']) {
  237. $productAttr[$pk] = $sv;
  238. }
  239. }
  240. $productAttr[$pk]['detail'] = json_decode($productAttr[$pk]['detail']);
  241. }
  242. $attrs['items'] = $items;
  243. $attrs['value'] = $productAttr;
  244. foreach ($items as $key => $item) {
  245. $header[] = ['title' => $item['value'], 'key' => 'value' . ($key + 1), 'align' => 'center', 'minWidth' => 80];
  246. }
  247. $header[] = ['title' => '图片', 'slot' => 'pic', 'align' => 'center', 'minWidth' => 120];
  248. $header[] = ['title' => '兑换积分', 'key' => 'integral', 'type' => 1, 'align' => 'center', 'minWidth' => 80];
  249. $header[] = ['title' => '金额', 'key' => 'price', 'type' => 1, 'align' => 'center', 'minWidth' => 80];
  250. $header[] = ['title' => '库存', 'key' => 'stock', 'align' => 'center', 'minWidth' => 80];
  251. $header[] = ['title' => '兑换次数', 'key' => 'quota', 'type' => 1, 'align' => 'center', 'minWidth' => 80];
  252. $header[] = ['title' => '重量(KG)', 'key' => 'weight', 'align' => 'center', 'minWidth' => 80];
  253. $header[] = ['title' => '体积(m³)', 'key' => 'volume', 'align' => 'center', 'minWidth' => 80];
  254. $header[] = ['title' => '商品编号', 'key' => 'bar_code', 'align' => 'center', 'minWidth' => 80];
  255. $attrs['header'] = $header;
  256. return $attrs;
  257. }
  258. /**
  259. * 获得规格
  260. * @param $attr
  261. * @param $id
  262. * @param $type
  263. * @return array
  264. */
  265. public function getAttr($attr, $id, $type)
  266. {
  267. /** @var StoreProductAttrValueServices $storeProductAttrValueServices */
  268. $storeProductAttrValueServices = app()->make(StoreProductAttrValueServices::class);
  269. $value = attr_format($attr)[1];
  270. $valueNew = [];
  271. $count = 0;
  272. foreach ($value as $key => $item) {
  273. $detail = $item['detail'];
  274. $suk = implode(',', $item['detail']);
  275. $sukValue = $storeProductAttrValueServices->getSkuArray(['product_id' => $id, 'type' => $type, 'suk' => $suk], 'bar_code,cost,price,integral,ot_price,stock,image as pic,weight,volume,brokerage,brokerage_two,quota,quota_show', 'suk');
  276. if (count($sukValue)) {
  277. foreach (array_values($detail) as $k => $v) {
  278. $valueNew[$count]['value' . ($k + 1)] = $v;
  279. }
  280. $valueNew[$count]['detail'] = json_encode($detail);
  281. $valueNew[$count]['pic'] = $sukValue[$suk]['pic'] ?? '';
  282. $valueNew[$count]['integral'] = isset($sukValue[$suk]['integral']) ? floatval($sukValue[$suk]['integral']) : 0;
  283. $valueNew[$count]['price'] = $sukValue[$suk]['price'] ? floatval($sukValue[$suk]['price']) : 0;
  284. $valueNew[$count]['cost'] = $sukValue[$suk]['cost'] ? floatval($sukValue[$suk]['cost']) : 0;
  285. $valueNew[$count]['ot_price'] = isset($sukValue[$suk]['ot_price']) ? floatval($sukValue[$suk]['ot_price']) : 0;
  286. $valueNew[$count]['stock'] = $sukValue[$suk]['stock'] ? intval($sukValue[$suk]['stock']) : 0;
  287. // $valueNew[$count]['quota'] = $sukValue[$suk]['quota'] ? intval($sukValue[$suk]['quota']) : 0;
  288. $valueNew[$count]['quota'] = isset($sukValue[$suk]['quota_show']) && $sukValue[$suk]['quota_show'] ? intval($sukValue[$suk]['quota_show']) : 0;
  289. $valueNew[$count]['bar_code'] = $sukValue[$suk]['bar_code'] ?? '';
  290. $valueNew[$count]['weight'] = $sukValue[$suk]['weight'] ? floatval($sukValue[$suk]['weight']) : 0;
  291. $valueNew[$count]['volume'] = $sukValue[$suk]['volume'] ? floatval($sukValue[$suk]['volume']) : 0;
  292. $valueNew[$count]['brokerage'] = $sukValue[$suk]['brokerage'] ? floatval($sukValue[$suk]['brokerage']) : 0;
  293. $valueNew[$count]['brokerage_two'] = $sukValue[$suk]['brokerage_two'] ? floatval($sukValue[$suk]['brokerage_two']) : 0;
  294. $valueNew[$count]['_checked'] = $type != 0;
  295. $count++;
  296. }
  297. }
  298. return $valueNew;
  299. }
  300. /**
  301. * 积分商品详情
  302. * @param Request $request
  303. * @param int $id
  304. * @return mixed
  305. * @throws \think\db\exception\DataNotFoundException
  306. * @throws \think\db\exception\DbException
  307. * @throws \think\db\exception\ModelNotFoundException
  308. */
  309. public function integralDetail(Request $request, int $id)
  310. {
  311. $storeInfo = $this->dao->getOne(['id' => $id], '*', ['getPrice']);
  312. if (!$storeInfo) {
  313. throw new ValidateException('商品不存在');
  314. } else {
  315. $storeInfo = $storeInfo->toArray();
  316. }
  317. /** @var DiyServices $diyServices */
  318. $diyServices = app()->make(DiyServices::class);
  319. $infoDiy = $diyServices->getProductDetailDiy();
  320. //diy控制参数
  321. if (!isset($infoDiy['is_specs']) || !$infoDiy['is_specs']) {
  322. $storeInfo['specs'] = [];
  323. }
  324. $siteUrl = sys_config('site_url');
  325. $storeInfo['image'] = set_file_url($storeInfo['image'], $siteUrl);
  326. $storeInfo['image_base'] = set_file_url($storeInfo['image'], $siteUrl);
  327. $storeInfo['sale_stock'] = 0;
  328. if ($storeInfo['stock'] > 0) $storeInfo['sale_stock'] = 1;
  329. $uid = $request->uid();
  330. /** @var StoreDescriptionServices $storeDescriptionService */
  331. $storeDescriptionService = app()->make(StoreDescriptionServices::class);
  332. $storeInfo['description'] = $storeDescriptionService->getDescription(['product_id' => $id, 'type' => 4]);
  333. $storeInfo['store_label'] = $storeInfo['ensure'] = [];
  334. if ($storeInfo['store_label_id']) {
  335. /** @var StoreProductLabelServices $storeProductLabelServices */
  336. $storeProductLabelServices = app()->make(StoreProductLabelServices::class);
  337. $storeInfo['store_label'] = $storeProductLabelServices->getColumn([['id', 'in', $storeInfo['store_label_id']]], 'id,label_name');
  338. }
  339. if ($storeInfo['ensure_id'] && isset($infoDiy['is_ensure']) && $infoDiy['is_ensure']) {
  340. /** @var StoreProductEnsureServices $storeProductEnsureServices */
  341. $storeProductEnsureServices = app()->make(StoreProductEnsureServices::class);
  342. $storeInfo['ensure'] = $storeProductEnsureServices->getColumn([['id', 'in', $storeInfo['ensure_id']]], 'id,name,image,desc');
  343. }
  344. $storeInfo['small_image'] = get_thumb_water($storeInfo['image']);
  345. $data['storeInfo'] = $storeInfo;
  346. /** @var StoreProductAttrServices $storeProductAttrServices */
  347. $storeProductAttrServices = app()->make(StoreProductAttrServices::class);
  348. [$productAttr, $productValue] = $storeProductAttrServices->getProductAttrDetail($id, $uid, 0, 4, $storeInfo['product_id']);
  349. $data['productAttr'] = $productAttr;
  350. $data['productValue'] = $productValue;
  351. //浏览记录
  352. ProductLogJob::dispatch(['visit', ['uid' => $uid, 'id' => $id, 'product_id' => $storeInfo['product_id']], 'integral']);
  353. return $data;
  354. }
  355. /**
  356. * 修改销量和库存
  357. * @param $num
  358. * @param $integralId
  359. * @return bool
  360. */
  361. public function decIntegralStock(int $num, int $integralId, string $unique)
  362. {
  363. $product_id = $this->dao->value(['id' => $integralId], 'product_id');
  364. if ($unique) {
  365. /** @var StoreProductAttrValueServices $skuValueServices */
  366. $skuValueServices = app()->make(StoreProductAttrValueServices::class);
  367. //减去积分商品的sku库存增加销量
  368. $res = false !== $skuValueServices->dao->decStockIncSalesDecQuota(['product_id' => $integralId, 'unique' => $unique, 'type' => 4], $num);
  369. //减去积分商品库存
  370. $res = $res && $this->dao->decStockIncSales(['id' => $integralId, 'type' => 4], $num);
  371. //获取拼团的sku
  372. $sku = $skuValueServices->value(['product_id' => $integralId, 'unique' => $unique, 'type' => 4], 'suk');
  373. //减去当前普通商品sku的库存增加销量
  374. $res = $res && $skuValueServices->decStockIncSales(['product_id' => $product_id, 'suk' => $sku, 'type' => 0], $num);
  375. } else {
  376. $res = false !== $this->dao->decStockIncSales(['id' => $integralId, 'type' => 4], $num);
  377. }
  378. /** @var StoreProductServices $services */
  379. $services = app()->make(StoreProductServices::class);
  380. //减去普通商品库存
  381. $res = $res && $services->decProductStock($num, $product_id);
  382. return $res;
  383. }
  384. /**
  385. * 获取一条积分商品
  386. * @param $id
  387. * @return mixed
  388. */
  389. public function getIntegralOne($id)
  390. {
  391. return $this->dao->validProduct($id, '*');
  392. }
  393. /**
  394. * 验证积分商品下单库存限量
  395. * @param int $uid
  396. * @param int $integralId
  397. * @param int $num
  398. * @param string $unique
  399. * @return array
  400. * @throws \think\db\exception\DataNotFoundException
  401. * @throws \think\db\exception\DbException
  402. * @throws \think\db\exception\ModelNotFoundException
  403. */
  404. public function checkoutProductStock(int $uid, int $integralId, int $num = 1, string $unique = '')
  405. {
  406. /** @var StoreProductAttrValueServices $attrValueServices */
  407. $attrValueServices = app()->make(StoreProductAttrValueServices::class);
  408. if ($unique == '') {
  409. $unique = $attrValueServices->value(['product_id' => $integralId, 'type' => 4], 'unique');
  410. }
  411. $StoreIntegralInfo = $this->getIntegralOne($integralId);
  412. if (!$StoreIntegralInfo) {
  413. throw new ValidateException('该商品已下架或删除');
  414. }
  415. /** @var StoreIntegralOrderServices $orderServices */
  416. $orderServices = app()->make(StoreIntegralOrderServices::class);
  417. $userBuyCount = $orderServices->getBuyCount($uid, $integralId);
  418. if ($StoreIntegralInfo['once_num'] < $num && $StoreIntegralInfo['once_num'] != -1) {
  419. throw new ValidateException('每个订单限购' . $StoreIntegralInfo['once_num'] . '件');
  420. }
  421. if ($StoreIntegralInfo['num'] < ($userBuyCount + $num) && $StoreIntegralInfo['num'] != -1) {
  422. throw new ValidateException('每人总共限购' . $StoreIntegralInfo['num'] . '件');
  423. }
  424. $attrInfo = $attrValueServices->getOne(['product_id' => $integralId, 'unique' => $unique, 'type' => 4]);
  425. if ($num > $attrInfo['quota']) {
  426. throw new ValidateException('该商品库存不足' . $num);
  427. }
  428. $product_stock = $attrValueServices->value(['product_id' => $StoreIntegralInfo['product_id'], 'suk' => $attrInfo['suk'], 'type' => 0], 'stock');
  429. if ($product_stock < $num) {
  430. throw new ValidateException('该商品库存不足' . $num);
  431. }
  432. if (!CacheService::checkStock($unique, $num, 4)) {
  433. throw new ValidateException('该商品库存不足' . $num);
  434. }
  435. return [$attrInfo, $unique, $StoreIntegralInfo];
  436. }
  437. /**
  438. * 获取推荐积分商品
  439. * @return array
  440. * @throws \think\db\exception\DataNotFoundException
  441. * @throws \think\db\exception\DbException
  442. * @throws \think\db\exception\ModelNotFoundException
  443. */
  444. public function getIntegralList(array $where)
  445. {
  446. [$page, $limit] = $this->getPageValue();
  447. $list = $this->dao->getList($where, $page, $limit, 'id,image,title,integral,price,sales');
  448. return $list;
  449. }
  450. /**
  451. * 获取全部积分商品
  452. * @return array
  453. * @throws \think\db\exception\DataNotFoundException
  454. * @throws \think\db\exception\DbException
  455. * @throws \think\db\exception\ModelNotFoundException
  456. */
  457. public function getAllIntegralList(array $where)
  458. {
  459. $list = $this->dao->getList($where, 0, 0, 'id,image,title,integral,price,sales');
  460. return $list;
  461. }
  462. }