StatisticsDict.php 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | Niucloud-admin 企业快速开发的多应用管理平台
  4. // +----------------------------------------------------------------------
  5. // | 官方网址:https://www.niucloud.com
  6. // +----------------------------------------------------------------------
  7. // | niucloud团队 版权所有 开源版本可自由商用
  8. // +----------------------------------------------------------------------
  9. // | Author: Niucloud Team
  10. // +----------------------------------------------------------------------
  11. namespace addon\mall\app\dict\goods;
  12. class StatisticsDict
  13. {
  14. // 统计类型 access_num=访问次数(浏览量) cart_num=>加入购物车数量 sale_num=商品销量(下单数)pay_num=支付件数 collect_num=收藏数量 pay_money=支付总金额
  15. const ACCESS_NUM = 'access_num';
  16. const CART_NUM = 'cart_num';
  17. const SALE_NUM = 'sale_num';
  18. const PAY_NUM = 'pay_num';
  19. const COLLECT_NUM = 'collect_num';
  20. const PAY_MONEY = 'pay_money';
  21. const GOODS_VISIT_MEMBER_COUNT = 'goods_visit_member_count';
  22. /**
  23. * 排行周期
  24. * @param $type
  25. * @return array|mixed|string
  26. */
  27. public static function getType($type = '')
  28. {
  29. $data = [
  30. self::ACCESS_NUM => get_lang('dict_mall_goods_statistics_type.access_num'), // 访问次数(浏览量)
  31. self::GOODS_VISIT_MEMBER_COUNT => get_lang('dict_mall_goods_statistics_type.goods_visit_member_count'), // 访客数
  32. self::CART_NUM => get_lang('dict_mall_goods_statistics_type.cart_num'), // 加入购物车数量
  33. self::SALE_NUM => get_lang('dict_mall_goods_statistics_type.sale_num'), // 商品销量(下单数)
  34. self::PAY_NUM => get_lang('dict_mall_goods_statistics_type.pay_num'), // 支付件数
  35. self::PAY_MONEY => get_lang('dict_mall_goods_statistics_type.pay_money'), // 支付总金额
  36. self::COLLECT_NUM => get_lang('dict_mall_goods_statistics_type.collect_num'), // 收藏数量
  37. ];
  38. if (!$type) {
  39. return $data;
  40. }
  41. return $data[ $type ] ?? '';
  42. }
  43. }