dict.php 11 KB

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