dict.php 8.8 KB

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