dict.php 11 KB

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