dict.php 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213
  1. <?php
  2. namespace common\components;
  3. //字典
  4. class dict
  5. {
  6. public static $data = [
  7. //需要显示国兰的信息 0不需要 1需要(要审核小程序请显示国兰信息)
  8. 'showGlInfo' => 1,
  9. //显示零售和供货商的演示入口
  10. 'showDemo' => 1,
  11. //零售演示的管理员id
  12. 'hdDemoAdminId' => 221,
  13. //供货商演示的管理员id
  14. 'ghsDemoAdminId' => 222,
  15. 'expressList' => [
  16. [
  17. "id" => 1,
  18. "deliveryId" => "dada",
  19. "deliveryName" => "达达"
  20. ]
  21. ],
  22. //默认的日期搜索选项
  23. 'dateDefaultOption' => [
  24. ['name' => '昨天', 'value' => 'yesterday'],
  25. ['name' => '今天', 'value' => 'today',],
  26. ['name' => '本月', 'value' => 'thisMonth',],
  27. ['name' => '上月', 'value' => 'lastMonth',],
  28. ['name' => '今年', 'value' => 'thisYear',],
  29. ],
  30. 'merchantStatus' => ['checking' => 0, 'pass' => 1, 'noPass' => 2, 'freeze' => 3, 'unfreeze' => 4, 'shut' => 5],
  31. //涨价方式
  32. 'riseType' => ['noRise' => 0, 'percent' => 1, 'amount' => 2,],
  33. 'riseTypeName' => [0 => '不涨价', 1 => '按百分比', 2 => '按金额'],
  34. //支付方式
  35. 'payWay' => ['wxPay' => 0, 'alipay' => 1, 'balancePay' => 2, 'debtPay' => 3],
  36. 'payWayName' => [0 => '微信', 1 => '支付宝', 2 => '余额', 3 => '欠款'],
  37. 'payWayFullName' => [0 => '微信支付', 1 => '支付宝', 2 => '余额支付', 3 => '欠款支付'],
  38. //后台支付方式选项
  39. 'htPayWayOption' => [
  40. ['name' => '微信', 'id' => 0],
  41. ['name' => '支付宝', 'id' => 1],
  42. ],
  43. 'payStatus' => ['cancel' => -1, 'waitForPay' => 0, 'waitForSend' => 1],
  44. 'sendStatusName' => [0 => '待发货', 1 => '送货中', 2 => '已送达'],
  45. 'sendStatus' => ['waitForSend' => 0, 'sending' => 1, 'reached' => 2],
  46. 'replyType' => ['redirectUrl' => 0, 'text' => 1, 'news' => 2, 'multiNews' => 3],
  47. 'goodsStatusName' => [0 => '正常', 1 => '下架', 2 => '删除'],
  48. 'goodsStatus' => ['online' => 0, 'soldOut' => 1, 'del' => 2],
  49. 'goodsDelStatusName' => [0 => '正常,未删除', 1 => '删除'],
  50. 'goodsDelStatus' => ['normal' => 0, 'del' => 1],
  51. 'reachPeriodName' => [0 => '上午', 1 => '下午', 2 => '晚上'],
  52. 'reachPeriod' => ['am' => 0, 'pm' => 1, 'night' => 2],
  53. //运费
  54. 'freight' => [
  55. 'firstDistance' => 5000,//5公里内
  56. 'firstPrice' => 0,//16元运费
  57. 'nextDistance' => 1000,//每增加1公里
  58. 'nextPrice' => 2,//增加2元
  59. ],
  60. "io" => ['payout' => 0, 'income' => 1, 'other' => 2],
  61. "ioName" => [0 => '支出', 1 => '收入', 2 => '其它'],
  62. //流水类型,充值支付回调时的订单类型
  63. "capitalType" => [
  64. 'xhOrder' => ['id' => 0, 'name' => 'xhOrder'],
  65. 'xhActiveOrder' => ['id' => 2, 'name' => 'xhActiveOrder'],
  66. //充值
  67. 'xhRecharge' => ['id' => 4, 'name' => 'xhRecharge'],
  68. //支付宝关联微信
  69. 'xhUserUnite' => ['id' => 5, 'name' => 'xhUserUnite'],
  70. 'xhDrawCash' => ['id' => 6, 'name' => 'xhDrawCash'],
  71. 'xhApplyOrder' => ['id' => 7, 'name' => 'xhApplyOrder'],
  72. 'xhMergeUser' => ['id' => 8, 'name' => 'xhMergeUser'],
  73. 'xhRenew' => ['id' => 9, 'name' => 'xhRenew'],
  74. //供货商订单
  75. 'xhGhsOrder' => ['id' => 10, 'name' => 'xhGhsOrder'],
  76. //花店采购
  77. 'xhPurchase' => ['id' => 11, 'name' => 'xhPurchase'],
  78. //培训报名
  79. 'pxApply' => ['id' => 12, 'name' => 'pxApply'],
  80. //花店采购结算
  81. 'hdPurchaseClear' => ['id' => 20, 'name' => 'hdPurchaseClear'],
  82. ],
  83. "capitalTypeList" => [//流水类型的对应链接,后台收支明细查看时跳转的链接
  84. 0 => ['link' => '/capital/order-detail', 'name' => '网店', 'orderLink' => '/order/detail', 'id' => 0,],
  85. 2 => ['link' => '/capital/active-order-detail', 'name' => '活动报名', 'orderLink' => '', 'id' => 2,],
  86. 4 => ['link' => '/capital/recharge-detail', 'name' => '充值', 'orderLink' => '', 'id' => 4,],
  87. 5 => ['link' => '/capital/user-unite', 'name' => '帐号关联', 'orderLink' => '', 'id' => 5,],
  88. 6 => ['link' => '/capital/draw-cash', 'name' => '提现', 'orderLink' => '', 'id' => 6,],
  89. 7 => ['link' => '/capital/apply-order-detail', 'name' => '接入申请', 'orderLink' => '', 'id' => 7,],
  90. 8 => ['link' => '/capital/merge-user', 'name' => '帐号合并', 'orderLink' => '', 'id' => 8,],
  91. 9 => ['link' => '/capital/renew', 'name' => '续费', 'orderLink' => '', 'id' => 9,],
  92. 10 => ['link' => '/capital/order-detail', 'name' => '订单', 'orderLink' => '', 'id' => 10,],
  93. 11 => ['link' => '/capital/purchase-detail', 'name' => '订单', 'orderLink' => '', 'id' => 11,],
  94. 12 => ['link' => '/capital/purchase-detail', 'name' => '培训报名', 'orderLink' => '', 'id' => 12,],
  95. 20 => ['link' => '', 'name' => '采购结算', 'orderLink' => '', 'id' => 20,],
  96. ],
  97. //模板消息
  98. 'tMessage' => [
  99. 'OPENTM207430125' => '操作成功通知',
  100. 'OPENTM401915538' => '审核通知',
  101. 'TM00006' => '充值通知',
  102. 'OPENTM201205968' => '订单送达通知',
  103. 'OPENTM207777535' => '付款提醒',
  104. 'OPENTM401761342' => '订单价格修改通知',
  105. 'OPENTM205211943' => '会员升级通知',
  106. 'TM00230' => '积分变动通知',
  107. 'OPENTM200605630' => '任务处理通知',
  108. 'OPENTM207422813' => '收入提醒',
  109. 'OPENTM202297555' => '下单成功通知',
  110. 'OPENTM207327227' => '宝贝售出提醒',
  111. 'OPENTM207188526' => '付款成功',
  112. ],
  113. //用户来源
  114. 'userSource' => [
  115. 0 => 'official',
  116. 1 => 'alipay',
  117. 2 => 'mini',
  118. ],
  119. 'userSourceGetId' => [
  120. 'official' => ['id' => 0, 'name' => 'official'],
  121. 'alipay' => ['id' => 1, 'name' => 'alipay'],
  122. 'mini' => ['id' => 2, 'name' => 'mini'],
  123. ],
  124. //达达取消原因
  125. 'dadaCancelReason' => [
  126. [
  127. 'id' => 1,
  128. 'reason' => '没有配送员接单',
  129. ],
  130. [
  131. 'id' => 2,
  132. 'reason' => '配送员没来取货',
  133. ],
  134. [
  135. 'id' => 3,
  136. 'reason' => '配送员态度太差',
  137. ],
  138. [
  139. 'id' => 4,
  140. 'reason' => '顾客取消订单',
  141. ],
  142. [
  143. 'id' => 5,
  144. 'reason' => '订单填写错误',
  145. ],
  146. [
  147. 'id' => 34,
  148. 'reason' => '配送员让我取消此单',
  149. ],
  150. [
  151. 'id' => 35,
  152. 'reason' => '配送员不愿上门取货',
  153. ],
  154. [
  155. 'id' => 36,
  156. 'reason' => '我不需要配送了',
  157. ],
  158. [
  159. 'id' => 37,
  160. 'reason' => '配送员以各种理由表示无法完成订单',
  161. ],
  162. ]
  163. ];
  164. //取配置文件的值
  165. public static function getDict($category, $first = null, $second = null)
  166. {
  167. $respond = self::$data[$category];
  168. if (isset($first) && isset($second)) {
  169. if (isset($respond[$first][$second]) == false) {
  170. util::fail("没有找到相应字典 category:{$category} first:{$first} second:{$second}");
  171. }
  172. return $respond[$first][$second];
  173. }
  174. if (isset($first)) {
  175. if (isset($respond[$first]) == false) {
  176. util::fail("没有找到相应字典 category:{$category} first:{$first}");
  177. }
  178. return $respond[$first];
  179. }
  180. return $respond;
  181. }
  182. //列出所有的常量 ssh 2021.3.18
  183. public static function get()
  184. {
  185. $respond = self::$data;
  186. return $respond;
  187. }
  188. }