dict.php 9.0 KB

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