dict.php 9.7 KB

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