dict.php 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203
  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, 'debtPay' => 3],
  27. 'payWayName' => [0 => '微信', 1 => '支付宝', 2 => '余额', 3 => '欠款'],
  28. 'payWayFullName' => [0 => '微信支付', 1 => '支付宝', 2 => '余额支付', 3 => '欠款支付'],
  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. //流水类型,充值支付回调时的订单类型
  55. "capitalType" => [
  56. 'xhOrder' => ['id' => 0, 'name' => 'xhOrder'],
  57. 'xhActiveOrder' => ['id' => 2, 'name' => 'xhActiveOrder'],
  58. //充值
  59. 'xhRecharge' => ['id' => 4, 'name' => 'xhRecharge'],
  60. //支付宝关联微信
  61. 'xhUserUnite' => ['id' => 5, 'name' => 'xhUserUnite'],
  62. 'xhDrawCash' => ['id' => 6, 'name' => 'xhDrawCash'],
  63. 'xhApplyOrder' => ['id' => 7, 'name' => 'xhApplyOrder'],
  64. 'xhMergeUser' => ['id' => 8, 'name' => 'xhMergeUser'],
  65. 'xhRenew' => ['id' => 9, 'name' => 'xhRenew'],
  66. //供货商订单
  67. 'xhGhsOrder' => ['id' => 10, 'name' => 'xhGhsOrder'],
  68. //花店采购
  69. 'xhPurchase' => ['id' => 11, 'name' => 'xhPurchase'],
  70. //培训报名
  71. 'pxApply' => ['id' => 12, 'name' => 'pxApply'],
  72. ],
  73. "capitalTypeList" => [//流水类型的对应链接,后台收支明细查看时跳转的链接
  74. 0 => ['link' => '/capital/order-detail', 'name' => '网店', 'orderLink' => '/order/detail', 'id' => 0,],
  75. 2 => ['link' => '/capital/active-order-detail', 'name' => '活动报名', 'orderLink' => '', 'id' => 2,],
  76. 4 => ['link' => '/capital/recharge-detail', 'name' => '充值', 'orderLink' => '', 'id' => 4,],
  77. 5 => ['link' => '/capital/user-unite', 'name' => '帐号关联', 'orderLink' => '', 'id' => 5,],
  78. 6 => ['link' => '/capital/draw-cash', 'name' => '提现', 'orderLink' => '', 'id' => 6,],
  79. 7 => ['link' => '/capital/apply-order-detail', 'name' => '接入申请', 'orderLink' => '', 'id' => 7,],
  80. 8 => ['link' => '/capital/merge-user', 'name' => '帐号合并', 'orderLink' => '', 'id' => 8,],
  81. 9 => ['link' => '/capital/renew', 'name' => '续费', 'orderLink' => '', 'id' => 9,],
  82. 10 => ['link' => '/capital/order-detail', 'name' => '订单', 'orderLink' => '', 'id' => 10,],
  83. 11 => ['link' => '/capital/purchase-detail', 'name' => '订单', 'orderLink' => '', 'id' => 11,],
  84. 12 => ['link' => '/capital/purchase-detail', 'name' => '培训报名', 'orderLink' => '', 'id' => 12,],
  85. ],
  86. //模板消息
  87. 'tMessage' => [
  88. 'OPENTM207430125' => '操作成功通知',
  89. 'OPENTM401915538' => '审核通知',
  90. 'TM00006' => '充值通知',
  91. 'OPENTM201205968' => '订单送达通知',
  92. 'OPENTM207777535' => '付款提醒',
  93. 'OPENTM401761342' => '订单价格修改通知',
  94. 'OPENTM205211943' => '会员升级通知',
  95. 'TM00230' => '积分变动通知',
  96. 'OPENTM200605630' => '任务处理通知',
  97. 'OPENTM207422813' => '收入提醒',
  98. 'OPENTM202297555' => '下单成功通知',
  99. 'OPENTM207327227' => '宝贝售出提醒',
  100. 'OPENTM207188526' => '付款成功',
  101. ],
  102. //用户来源
  103. 'userSource' => [
  104. 0 => 'official',
  105. 1 => 'alipay',
  106. 2 => 'mini',
  107. ],
  108. 'userSourceGetId' => [
  109. 'official' => ['id' => 0, 'name' => 'official'],
  110. 'alipay' => ['id' => 1, 'name' => 'alipay'],
  111. 'mini' => ['id' => 2, 'name' => 'mini'],
  112. ],
  113. //达达取消原因
  114. 'dadaCancelReason' => [
  115. [
  116. 'id' => 1,
  117. 'reason' => '没有配送员接单',
  118. ],
  119. [
  120. 'id' => 2,
  121. 'reason' => '配送员没来取货',
  122. ],
  123. [
  124. 'id' => 3,
  125. 'reason' => '配送员态度太差',
  126. ],
  127. [
  128. 'id' => 4,
  129. 'reason' => '顾客取消订单',
  130. ],
  131. [
  132. 'id' => 5,
  133. 'reason' => '订单填写错误',
  134. ],
  135. [
  136. 'id' => 34,
  137. 'reason' => '配送员让我取消此单',
  138. ],
  139. [
  140. 'id' => 35,
  141. 'reason' => '配送员不愿上门取货',
  142. ],
  143. [
  144. 'id' => 36,
  145. 'reason' => '我不需要配送了',
  146. ],
  147. [
  148. 'id' => 37,
  149. 'reason' => '配送员以各种理由表示无法完成订单',
  150. ],
  151. ]
  152. ];
  153. //取配置文件的值
  154. public static function getDict($category, $first = null, $second = null)
  155. {
  156. $respond = self::$data[$category];
  157. if (isset($first) && isset($second)) {
  158. if (isset($respond[$first][$second]) == false) {
  159. util::fail("没有找到相应字典 category:{$category} first:{$first} second:{$second}");
  160. }
  161. return $respond[$first][$second];
  162. }
  163. if (isset($first)) {
  164. if (isset($respond[$first]) == false) {
  165. util::fail("没有找到相应字典 category:{$category} first:{$first}");
  166. }
  167. return $respond[$first];
  168. }
  169. }
  170. //列出所有的常量 ssh 2021.3.18
  171. public static function get()
  172. {
  173. $respond = self::$data;
  174. return $respond;
  175. }
  176. }