dict.php 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221
  1. <?php
  2. namespace common\components;
  3. //字典
  4. class dict
  5. {
  6. public static $data = [
  7. //采购和销售单的有效期
  8. 'sale_purchase_order_valid' => 180,
  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. //优惠类型
  46. 'discountType' => [
  47. //没有优惠
  48. 'noDiscount' => 1,
  49. //使用平台优惠券
  50. 'usePtCoupon' => 2,
  51. ],
  52. 'payStatus' => ['cancel' => -1, 'waitForPay' => 0, 'waitForSend' => 1],
  53. 'sendStatusName' => [0 => '待发货', 1 => '送货中', 2 => '已送达'],
  54. 'sendStatus' => ['waitForSend' => 0, 'sending' => 1, 'reached' => 2],
  55. 'replyType' => ['redirectUrl' => 0, 'text' => 1, 'news' => 2, 'multiNews' => 3],
  56. 'goodsStatusName' => [0 => '正常', 1 => '下架', 2 => '删除'],
  57. 'goodsStatus' => ['online' => 0, 'soldOut' => 1, 'del' => 2],
  58. 'goodsDelStatusName' => [0 => '正常,未删除', 1 => '删除'],
  59. 'goodsDelStatus' => ['normal' => 0, 'del' => 1],
  60. 'reachPeriodName' => [0 => '上午', 1 => '下午', 2 => '晚上'],
  61. 'reachPeriod' => ['am' => 0, 'pm' => 1, 'night' => 2],
  62. //运费
  63. 'freight' => [
  64. 'firstDistance' => 5000,//5公里内
  65. 'firstPrice' => 0,//16元运费
  66. 'nextDistance' => 1000,//每增加1公里
  67. 'nextPrice' => 2,//增加2元
  68. ],
  69. "io" => ['payout' => 0, 'income' => 1, 'other' => 2],
  70. "ioName" => [0 => '支出', 1 => '收入', 2 => '其它'],
  71. //流水类型,充值支付回调时的订单类型
  72. "capitalType" => [
  73. 'xhOrder' => ['id' => 0, 'name' => 'xhOrder'],
  74. 'xhActiveOrder' => ['id' => 2, 'name' => 'xhActiveOrder'],
  75. //充值
  76. 'xhRecharge' => ['id' => 4, 'name' => 'xhRecharge'],
  77. //支付宝关联微信
  78. 'xhUserUnite' => ['id' => 5, 'name' => 'xhUserUnite'],
  79. 'xhDrawCash' => ['id' => 6, 'name' => 'xhDrawCash'],
  80. 'xhApplyOrder' => ['id' => 7, 'name' => 'xhApplyOrder'],
  81. 'xhMergeUser' => ['id' => 8, 'name' => 'xhMergeUser'],
  82. 'xhRenew' => ['id' => 9, 'name' => 'xhRenew'],
  83. //供货商订单
  84. 'xhGhsOrder' => ['id' => 10, 'name' => 'xhGhsOrder'],
  85. //花店采购
  86. 'xhPurchase' => ['id' => 11, 'name' => 'xhPurchase'],
  87. //培训报名
  88. 'pxApply' => ['id' => 12, 'name' => 'pxApply'],
  89. //花店采购结算
  90. 'hdPurchaseClear' => ['id' => 20, 'name' => 'hdPurchaseClear'],
  91. ],
  92. "capitalTypeList" => [//流水类型的对应链接,后台收支明细查看时跳转的链接
  93. 0 => ['link' => '/capital/order-detail', 'name' => '网店', 'orderLink' => '/order/detail', 'id' => 0,],
  94. 2 => ['link' => '/capital/active-order-detail', 'name' => '活动报名', 'orderLink' => '', 'id' => 2,],
  95. 4 => ['link' => '/capital/recharge-detail', 'name' => '充值', 'orderLink' => '', 'id' => 4,],
  96. 5 => ['link' => '/capital/user-unite', 'name' => '帐号关联', 'orderLink' => '', 'id' => 5,],
  97. 6 => ['link' => '/capital/draw-cash', 'name' => '提现', 'orderLink' => '', 'id' => 6,],
  98. 7 => ['link' => '/capital/apply-order-detail', 'name' => '接入申请', 'orderLink' => '', 'id' => 7,],
  99. 8 => ['link' => '/capital/merge-user', 'name' => '帐号合并', 'orderLink' => '', 'id' => 8,],
  100. 9 => ['link' => '/capital/renew', 'name' => '续费', 'orderLink' => '', 'id' => 9,],
  101. 10 => ['link' => '/capital/order-detail', 'name' => '订单', 'orderLink' => '', 'id' => 10,],
  102. 11 => ['link' => '/capital/purchase-detail', 'name' => '订单', 'orderLink' => '', 'id' => 11,],
  103. 12 => ['link' => '/capital/purchase-detail', 'name' => '培训报名', 'orderLink' => '', 'id' => 12,],
  104. 20 => ['link' => '', 'name' => '采购结算', 'orderLink' => '', 'id' => 20,],
  105. ],
  106. //模板消息 平台类型: 1花店,2供货商,3商城
  107. 'tMessage' => [
  108. 1 => [
  109. 'OPENTM418105100' => '下单成功通知',
  110. ],
  111. 2 => [
  112. 'OPENTM418105100' => '下单成功通知',
  113. ],
  114. 3 => [
  115. 'OPENTM418105100' => '下单成功通知',
  116. ],
  117. ],
  118. //用户来源
  119. 'userSource' => [
  120. 0 => 'official',
  121. 1 => 'alipay',
  122. 2 => 'mini',
  123. ],
  124. 'userSourceGetId' => [
  125. 'official' => ['id' => 0, 'name' => 'official'],
  126. 'alipay' => ['id' => 1, 'name' => 'alipay'],
  127. 'mini' => ['id' => 2, 'name' => 'mini'],
  128. ],
  129. //达达取消原因
  130. 'dadaCancelReason' => [
  131. [
  132. 'id' => 1,
  133. 'reason' => '没有配送员接单',
  134. ],
  135. [
  136. 'id' => 2,
  137. 'reason' => '配送员没来取货',
  138. ],
  139. [
  140. 'id' => 3,
  141. 'reason' => '配送员态度太差',
  142. ],
  143. [
  144. 'id' => 4,
  145. 'reason' => '顾客取消订单',
  146. ],
  147. [
  148. 'id' => 5,
  149. 'reason' => '订单填写错误',
  150. ],
  151. [
  152. 'id' => 34,
  153. 'reason' => '配送员让我取消此单',
  154. ],
  155. [
  156. 'id' => 35,
  157. 'reason' => '配送员不愿上门取货',
  158. ],
  159. [
  160. 'id' => 36,
  161. 'reason' => '我不需要配送了',
  162. ],
  163. [
  164. 'id' => 37,
  165. 'reason' => '配送员以各种理由表示无法完成订单',
  166. ],
  167. ]
  168. ];
  169. //取配置文件的值
  170. public static function getDict($category, $first = null, $second = null)
  171. {
  172. $respond = self::$data[$category];
  173. if (isset($first) && isset($second)) {
  174. if (isset($respond[$first][$second]) == false) {
  175. util::fail("没有找到相应字典 category:{$category} first:{$first} second:{$second}");
  176. }
  177. return $respond[$first][$second];
  178. }
  179. if (isset($first)) {
  180. if (isset($respond[$first]) == false) {
  181. util::fail("没有找到相应字典 category:{$category} first:{$first}");
  182. }
  183. return $respond[$first];
  184. }
  185. return $respond;
  186. }
  187. //列出所有的常量 ssh 2021.3.18
  188. public static function get()
  189. {
  190. $respond = self::$data;
  191. return $respond;
  192. }
  193. }