configDict.php 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313
  1. <?php
  2. namespace common\components;
  3. /**
  4. * 配置字典
  5. * @author
  6. */
  7. class configDict
  8. {
  9. public static $dict = [
  10. 'openId' => 1,//开放平台初始数据
  11. 'openAdminId' => 1,//开放平台初始管理员id
  12. 'merchantId' => 1,//公众平台的默认初始商户id
  13. 'categoryClassify' => ['goodsLink' => 0, 'articleLink' => 1],
  14. 'categoryClassifyName' => [0 => '商品', 1 => '文章'],//导航菜单的分类属性
  15. 'categoryClassifyUrl' => [//导航菜单分类属性对应的访问链接
  16. 0 => '/mobile/goods-list',
  17. 1 => '/article/article-list',
  18. ],
  19. 'merchant' => [
  20. 'authAccount' => [3]//0个人个体户 1未认证服务号 2未认证订阅号 3服务号 4订阅号
  21. ],
  22. 'merchantStatus' => ['checking' => 0, 'pass' => 1, 'noPass' => 2, 'freeze' => 3, 'unfreeze' => 4, 'shut' => 5],
  23. 'merchantStatusName' => [0 => '审核中', 1 => '审核通过', 2 => '审核未通过', 3 => '冻结', 4 => '解除冻结', 5 => '自主关闭'],
  24. 'riseType' => ['noRise' => 0, 'percent' => 1, 'amount' => 2,],//涨价方式
  25. 'riseTypeName' => [0 => '不涨价', 1 => '按百分比', 2 => '按金额'],
  26. 'accountStyle' => ['serviceAccount' => 0, 'subscribeAccount' => 1, 'unAuthServiceAccount' => 2],//公众号类型
  27. 'accountStyleName' => [0 => '服务号', 1 => '订阅号', 2 => '未认证服务号'],
  28. 'payStyleName' => [0 => '第三方支付', 1 => '非第三方支付'],
  29. 'payStyle' => ['weixinPay' => 0, 'alipay' => 0, 'thirdPay' => 0, 'balancePay' => 1, 'cashPay' => 1, 'selfPay' => 1],//公众号的微信支付、支付宝支付属于第三方支付,余额现金属于非第三方
  30. 'payWay' => ['weixinPay' => 0, 'alipay' => 1, 'balancePay' => 2],
  31. 'payWayName' => [0 => '微信', 1 => '支付宝', 2 => '余额'],
  32. 'payWayFullName' => [0 => '微信支付', 1 => '支付宝', 2 => '余额支付'],
  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. 'wxMenuOption' => ['redirectToCommonUseUrl' => 0, 'redirectToCustomUrl' => 1, 'showText' => 2, 'redirectToMiniProgram' => 3],
  44. 'wxMenuOptionName' => [
  45. 0 => ['name' => '跳转到-常用链接', 'key' => 0, 'replyType' => 0],//replyType 回复类型
  46. 1 => ['name' => '跳转到-自定义网址', 'key' => 1, 'replyType' => 0],
  47. 2 => ['name' => '跳转到-文字', 'key' => 2, 'replyType' => 1],
  48. 3 => ['name' => '跳转到-小程序', 'key' => 3, 'replyType' => 0],
  49. ],
  50. 'reachPeriodName' => [0 => '上午', 1 => '下午', 2 => '晚上'],
  51. 'reachPeriod' => ['am' => 0, 'pm' => 1, 'night' => 2],
  52. 'manageStyle' => ['retail' => 0, 'train' => 1, 'wholesale' => 2],//经营类型
  53. 'manageStyleName' => [0 => '零售', 1 => '花艺培训', 2 => '批发'],//经营类型
  54. 'commonUseUrl' => [//常用链接 manageStyle 0 零售 1 培训学校 2批发商
  55. 1 => ['name' => '商城首页', 'url' => '/mobile/index', 'key' => 1, 'manageStyle' => 0],
  56. 2 => ['name' => '我的订单', 'url' => '/center/order', 'key' => 2, 'manageStyle' => 0],
  57. 3 => ['name' => '会员中心', 'url' => '/center/index', 'key' => 3, 'manageStyle' => 0],
  58. 4 => ['name' => '我的会员卡', 'url' => '/center/qr-code', 'key' => 4, 'manageStyle' => 0],
  59. 5 => ['name' => '培训首页', 'url' => '/train/index', 'key' => 5, 'manageStyle' => 1],
  60. 6 => ['name' => '我的代金劵', 'url' => '/center/coupon', 'key' => 6, 'manageStyle' => 0],
  61. 7 => ['name' => '快速付款', 'url' => '/payment/quick-order', 'key' => 7, 'manageStyle' => 0],
  62. ],
  63. 'commonUseUrlMapped' => ['mall' => 1, 'myOrder' => 2, 'memberCenter' => 3, 'myMemberCard' => 4, 'trainIndex' => 5, 'myCoupon' => 6, 'quickOrder' => 7],
  64. //运费
  65. 'freight' => [
  66. 'firstDistance' => 5000,//5公里内
  67. 'firstPrice' => 0,//16元运费
  68. 'nextDistance' => 1000,//每增加1公里
  69. 'nextPrice' => 2,//增加2元
  70. ],
  71. "iWantToJoin" => "iWantToJoin",//我要入驻
  72. "io" => ['payout' => 0, 'income' => 1, 'other' => 2],
  73. "ioName" => [0 => '支出', 1 => '收入', 2 => '其它'],
  74. "inviteUseTo" => [//邀请码用处
  75. 'applyMerchant' => ['key' => 0, 'name' => 'xhApplyOrder'],//申请公众号
  76. 'openRenew' => ['key' => 1, 'name' => 'xhOpenRenewOrder'],//开通续费
  77. ],
  78. "capitalType" => [//流水类型,充值支付回调时的订单类型
  79. 'xhOrder' => ['id' => 0, 'name' => 'xhOrder'],
  80. 'xhActiveOrder' => ['id' => 2, 'name' => 'xhActiveOrder'],
  81. 'xhRecharge' => ['id' => 4, 'name' => 'xhRecharge'],
  82. 'xhUserUnite' => ['id' => 5, 'name' => 'xhUserUnite'],//支付宝关联微信帐号,积分累加订单
  83. 'xhDrawCash' => ['id' => 6, 'name' => 'xhDrawCash'],
  84. 'xhApplyOrder' => ['id' => 7, 'name' => 'xhApplyOrder'],
  85. 'xhMergeUser' => ['id' => 8, 'name' => 'xhMergeUser'],
  86. 'xhRenew' => ['id' => 9, 'name' => 'xhRenew'],
  87. ],
  88. "capitalTypeList" => [//流水类型的对应链接,后台收支明细查看时跳转的链接
  89. 0 => ['link' => '/capital/order-detail', 'name' => '网店', 'orderLink' => '/order/detail'],
  90. 2 => ['link' => '/capital/active-order-detail', 'name' => '活动报名', 'orderLink' => ''],
  91. 4 => ['link' => '/capital/recharge-detail', 'name' => '充值', 'orderLink' => ''],
  92. 5 => ['link' => '/capital/user-unite', 'name' => '帐号关联', 'orderLink' => ''],
  93. 6 => ['link' => '/capital/draw-cash', 'name' => '提现', 'orderLink' => ''],
  94. 7 => ['link' => '/capital/apply-order-detail', 'name' => '接入申请', 'orderLink' => ''],
  95. 8 => ['link' => '/capital/merge-user', 'name' => '帐号合并', 'orderLink' => ''],
  96. 9 => ['link' => '/capital/renew', 'name' => '续费', 'orderLink' => '']
  97. ],
  98. "imgSavePath" => [//图片保存目录
  99. 'wxUserAvatar' => 'weixinUserAvatar',//微信用户头像
  100. 'wxUserImg' => 'weixinUserImg',//微信用户上传的图片
  101. 'wxMpQrcode' => 'weixinMpQrcode',//公众号二维码
  102. 'wxMpAvatar' => 'weixinMpAvatar',//公众号头像
  103. 'wxAdminAvatar' => 'weixinAdminAvatar',//管理员头像
  104. 'wxAdminImg' => 'weixinAdminImg',//微信后台管理上传图片
  105. ],
  106. //模板消息
  107. 'tMessage' => [
  108. 'OPENTM207430125' => '操作成功通知',
  109. 'OPENTM401915538' => '审核通知',
  110. 'TM00006' => '充值通知',
  111. 'OPENTM201205968' => '订单送达通知',
  112. 'OPENTM207777535' => '付款提醒',
  113. 'OPENTM401761342' => '订单价格修改通知',
  114. 'OPENTM205211943' => '会员升级通知',
  115. 'TM00230' => '积分变动通知',
  116. 'OPENTM200605630' => '任务处理通知',
  117. // 'OPENTM401027382' => '课程报名成功',
  118. 'OPENTM207422813' => '收入提醒',
  119. 'OPENTM202297555' => '下单成功通知',
  120. 'OPENTM207327227' => '宝贝售出提醒',
  121. 'OPENTM207188526' => '付款成功',
  122. // 'TM00575' => '报名成功通知',
  123. // 'OPENTM201319876' => '结算通知',
  124. ],
  125. //格式: 表名 => ['表字段' => [...]]
  126. 'xhShop' => [ //表名
  127. 'status' => [0 => '运营后台审核中', 1 => '微信审核中', 2 => '审核通过', 3 => '未通过', 4 => '微信系统错误'],//门店审核状态(表字段)
  128. ],
  129. 'xhActiveOrder' => [ //表名
  130. 'payStatus' => [-1 => '未通过', 0 => '等待审批', 1 => '通过'],
  131. ],
  132. 'xhLuckyDrawAwardCustomer' => [ //表名
  133. 'status' => [-1 => '过期未领取', 0 => '待发放', 1 => '已发放'],
  134. ],
  135. 'xhGuaGuaWin' => [ //表名
  136. 'status' => [1 => '未领取', 2 => '已发放', 3 => '过期未领取'],
  137. ],
  138. 'trainDemo' => [//培训演示使用的公众号
  139. 'merchant' => ['name' => '花掌柜', 'account' => '16063078665', 'wxPayMerchantId' => '1265953301', 'wxPayKey' => 'woz23aG739jscv4309275jnza3qw8dwm'],
  140. 'platform' => ['name' => '花汇宝', 'account' => '16063078661', 'wxPayMerchantId' => '1398843402', 'wxPayKey' => 'db123jf239jswx2309h10jnze3qwjd1v'],
  141. ],
  142. //图片形状和比例类型
  143. 'imgShape' => [
  144. 'square' => ['id' => 0],//正方形 1:1 400x400
  145. 'rectangle' => ['id' => 1],//长方形 3:2 450x300
  146. 'focus' => ['id' => 2],//焦点图 750x280
  147. ],
  148. 'imgShapeGetId' => [
  149. 0 => ['name' => 'square'],
  150. 1 => ['name' => 'rectangle'],
  151. 2 => ['name' => 'focus'],
  152. ],
  153. //用户来源
  154. 'userSource' => [
  155. 0 => 'official',
  156. 1 => 'alipay',
  157. 2 => 'mini',
  158. ],
  159. 'userSourceGetId' => [
  160. 'official' => ['id' => 0, 'name' => 'official'],
  161. 'alipay' => ['id' => 1, 'name' => 'alipay'],
  162. 'mini' => ['id' => 2, 'name' => 'mini'],
  163. ],
  164. ];
  165. //生成二维码的Key
  166. public static $qrKey = [
  167. 'user' => 'huahuibao_user_',
  168. 'coupon' => 'huahuibao_coupon_',
  169. 'xhStudent' => 'xhStudent_',
  170. 'gathering' => 'gathering_',//收款二维码
  171. ];
  172. public static $cacheKey = [
  173. 'tagUser' => '_tagUser_',//标签下的用户
  174. 'userTag' => 'userTag_',//用户的标签
  175. 'merchantTag' => 'merchantTag_',//商家的标签
  176. 'userCart' => 'userCart_',
  177. 'cart' => 'cart_',
  178. 'userCoupon' => 'userCoupon_',//用户代金劵
  179. 'merchantAccount' => 'merchant_account_',//根据account取商家信息
  180. 'merchantId' => 'merchant_id_',//根据id取商家信息
  181. 'merchantAsset' => 'merchantAsset_',
  182. 'merchantExtend' => 'merchantExtend_',
  183. 'merchantAppId' => 'merchantAppId_',
  184. 'gatherVisitIPByDay' => 'gatherVisitIPByDay',//每天访问的IP列表
  185. 'statVisitNumByDay' => 'statVisitNumByDay',//每天访问量
  186. 'statUserNumByDay' => 'statUserNumByDay',//每天新增粉丝
  187. 'statIncome' => 'statIncome',//每天增加的收入,微信支付、支付宝支付、余额支付,加积分(现金消费)都属于收入,充值暂不归属于商家收入
  188. 'statDealByDay' => 'statDealByDay',//每天新增的交易,微信支付、支付宝支付、余额支付,加积分(现金消费)都属于交易,充值暂不归属于商家交易
  189. 'merchantTrade' => 'merchantTrade',
  190. 'latestVisitNum' => 'latestVisitNum_',//最近N天访问数
  191. 'latestIncomeNum' => 'latestIncomeNum_',//最近N天的收入金额
  192. 'latestUserNum' => 'latestUserNum_',//最近N天的粉丝变化
  193. 'wxOpen' => 'wxOpen_',
  194. 'goodsGetById' => 'goodsGetById_',
  195. 'article' => 'article_',
  196. 'slide' => 'slide_',
  197. 'recommendGoods' => 'recommendGoods_',
  198. 'tMessage' => 'tMessage_',
  199. 'admin' => 'admin_',
  200. 'order' => 'order_',
  201. 'categoryGoodsList' => 'categoryGoodsList_',
  202. 'categoryList' => 'categoryList_',
  203. 'categoryNavigationBar' => 'categoryNavigationBar_',
  204. 'category' => 'category_',
  205. 'mobileOpenAdmin' => 'mobileOpenAdmin_',
  206. 'openAdmin' => 'openAdmin_',
  207. 'inviteCodeList' => 'inviteCodeList',
  208. 'coupon' => 'coupon_',
  209. 'swoolePhoneMsg' => 'swoole:phone:message',//swoole进程中断时,保存上次发送手机短信的时间
  210. //表数据缓存
  211. 'xhUserAsset' => 'xhUserAsset_',
  212. 'xhUserAlipayAsset' => 'xhUserAlipayAsset',
  213. 'xhAdminMobile' => 'xhAdminMobile_',
  214. 'xhActive' => 'xhActive_',
  215. 'xhActiveTicketClass' => 'xhActiveTicketClass_',
  216. 'xhActiveOrder' => 'xhActiveOrder_',
  217. 'xhUnionUser' => 'xhUnionUser_',
  218. 'xhGoodsSetting' => 'xhGoodsSetting_',
  219. 'xhUser' => 'xhUser_',
  220. 'xhUserAlipay' => 'xhUserAlipay',
  221. 'xhUserOpenId' => 'xhUser_openId_',
  222. 'xhUserUnite' => 'xhUserUnite',
  223. 'xhDrawCash' => 'xhDrawCash_',
  224. 'xhWxMenu' => 'xhWxMenu_',
  225. 'xhWxMenuKey' => 'xhWxMenuKey_',
  226. 'xhWxMenuList' => 'xhWxMenuList_',
  227. 'xhShop' => 'xhShop_',
  228. 'xhWifiList' => 'xhWifiList_',
  229. 'xhAdminOpenId' => 'xhAdminOpenId_',
  230. 'xhTrainClass' => 'xhTrainClass_',
  231. 'xhTrainCourse' => 'xhTrainCourse_',
  232. 'xhTrainStudent' => 'xhTrainStudent_',
  233. 'xhTrainUserCourse' => 'xhTrainUserCourse_',
  234. 'xhOrderDayNum' => 'xhOrderDayNum',
  235. 'xhOrderMonthNum' => 'xhOrderMonthNum',
  236. 'xhStatIncome' => 'xhStatIncome',
  237. 'xhStatIncomeMonth' => 'xhStatIncomeMonth',
  238. 'xhUserByMonth' => 'xhUserByMonth',
  239. 'xhUserByDay' => 'xhUserByDay',
  240. 'xhVisitByMonth' => 'xhVisitByMonth',
  241. 'xhVisitByDay' => 'xhVisitByDay',
  242. 'xhInvite' => 'xhInvite_',
  243. 'xhMerchantAccount' => 'xhMerchantAccount_',
  244. 'xhApplyOrder' => 'xhApplyOrder_',
  245. 'xhInviteCode' => 'xhInviteCode_',
  246. 'xhSetMeal' => 'xhSetMeal_',
  247. 'xhGoodsPrice' => 'xhGoodsPrice_',
  248. 'xhAdminToMerchant' => 'xhAdminToMerchant',
  249. 'xhAdminToMerchantList' => 'xhAdminToMerchantList',
  250. 'xhUserIntegral' => 'xhUserIntegral_',
  251. 'xhLuckyDrawActivity' => 'xhLuckyDrawActivity_',
  252. 'xhLuckyDrawAward' => 'xhLuckyDrawAward_',
  253. 'xhLuckyDrawAwardParticipant' => 'xhLuckyDrawAwardParticipant_',
  254. 'xhLuckyDrawAwardCustomer' => 'xhLuckyDrawAwardCustomer_',
  255. ];
  256. /**
  257. * 取配置文件的值
  258. */
  259. public static function getConfig($category, $name = null)
  260. {
  261. return empty($name) ? self::$dict[$category] : self::$dict[$category][$name];
  262. }
  263. public function getValue($category, $name = '')
  264. {
  265. return empty($name) ? self::$dict[$category] : self::$dict[$category][$name];
  266. }
  267. /**
  268. * 取缓存Key
  269. */
  270. public static function getCacheKey($key)
  271. {
  272. if (isset(self::$cacheKey[$key])) {
  273. return self::$cacheKey[$key];
  274. }
  275. }
  276. public static function getQrKey($key)
  277. {
  278. if (isset(self::$qrKey[$key])) {
  279. return self::$qrKey[$key];
  280. }
  281. }
  282. }