dict.php 9.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249
  1. <?php
  2. namespace common\components;
  3. //字典
  4. class dict
  5. {
  6. const data = [
  7. //默认的日期搜索选项
  8. 'dateDefaultOption' => [
  9. ['name' => '昨天', 'value' => 'yesterday'],
  10. ['name' => '今天', 'value' => 'today',],
  11. ['name' => '本月', 'value' => 'thisMonth',],
  12. ['name' => '上月', 'value' => 'lastMonth',],
  13. ['name' => '今年', 'value' => 'thisYear',],
  14. ['name' => '自定义', 'value' => 'custom',],
  15. ],
  16. 'merchantStatus' => ['checking' => 0, 'pass' => 1, 'noPass' => 2, 'freeze' => 3, 'unfreeze' => 4, 'shut' => 5],
  17. 'merchantStatusName' => [0 => '审核中', 1 => '审核通过', 2 => '审核未通过', 3 => '冻结', 4 => '解除冻结', 5 => '自主关闭'],
  18. //涨价方式
  19. 'riseType' => ['noRise' => 0, 'percent' => 1, 'amount' => 2,],
  20. 'riseTypeName' => [0 => '不涨价', 1 => '按百分比', 2 => '按金额'],
  21. //公众号类型
  22. 'accountStyle' => ['serviceAccount' => 0, 'subscribeAccount' => 1, 'unAuthServiceAccount' => 2],
  23. 'accountStyleName' => [0 => '服务号', 1 => '订阅号', 2 => '未认证服务号'],
  24. 'payWay' => ['weixinPay' => 0, 'alipay' => 1, 'balancePay' => 2],
  25. 'payWayName' => [0 => '微信', 1 => '支付宝', 2 => '余额'],
  26. 'payWayFullName' => [0 => '微信支付', 1 => '支付宝', 2 => '余额支付'],
  27. //后台支付方式选项
  28. 'htPayWayOption' => [
  29. ['name' => '微信', 'id' => 0],
  30. ['name' => '支付宝', 'id' => 1],
  31. ['name' => '余额', 'id' => 2],
  32. ],
  33. 'payStatusName' => [-1 => '客户关闭', 0 => '待付款', 1 => '已付款'],
  34. 'payStatus' => ['cancel' => -1, 'waitForPay' => 0, 'waitForSend' => 1],
  35. 'sendStatusName' => [0 => '待发货', 1 => '送货中', 2 => '已送达'],
  36. 'sendStatus' => ['waitForSend' => 0, 'sending' => 1, 'reached' => 2],
  37. 'replyType' => ['redirectUrl' => 0, 'text' => 1, 'news' => 2, 'multiNews' => 3],
  38. 'replyTypeName' => [0 => '跳转链接', 1 => '回复文字', 2 => '回复单图文', 3 => '回复多图文'],
  39. 'goodsStatusName' => [0 => '正常', 1 => '下架', 2 => '删除'],
  40. 'goodsStatus' => ['online' => 0, 'soldOut' => 1, 'del' => 2],
  41. 'goodsDelStatusName' => [0 => '正常,未删除', 1 => '删除'],
  42. 'goodsDelStatus' => ['normal' => 0, 'del' => 1],
  43. 'reachPeriodName' => [0 => '上午', 1 => '下午', 2 => '晚上'],
  44. 'reachPeriod' => ['am' => 0, 'pm' => 1, 'night' => 2],
  45. 'manageStyle' => ['retail' => 0, 'train' => 1, 'wholesale' => 2],//经营类型
  46. 'manageStyleName' => [0 => '零售', 1 => '花艺培训', 2 => '批发'],//经营类型
  47. //运费
  48. 'freight' => [
  49. 'firstDistance' => 5000,//5公里内
  50. 'firstPrice' => 0,//16元运费
  51. 'nextDistance' => 1000,//每增加1公里
  52. 'nextPrice' => 2,//增加2元
  53. ],
  54. "iWantToJoin" => "iWantToJoin",//我要入驻
  55. "io" => ['payout' => 0, 'income' => 1, 'other' => 2],
  56. "ioName" => [0 => '支出', 1 => '收入', 2 => '其它'],
  57. "capitalType" => [//流水类型,充值支付回调时的订单类型
  58. 'xhOrder' => ['id' => 0, 'name' => 'xhOrder'],
  59. 'xhActiveOrder' => ['id' => 2, 'name' => 'xhActiveOrder'],
  60. //充值
  61. 'xhRecharge' => ['id' => 4, 'name' => 'xhRecharge'],
  62. //支付宝关联微信帐号,积分累加订单
  63. 'xhUserUnite' => ['id' => 5, 'name' => 'xhUserUnite'],
  64. 'xhDrawCash' => ['id' => 6, 'name' => 'xhDrawCash'],
  65. 'xhApplyOrder' => ['id' => 7, 'name' => 'xhApplyOrder'],
  66. 'xhMergeUser' => ['id' => 8, 'name' => 'xhMergeUser'],
  67. 'xhRenew' => ['id' => 9, 'name' => 'xhRenew'],
  68. //供货商订单
  69. 'xhGhsOrder' => ['id' => 10, 'name' => 'xhGhsOrder'],
  70. //花店采购
  71. 'xhPurchase' => ['id' => 11, 'name' => 'xhPurchase'],
  72. 'pxApply' => ['id' => 12, 'name' => 'pxApply'],
  73. ],
  74. "capitalTypeList" => [//流水类型的对应链接,后台收支明细查看时跳转的链接
  75. 0 => ['link' => '/capital/order-detail', 'name' => '网店', 'orderLink' => '/order/detail', 'id' => 0,],
  76. 2 => ['link' => '/capital/active-order-detail', 'name' => '活动报名', 'orderLink' => '', 'id' => 2,],
  77. 4 => ['link' => '/capital/recharge-detail', 'name' => '充值', 'orderLink' => '', 'id' => 4,],
  78. 5 => ['link' => '/capital/user-unite', 'name' => '帐号关联', 'orderLink' => '', 'id' => 5,],
  79. 6 => ['link' => '/capital/draw-cash', 'name' => '提现', 'orderLink' => '', 'id' => 6,],
  80. 7 => ['link' => '/capital/apply-order-detail', 'name' => '接入申请', 'orderLink' => '', 'id' => 7,],
  81. 8 => ['link' => '/capital/merge-user', 'name' => '帐号合并', 'orderLink' => '', 'id' => 8,],
  82. 9 => ['link' => '/capital/renew', 'name' => '续费', 'orderLink' => '', 'id' => 9,],
  83. 10 => ['link' => '/capital/order-detail', 'name' => '订单', 'orderLink' => '', 'id' => 10,],
  84. 11 => ['link' => '/capital/purchase-detail', 'name' => '订单', 'orderLink' => '', 'id' => 11,],
  85. 12 => ['link' => '/capital/purchase-detail', 'name' => '培训报名', 'orderLink' => '', 'id' => 12,],
  86. ],
  87. //模板消息
  88. 'tMessage' => [
  89. 'OPENTM207430125' => '操作成功通知',
  90. 'OPENTM401915538' => '审核通知',
  91. 'TM00006' => '充值通知',
  92. 'OPENTM201205968' => '订单送达通知',
  93. 'OPENTM207777535' => '付款提醒',
  94. 'OPENTM401761342' => '订单价格修改通知',
  95. 'OPENTM205211943' => '会员升级通知',
  96. 'TM00230' => '积分变动通知',
  97. 'OPENTM200605630' => '任务处理通知',
  98. 'OPENTM207422813' => '收入提醒',
  99. 'OPENTM202297555' => '下单成功通知',
  100. 'OPENTM207327227' => '宝贝售出提醒',
  101. 'OPENTM207188526' => '付款成功',
  102. ],
  103. //用户来源
  104. 'userSource' => [
  105. 0 => 'official',
  106. 1 => 'alipay',
  107. 2 => 'mini',
  108. ],
  109. 'userSourceGetId' => [
  110. 'official' => ['id' => 0, 'name' => 'official'],
  111. 'alipay' => ['id' => 1, 'name' => 'alipay'],
  112. 'mini' => ['id' => 2, 'name' => 'mini'],
  113. ],
  114. ];
  115. public static $cacheKey = [
  116. 'tagUser' => '_tagUser_',//标签下的用户
  117. 'userTag' => 'userTag_',//用户的标签
  118. 'merchantTag' => 'merchantTag_',//商家的标签
  119. 'userCart' => 'userCart_',
  120. 'cart' => 'cart_',
  121. 'userCoupon' => 'userCoupon_',//用户代金劵
  122. 'merchantAccount' => 'merchant_account_',//根据account取商家信息
  123. 'merchantId' => 'merchant_id_',//根据id取商家信息
  124. 'merchantAsset' => 'merchantAsset_',
  125. 'merchantExtend' => 'merchantExtend_',
  126. 'merchantAppId' => 'merchantAppId_',
  127. 'gatherVisitIPByDay' => 'gatherVisitIPByDay',//每天访问的IP列表
  128. 'statVisitNumByDay' => 'statVisitNumByDay',//每天访问量
  129. 'statUserNumByDay' => 'statUserNumByDay',//每天新增粉丝
  130. 'statIncome' => 'statIncome',//每天增加的收入,微信支付、支付宝支付、余额支付,加积分(现金消费)都属于收入,充值暂不归属于商家收入
  131. 'statDealByDay' => 'statDealByDay',//每天新增的交易,微信支付、支付宝支付、余额支付,加积分(现金消费)都属于交易,充值暂不归属于商家交易
  132. 'merchantTrade' => 'merchantTrade',
  133. 'latestVisitNum' => 'latestVisitNum_',//最近N天访问数
  134. 'latestIncomeNum' => 'latestIncomeNum_',//最近N天的收入金额
  135. 'latestUserNum' => 'latestUserNum_',//最近N天的粉丝变化
  136. 'wxOpen' => 'wxOpen_',
  137. 'goodsGetById' => 'goodsGetById_',
  138. 'article' => 'article_',
  139. 'slide' => 'slide_',
  140. 'recommendGoods' => 'recommendGoods_',
  141. 'tMessage' => 'tMessage_',
  142. 'admin' => 'admin_',
  143. 'order' => 'order_',
  144. 'categoryGoodsList' => 'categoryGoodsList_',
  145. 'categoryList' => 'categoryList_',
  146. 'categoryNavigationBar' => 'categoryNavigationBar_',
  147. 'category' => 'category_',
  148. 'mobileOpenAdmin' => 'mobileOpenAdmin_',
  149. 'openAdmin' => 'openAdmin_',
  150. 'inviteCodeList' => 'inviteCodeList',
  151. 'coupon' => 'coupon_',
  152. //swoole进程中断时,保存上次发送手机短信的时间
  153. 'swoolePhoneMsg' => 'swoole:phone:message',
  154. //表数据缓存
  155. 'xhUserAsset' => 'xhUserAsset_',
  156. 'xhUserAlipayAsset' => 'xhUserAlipayAsset',
  157. 'xhAdminMobile' => 'xhAdminMobile_',
  158. 'xhActive' => 'xhActive_',
  159. 'xhActiveTicketClass' => 'xhActiveTicketClass_',
  160. 'xhActiveOrder' => 'xhActiveOrder_',
  161. 'xhUnionUser' => 'xhUnionUser_',
  162. 'xhGoodsSetting' => 'xhGoodsSetting_',
  163. 'xhUser' => 'xhUser_',
  164. 'xhUserAlipay' => 'xhUserAlipay',
  165. 'xhUserOpenId' => 'xhUser_openId_',
  166. 'xhUserUnite' => 'xhUserUnite',
  167. 'xhDrawCash' => 'xhDrawCash_',
  168. 'xhWxMenu' => 'xhWxMenu_',
  169. 'xhWxMenuKey' => 'xhWxMenuKey_',
  170. 'xhWxMenuList' => 'xhWxMenuList_',
  171. 'xhShop' => 'xhShop_',
  172. 'xhWifiList' => 'xhWifiList_',
  173. 'xhAdminOpenId' => 'xhAdminOpenId_',
  174. 'xhPxClass' => 'xhPxClass_',
  175. 'xhPxCourse' => 'xhPxCourse_',
  176. 'xhTrainStudent' => 'xhTrainStudent_',
  177. 'xhPxUserCourse' => 'xhPxUserCourse_',
  178. 'xhOrderDayNum' => 'xhOrderDayNum',
  179. 'xhOrderMonthNum' => 'xhOrderMonthNum',
  180. 'xhStatIncome' => 'xhStatIncome',
  181. 'xhStatIncomeMonth' => 'xhStatIncomeMonth',
  182. 'xhUserByMonth' => 'xhUserByMonth',
  183. 'xhUserByDay' => 'xhUserByDay',
  184. 'xhVisitByMonth' => 'xhVisitByMonth',
  185. 'xhVisitByDay' => 'xhVisitByDay',
  186. 'xhInvite' => 'xhInvite_',
  187. 'xhMerchantAccount' => 'xhMerchantAccount_',
  188. 'xhApplyOrder' => 'xhApplyOrder_',
  189. 'xhInviteCode' => 'xhInviteCode_',
  190. 'xhSetMeal' => 'xhSetMeal_',
  191. 'xhGoodsPrice' => 'xhGoodsPrice_',
  192. 'xhAdminToMerchant' => 'xhAdminToMerchant',
  193. 'xhAdminToMerchantList' => 'xhAdminToMerchantList',
  194. 'xhUserIntegral' => 'xhUserIntegral_',
  195. 'xhLuckyDrawActivity' => 'xhLuckyDrawActivity_',
  196. 'xhLuckyDrawAward' => 'xhLuckyDrawAward_',
  197. 'xhLuckyDrawAwardParticipant' => 'xhLuckyDrawAwardParticipant_',
  198. 'xhLuckyDrawAwardCustomer' => 'xhLuckyDrawAwardCustomer_',
  199. ];
  200. //取配置文件的值
  201. public static function getConfig($category, $name = null)
  202. {
  203. return empty($name) ? self::data[$category] : self::data[$category][$name];
  204. }
  205. public function getValue($category, $name = '')
  206. {
  207. return empty($name) ? self::data[$category] : self::data[$category][$name];
  208. }
  209. //取缓存键名
  210. public static function getCacheKey($key)
  211. {
  212. if (isset(self::$cacheKey[$key])) {
  213. return self::$cacheKey[$key];
  214. }
  215. }
  216. //列出所有的常量 shish 2021.3.18
  217. public static function get()
  218. {
  219. $data = self::data;
  220. return $data;
  221. }
  222. }