dict.php 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287
  1. <?php
  2. namespace common\components;
  3. //字典
  4. class dict
  5. {
  6. public static $data = [
  7. 'expressList' => [
  8. [
  9. "id" => 1,
  10. "deliveryId" => "dada",
  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. 'dadaCancelReason'=>[
  113. [
  114. 'id'=>1,
  115. 'reason'=>'没有配送员接单',
  116. ],
  117. [
  118. 'id'=>2,
  119. 'reason'=>'配送员没来取货',
  120. ],
  121. [
  122. 'id'=>3,
  123. 'reason'=>'配送员态度太差',
  124. ],
  125. [
  126. 'id'=>4,
  127. 'reason'=>'顾客取消订单',
  128. ],
  129. [
  130. 'id'=>5,
  131. 'reason'=>'订单填写错误',
  132. ],
  133. [
  134. 'id'=>34,
  135. 'reason'=>'配送员让我取消此单',
  136. ],
  137. [
  138. 'id'=>35,
  139. 'reason'=>'配送员不愿上门取货',
  140. ],
  141. [
  142. 'id'=>36,
  143. 'reason'=>'我不需要配送了',
  144. ],
  145. [
  146. 'id'=>37,
  147. 'reason'=>'配送员以各种理由表示无法完成订单',
  148. ],
  149. ]
  150. ];
  151. public static $cacheKey = [
  152. 'tagUser' => '_tagUser_',//标签下的用户
  153. 'userTag' => 'userTag_',//用户的标签
  154. 'merchantTag' => 'merchantTag_',//商家的标签
  155. 'userCart' => 'userCart_',
  156. 'cart' => 'cart_',
  157. 'userCoupon' => 'userCoupon_',//用户代金劵
  158. 'merchantAccount' => 'merchant_account_',//根据account取商家信息
  159. 'merchantId' => 'merchant_id_',//根据id取商家信息
  160. 'merchantAsset' => 'merchantAsset_',
  161. 'merchantExtend' => 'merchantExtend_',
  162. 'merchantAppId' => 'merchantAppId_',
  163. 'gatherVisitIPByDay' => 'gatherVisitIPByDay',//每天访问的IP列表
  164. 'statVisitNumByDay' => 'statVisitNumByDay',//每天访问量
  165. 'statUserNumByDay' => 'statUserNumByDay',//每天新增粉丝
  166. 'statIncome' => 'statIncome',//每天增加的收入,微信支付、支付宝支付、余额支付,加积分(现金消费)都属于收入,充值暂不归属于商家收入
  167. 'statDealByDay' => 'statDealByDay',//每天新增的交易,微信支付、支付宝支付、余额支付,加积分(现金消费)都属于交易,充值暂不归属于商家交易
  168. 'merchantTrade' => 'merchantTrade',
  169. 'latestVisitNum' => 'latestVisitNum_',//最近N天访问数
  170. 'latestIncomeNum' => 'latestIncomeNum_',//最近N天的收入金额
  171. 'latestUserNum' => 'latestUserNum_',//最近N天的粉丝变化
  172. 'wxOpen' => 'wxOpen_',
  173. 'goodsGetById' => 'goodsGetById_',
  174. 'article' => 'article_',
  175. 'slide' => 'slide_',
  176. 'recommendGoods' => 'recommendGoods_',
  177. 'tMessage' => 'tMessage_',
  178. 'admin' => 'admin_',
  179. 'order' => 'order_',
  180. 'categoryGoodsList' => 'categoryGoodsList_',
  181. 'categoryList' => 'categoryList_',
  182. 'categoryNavigationBar' => 'categoryNavigationBar_',
  183. 'category' => 'category_',
  184. 'mobileOpenAdmin' => 'mobileOpenAdmin_',
  185. 'openAdmin' => 'openAdmin_',
  186. 'inviteCodeList' => 'inviteCodeList',
  187. 'coupon' => 'coupon_',
  188. //swoole进程中断时,保存上次发送手机短信的时间
  189. 'swoolePhoneMsg' => 'swoole:phone:message',
  190. //表数据缓存
  191. 'xhUserAsset' => 'xhUserAsset_',
  192. 'xhUserAlipayAsset' => 'xhUserAlipayAsset',
  193. 'xhAdminMobile' => 'xhAdminMobile_',
  194. 'xhActive' => 'xhActive_',
  195. 'xhActiveTicketClass' => 'xhActiveTicketClass_',
  196. 'xhActiveOrder' => 'xhActiveOrder_',
  197. 'xhUnionUser' => 'xhUnionUser_',
  198. 'xhGoodsSetting' => 'xhGoodsSetting_',
  199. 'xhUser' => 'xhUser_',
  200. 'xhUserAlipay' => 'xhUserAlipay',
  201. 'xhUserOpenId' => 'xhUser_openId_',
  202. 'xhUserUnite' => 'xhUserUnite',
  203. 'xhDrawCash' => 'xhDrawCash_',
  204. 'xhWxMenu' => 'xhWxMenu_',
  205. 'xhWxMenuKey' => 'xhWxMenuKey_',
  206. 'xhWxMenuList' => 'xhWxMenuList_',
  207. 'xhShop' => 'xhShop_',
  208. 'xhWifiList' => 'xhWifiList_',
  209. 'xhAdminOpenId' => 'xhAdminOpenId_',
  210. 'xhPxClass' => 'xhPxClass_',
  211. 'xhPxCourse' => 'xhPxCourse_',
  212. 'xhTrainStudent' => 'xhTrainStudent_',
  213. 'xhPxUserCourse' => 'xhPxUserCourse_',
  214. 'xhOrderDayNum' => 'xhOrderDayNum',
  215. 'xhOrderMonthNum' => 'xhOrderMonthNum',
  216. 'xhStatIncome' => 'xhStatIncome',
  217. 'xhStatIncomeMonth' => 'xhStatIncomeMonth',
  218. 'xhUserByMonth' => 'xhUserByMonth',
  219. 'xhUserByDay' => 'xhUserByDay',
  220. 'xhVisitByMonth' => 'xhVisitByMonth',
  221. 'xhVisitByDay' => 'xhVisitByDay',
  222. 'xhInvite' => 'xhInvite_',
  223. 'xhMerchantAccount' => 'xhMerchantAccount_',
  224. 'xhApplyOrder' => 'xhApplyOrder_',
  225. 'xhInviteCode' => 'xhInviteCode_',
  226. 'xhSetMeal' => 'xhSetMeal_',
  227. 'xhGoodsPrice' => 'xhGoodsPrice_',
  228. 'xhAdminToMerchant' => 'xhAdminToMerchant',
  229. 'xhAdminToMerchantList' => 'xhAdminToMerchantList',
  230. 'xhUserIntegral' => 'xhUserIntegral_',
  231. 'xhLuckyDrawActivity' => 'xhLuckyDrawActivity_',
  232. 'xhLuckyDrawAward' => 'xhLuckyDrawAward_',
  233. 'xhLuckyDrawAwardParticipant' => 'xhLuckyDrawAwardParticipant_',
  234. 'xhLuckyDrawAwardCustomer' => 'xhLuckyDrawAwardCustomer_',
  235. ];
  236. //取配置文件的值
  237. public static function getConfig($category, $name = null)
  238. {
  239. return empty($name) ? self::$data[$category] : self::$data[$category][$name];
  240. }
  241. public function getValue($category, $name = '')
  242. {
  243. return empty($name) ? self::$data[$category] : self::$data[$category][$name];
  244. }
  245. //取缓存键名
  246. public static function getCacheKey($key)
  247. {
  248. if (isset(self::$cacheKey[$key])) {
  249. return self::$cacheKey[$key];
  250. }
  251. }
  252. //列出所有的常量 ssh 2021.3.18
  253. public static function get()
  254. {
  255. $respond = self::$data;
  256. return $respond;
  257. }
  258. }