dict.php 8.0 KB

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