dict.php 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483
  1. <?php
  2. namespace common\components;
  3. //字典
  4. class dict
  5. {
  6. public static $data = [
  7. 'transType' => [
  8. //德邦
  9. 'db' => 0,
  10. //顺丰
  11. 'sh' => 1,
  12. //冷链
  13. 'll' => 2,
  14. //航空
  15. 'hk' => 3,
  16. 'local' => 4,
  17. ],
  18. //昆明基地包装费计算
  19. 'kmPackCost' => [
  20. ['num' => 10, 'amount' => 15],
  21. ['num' => 25, 'amount' => 25],
  22. ['num' => 30, 'amount' => 30],
  23. ['num' => 40, 'amount' => 35],
  24. ['num' => 50, 'amount' => 40],
  25. ['num' => 60, 'amount' => 45],
  26. ['num' => 80, 'amount' => 65],
  27. ['num' => 100, 'amount' => 80],
  28. ],
  29. //测试环境
  30. // 'kmPackCost' => [
  31. // ['num' => 10, 'amount' => 0.15],
  32. // ['num' => 25, 'amount' => 0.25],
  33. // ['num' => 30, 'amount' => 0.3],
  34. // ['num' => 40, 'amount' => 0.35],
  35. // ['num' => 50, 'amount' => 0.40],
  36. // ['num' => 60, 'amount' => 0.45],
  37. // ['num' => 80, 'amount' => 0.65],
  38. // ['num' => 100, 'amount' => 0.8],
  39. // ],
  40. //重量计算标准,包括德邦、顺丰、冷链和航空。其中冷链物流,40公斤以下小件,60公斤以下中件,100公斤以下大件
  41. 'transCost' => [
  42. ['sign' => 0, 'perKiloCost' => 5],
  43. ['sign' => 1, 'perKiloCost' => 9],
  44. ['sign' => 2, 'option' => [['num' => 20, 'amount' => 50], ['num' => 30, 'amount' => 80], ['num' => 50, 'amount' => 120], ['num' => 70, 'amount' => 180], ['num' => 100, 'amount' => 200]]],
  45. ['sign' => 3, 'perKiloCost' => 4],
  46. ['sign' => 4, 'perKiloCost' => 0],
  47. ],
  48. //测试环境,德邦、顺丰、冷链和航空
  49. // 'transCost' => [
  50. // ['sign' => 0, 'perKiloCost' => 0.05],
  51. // ['sign' => 1, 'perKiloCost' => 0.09],
  52. // ['sign' => 2, 'option' => [['num' => 40, 'amount' => 0.05], ['num' => 60, 'amount' => 0.1], ['num' => 100, 'amount' => 0.2]]],
  53. // ['sign' => 3, 'perKiloCost' => 0.04],
  54. // ],
  55. //默认开启订阅消息
  56. 'subscribeMessage' => 1,
  57. 'hdMiniMessage' => [
  58. //优惠券到账通知
  59. 'giveCoupon' => ['msgId' => '_MqYqXLgNPWvHg-tUuh3vJMTb2aAOvvIFf0Vm2pwjiI'],
  60. //购买成功通知
  61. 'cgSuccess' => ['msgId' => 'UAIsxaFbkyi34CRYqncQ6pNsjNgn6Gcqte_AoHmPbxA'],
  62. //账单生成提醒
  63. 'remindHdClear' => ['msgId' => 'Xyjo2M0uMbrTLg76wuMf0b7i_tqjcqosKj-hACDHPds'],
  64. //发货通知
  65. 'fhNotice' => ['msgId' => 'WyktXtxES58RwUbkXhD1N9lNNmxM3tNKiOuDf_YG_DQ'],
  66. //售后通知
  67. 'afterSale' => ['msgId' => 'QbQLZy-Mxv1wrqKHhaH8lM6BuXDZv4IoOZPHpJQmMTY'],
  68. ],
  69. 'hdMiniMessageDev' => [
  70. //优惠券到账通知
  71. 'giveCoupon' => ['msgId' => 'r7BIUWRqpVmqqOqdtq5BhjffkLyOaZxi0fvme_l-V8A'],
  72. //购买成功通知
  73. 'cgSuccess' => ['msgId' => 'ZfCmPfD96W_H0-pWDyQHCJQC5ht41NXtTS8nP28xKQQ'],
  74. //账单生成提醒
  75. 'remindHdClear' => ['msgId' => '1mj55S920TbW_iF_jpHQrdVShs7LQgPBzy_GeU3kbhk'],
  76. //发货通知
  77. 'fhNotice' => ['msgId' => 'aqrvfRVus0PbxaSeqhuPd6W4T7awoQX9nIT2y2jLPB0'],
  78. //售后通知
  79. 'afterSale' => ['msgId' => 'eLRc2blfKBMsuGHkFnQ_rWDBZwMmJErr7L-BDwAHBLc'],
  80. ],
  81. 'mtConfig' => [
  82. 'app_id' => '119094',
  83. 'app_secret' => 'b7e86d768391180f805621b40ec31e33',
  84. 'request_url' => '', // 默认 `https://waimaiopen.meituan.com/api/v1/`
  85. ],
  86. //小程序原始ID
  87. 'miniOriginalId' => [
  88. 'dev' => ['mall' => 'gh_071ff9f39df6', 'hd' => 'gh_177befc881cb', 'ghs' => 'gh_2a429284375a', 'jd' => '',],
  89. 'product' => ['mall' => 'gh_38f1a1af64ca', 'hd' => 'gh_73b8b357d19a', 'ghs' => 'gh_2e886744af66', 'jd' => '',],
  90. 'current' => ['mall' => '', 'hd' => '', 'ghs' => '', 'jd' => '',],
  91. ],
  92. //是否需要打印
  93. 'needPrint' => [
  94. 'need' => 1,
  95. 'noNeed' => 2,
  96. ],
  97. //结账方式
  98. 'hasPay' => [
  99. //待付款,扫码付
  100. 'unPay' => 0,
  101. //线下
  102. 'payed' => 1,
  103. //欠款
  104. 'debt' => 2,
  105. //现金
  106. 'cash' => 3,
  107. ],
  108. 'hasPayMap' => [
  109. ],
  110. //产品属性
  111. 'property' => [
  112. //商品
  113. 'goods' => 0,
  114. //花材
  115. 'item' => 1,
  116. ],
  117. //单位类型 0大单位 1小单位
  118. 'unitType' => [
  119. 'big' => 0,
  120. 'small' => 1,
  121. ],
  122. //配送方式,0免费送货 1到店自取 2跑腿 3发物流 4快递
  123. 'sendType' => [
  124. 'carGet' => 0,
  125. 'shopGet' => 1,
  126. 'thirdSend' => 2,
  127. 'wl' => 3,
  128. 'express' => 4,
  129. ],
  130. //批发店囤货时显示给零售库存的最高值
  131. 'showMaxStock' => 260,
  132. //余额满miniCashAmount才能提现
  133. 'miniCashAmount' => 1,
  134. //本条流水的余额是否可以提现
  135. 'yeTx' => [
  136. //不可以
  137. 'canNot' => 1,
  138. //可以
  139. 'can' => 2,
  140. ],
  141. //平台资产
  142. 'ptAsset' => [
  143. 'hdBalance' => ['id' => 1, 'name' => '零售余额'],
  144. 'ghsBalance' => ['id' => 2, 'name' => '供货商余额'],
  145. 'hdTxBalance' => ['id' => 3, 'name' => '零售可提现'],
  146. 'ghsTxBalance' => ['id' => 4, 'name' => '供货商可提现'],
  147. ],
  148. //是否在线支付
  149. 'onlinePay' => ['not' => 1, 'yes' => 2],
  150. //商家开单了,客户多少秒后未付款,自动标记欠款。由于未付款单自动标记为欠款,商家开的订单360天内都不过期。此功能弃用
  151. 'local_gys_kd_auto_set_debt_time' => 600,
  152. //客户采购订单有效期是多少秒,有效期内可以支付,到期自动取消。
  153. 'order_pay_has_time' => 600,
  154. //客户采购线上付款的,在订单到期前多少秒还能支付
  155. 'order_online_pay_has_ahead_time' => 100,
  156. 'expressList' => [
  157. [
  158. "id" => 1,
  159. "deliveryId" => "dada",
  160. "deliveryName" => "达达"
  161. ]
  162. ],
  163. //默认的日期搜索选项
  164. 'dateDefaultOption' => [
  165. ['name' => '昨天', 'value' => 'yesterday'],
  166. ['name' => '今天', 'value' => 'today',],
  167. ['name' => '本月', 'value' => 'thisMonth',],
  168. ['name' => '上月', 'value' => 'lastMonth',],
  169. ['name' => '今年', 'value' => 'thisYear',],
  170. ],
  171. //所属平台类型
  172. 'ptStyle' => [
  173. 'hd' => 1,//零售花店端
  174. 'ghs' => 2,//二级批发端
  175. 'mall' => 3,//商城端
  176. 'kmGhs' => 4,//基地端
  177. ],
  178. //订单发起方,与ptStyle一致
  179. 'cgStyle' => [
  180. 'hd' => 1,//零售花店端
  181. 'ghs' => 2,//二级批发端
  182. 'mall' => 3,//商城端
  183. 'kmGhs' => 4,//基地端
  184. ],
  185. //结帐方式
  186. 'clearStyle' => [
  187. 'hd2Gys' => 1,//零售主动供货商结帐
  188. 'gys2Hd' => 2,//供货商要求花店结帐
  189. 'gys2KmGys' => 3,//供货商向昆明供货商结帐
  190. 'kmGys2gys' => 4,//昆明供货商向供货商结账
  191. ],
  192. 'merchantStatus' => ['checking' => 0, 'pass' => 1, 'noPass' => 2, 'freeze' => 3, 'unfreeze' => 4, 'shut' => 5],
  193. //涨价方式
  194. 'riseType' => ['noRise' => 0, 'percent' => 1, 'amount' => 2,],
  195. 'riseTypeName' => [0 => '不涨价', 1 => '按百分比', 2 => '按金额'],
  196. //支付方式
  197. 'payWay' => ['wxPay' => 0, 'alipay' => 1, 'balancePay' => 2, 'debtPay' => 3, 'cash' => 4, 'bankCard' => 5, 'unknown' => 9, 'unPay' => 10,],
  198. 'payWayName' => [0 => '微信', 1 => '支付宝', 2 => '余额', 3 => '欠款', 4 => '现金', 5 => '银行卡', 9 => '其它', 10 => '待付款'],
  199. 'payWayFullName' => [0 => '微信支付', 1 => '支付宝', 2 => '余额支付', 3 => '欠款支付', 4 => '现金', 5 => '银行卡', 9 => '其它', 10 => '待付款'],
  200. //后台支付方式选项
  201. 'htPayWayOption' => [
  202. ['name' => '微信', 'id' => 0],
  203. ['name' => '支付宝', 'id' => 1],
  204. ['name' => '现金', 'id' => 4],
  205. ['name' => '银行卡', 'id' => 5],
  206. ],
  207. //优惠类型
  208. 'discountType' => [
  209. //没有优惠
  210. 'noDiscount' => 1,
  211. //使用平台优惠券
  212. 'usePtCoupon' => 2,
  213. //商家打折
  214. 'discount' => 3,
  215. //红包
  216. 'hb' => 4,
  217. ],
  218. 'payStatus' => ['cancel' => -1, 'waitForPay' => 0, 'waitForSend' => 1],
  219. 'sendStatusName' => [0 => '待发货', 1 => '送货中', 2 => '已送达'],
  220. 'sendStatus' => ['waitForSend' => 0, 'sending' => 1, 'reached' => 2],
  221. 'replyType' => ['redirectUrl' => 0, 'text' => 1, 'news' => 2, 'multiNews' => 3],
  222. 'goodsStatusName' => [0 => '正常', 1 => '下架', 2 => '删除'],
  223. 'goodsStatus' => ['online' => 0, 'soldOut' => 1, 'del' => 2],
  224. 'goodsDelStatusName' => [0 => '正常,未删除', 1 => '删除'],
  225. 'goodsDelStatus' => ['normal' => 0, 'del' => 1],
  226. 'reachPeriodName' => [0 => '上午', 1 => '下午', 2 => '晚上'],
  227. 'reachPeriod' => ['am' => 0, 'pm' => 1, 'night' => 2],
  228. //运费
  229. 'freight' => [
  230. 'firstDistance' => 5000,//5公里内
  231. 'firstPrice' => 0,//16元运费
  232. 'nextDistance' => 1000,//每增加1公里
  233. 'nextPrice' => 2,//增加2元
  234. ],
  235. "io" => ['payout' => 0, 'income' => 1, 'other' => 2],
  236. "ioName" => [0 => '支出', 1 => '收入', 2 => '其它'],
  237. //流水类型,充值支付回调时的订单类型
  238. "capitalType" => [
  239. 'xhOrder' => ['id' => 0, 'name' => 'xhOrder'],
  240. 'xhActiveOrder' => ['id' => 2, 'name' => 'xhActiveOrder'],
  241. //充值
  242. 'xhRecharge' => ['id' => 4, 'name' => 'xhRecharge'],
  243. //支付宝关联微信
  244. 'xhUserUnite' => ['id' => 5, 'name' => 'xhUserUnite'],
  245. 'xhDrawCash' => ['id' => 6, 'name' => 'xhDrawCash'],
  246. 'xhApplyOrder' => ['id' => 7, 'name' => 'xhApplyOrder'],
  247. 'xhMergeUser' => ['id' => 8, 'name' => 'xhMergeUser'],
  248. 'xhRenew' => ['id' => 9, 'name' => 'xhRenew'],
  249. //供货商订单
  250. 'xhGhsOrder' => ['id' => 10, 'name' => 'xhGhsOrder'],
  251. //零售采购
  252. 'xhPurchase' => ['id' => 11, 'name' => 'xhPurchase'],
  253. //培训报名
  254. 'pxApply' => ['id' => 12, 'name' => 'pxApply'],
  255. //花店采购结算
  256. 'hdPurchaseClear' => ['id' => 20, 'name' => 'hdPurchaseClear'],
  257. //供货商采购
  258. 'ghsPurchase' => ['id' => 25, 'name' => 'ghsPurchase'],
  259. //供货商出库
  260. 'ghsCheckOut' => ['id' => 26, 'name' => 'ghsCheckOut'],
  261. //供货商入库
  262. 'ghsCheckIn' => ['id' => 27, 'name' => 'ghsCheckIn'],
  263. 'usePtCoupon' => ['id' => 30, 'name' => 'usePtCoupon'],
  264. 'wastage' => ['id' => 35, 'name' => 'wastage'],
  265. //零售采购退款
  266. 'cgRefund' => ['id' => 38, 'name' => 'cgRefund'],
  267. //供货商销售退款
  268. 'saleRefund' => ['id' => 40, 'name' => 'saleRefund'],
  269. 'pd' => ['id' => 45, 'name' => 'pd'],
  270. //供货商的佣金 lqh 2021.12.11
  271. 'brokerage' => ['id' => 46, 'name' => 'brokerage'],
  272. //供货商销售单对账
  273. 'ghsXsClear' => ['id' => 20, 'name' => 'ghsXsClear'],
  274. //城市供货商的预订单多付退款
  275. 'ghsBookRefund' => ['id' => 48, 'name' => 'ghsBookRefund'],
  276. //花店预订退款
  277. 'hdBookRefund' => ['id' => 50, 'name' => 'hdBookRefund'],
  278. //城市供货商的预订单少付补款
  279. 'ghsBookOrderGetBack' => ['id' => 51, 'name' => 'ghsBookOrderGetBack'],
  280. //花店预订补尾款
  281. 'hdBookFinalPay' => ['id' => 52, 'name' => 'hdBookFinalPay'],
  282. 'hdCgPlant' => ['id' => 53, 'name' => 'hdCgPlant'],
  283. //花店订单退款
  284. 'hdOrderRefund' => ['id' => 54, 'name' => 'hdOrderRefund'],
  285. //存入现金
  286. 'inMoney' => ['id' => 55, 'name' => 'inMoney'],
  287. //取出现金
  288. 'outMoney' => ['id' => 56, 'name' => 'outMoney'],
  289. //支出登记
  290. 'expendRegister' => ['id' => 57, 'name' => 'expendRegister'],
  291. //花店销售结账单
  292. 'hdXsClear' => ['id' => 58, 'name' => 'hdXsClear'],
  293. 'hdRefund' => ['id' => 59, 'name' => 'hdRefund'],
  294. 'ljhApply' => ['id' => 60, 'name' => 'ljhApply'],
  295. //供货商结账支出
  296. 'ghsClearExpend' => ['id' => 61, 'name' => 'ghsClearExpend'],
  297. ],
  298. "capitalTypeList" => [//流水类型的对应链接,后台收支明细查看时跳转的链接
  299. 0 => ['link' => '/capital/order-detail', 'name' => '网店', 'orderLink' => '/order/detail', 'id' => 0,],
  300. 2 => ['link' => '/capital/active-order-detail', 'name' => '活动报名', 'id' => 2,],
  301. 4 => ['link' => '/capital/recharge-detail', 'name' => '充值', 'id' => 4,],
  302. 5 => ['link' => '/capital/user-unite', 'name' => '帐号关联', 'id' => 5,],
  303. 6 => ['link' => '/capital/draw-cash', 'name' => '提现', 'id' => 6,],
  304. 7 => ['link' => '/capital/apply-order-detail', 'name' => '接入申请', 'id' => 7,],
  305. 8 => ['link' => '/capital/merge-user', 'name' => '帐号合并', 'id' => 8,],
  306. 9 => ['link' => '/capital/renew', 'name' => '续费', 'id' => 9,],
  307. 10 => ['link' => '/capital/order-detail', 'name' => '订单', 'id' => 10,],
  308. 11 => ['link' => '/capital/purchase-detail', 'name' => '订单', 'id' => 11,],
  309. 12 => ['link' => '/capital/purchase-detail', 'name' => '培训报名', 'id' => 12,],
  310. 20 => ['link' => '', 'name' => '采购结算', 'id' => 20,],
  311. 25 => ['link' => '', 'name' => '采购', 'id' => 25,],
  312. 30 => ['link' => '', 'name' => '使用平台优惠券', 'id' => 30,],
  313. 35 => ['link' => '', 'name' => '报损', 'id' => 35,],
  314. 38 => ['link' => '', 'name' => '采购退款', 'id' => 38,],
  315. 40 => ['link' => '', 'name' => '销售退款', 'id' => 40,],
  316. 45 => ['link' => '', 'name' => '盘点', 'id' => 45,],
  317. 46 => ['link' => '', 'name' => '佣金', 'id' => 46,],
  318. 48 => ['link' => '', 'name' => '预订单多退少补', 'id' => 48,],
  319. 50 => ['link' => '', 'name' => '预订单多退少补', 'id' => 50,],
  320. 51 => ['link' => '', 'name' => '预订单补款', 'id' => 51,],
  321. 52 => ['link' => '', 'name' => '花店预订补尾款', 'id' => 52,],
  322. 53 => ['link' => '', 'name' => '采购盆栽等', 'id' => 53,],
  323. 54 => ['link' => '', 'name' => '退货退款', 'id' => 54,],
  324. 55 => ['link' => '', 'name' => '存入现金', 'id' => 55,],
  325. 56 => ['link' => '', 'name' => '取出现金', 'id' => 56,],
  326. 57 => ['link' => '', 'name' => '支出登记', 'id' => 57,],
  327. 58 => ['link' => '', 'name' => '结算', 'id' => 58,],
  328. 59 => ['link' => '', 'name' => '退货退款', 'id' => 59,],
  329. 60 => ['link' => '', 'name' => '零交会报名', 'id' => 60,],
  330. 61 => ['link' => '', 'name' => '结账支出', 'id' => 61,],
  331. ],
  332. //用户来源
  333. 'userSource' => [
  334. 0 => 'official',
  335. 1 => 'alipay',
  336. 2 => 'mini',
  337. 3 => 'app',
  338. ],
  339. 'userSourceGetId' => [
  340. 'official' => ['id' => 0, 'name' => 'official'],
  341. 'alipay' => ['id' => 1, 'name' => 'alipay'],
  342. 'mini' => ['id' => 2, 'name' => 'mini'],
  343. 'app' => ['id' => 3, 'name' => 'app'],
  344. ],
  345. //达达取消原因
  346. 'dadaCancelReason' => [
  347. [
  348. 'id' => 1,
  349. 'reason' => '没有配送员接单',
  350. ],
  351. [
  352. 'id' => 2,
  353. 'reason' => '配送员没来取货',
  354. ],
  355. [
  356. 'id' => 3,
  357. 'reason' => '配送员态度太差',
  358. ],
  359. [
  360. 'id' => 4,
  361. 'reason' => '顾客取消订单',
  362. ],
  363. [
  364. 'id' => 5,
  365. 'reason' => '订单填写错误',
  366. ],
  367. [
  368. 'id' => 34,
  369. 'reason' => '配送员让我取消此单',
  370. ],
  371. [
  372. 'id' => 35,
  373. 'reason' => '配送员不愿上门取货',
  374. ],
  375. [
  376. 'id' => 36,
  377. 'reason' => '我不需要配送了',
  378. ],
  379. [
  380. 'id' => 37,
  381. 'reason' => '配送员以各种理由表示无法完成订单',
  382. ],
  383. ],
  384. //来源
  385. 'fromType' => [
  386. 'shop' => 1,//门店
  387. 'mall' => 2,//商城
  388. 'friend' => 3,//微信客服号
  389. 'mt' => 4,//美团
  390. 'elm' => 5,//饿了么
  391. ],
  392. 'fromTypeMap' => [
  393. 1 => '门店',
  394. 2 => '商城',
  395. 3 => '微信',
  396. 4 => '美团',
  397. 5 => '饿了么',
  398. ],
  399. 'expendType' => [
  400. 'dz' => 0,//店租
  401. 'sd' => 1,//水电
  402. 'wy' => 2,//物业
  403. 'hs' => 3,//伙食
  404. 'fz' => 4,//房租
  405. 'qt' => 5,//其它
  406. ],
  407. 'expendTypeMap' => [
  408. 0 => '店租', 1 => '水电', 2 => '物业', 3 => '伙食', 4 => '房租', 5 => '其它',
  409. ],
  410. ];
  411. //取配置文件的值
  412. public static function getDict($category, $first = null, $second = null)
  413. {
  414. $respond = self::$data[$category];
  415. if (isset($first) && isset($second)) {
  416. if (isset($respond[$first][$second]) == false) {
  417. util::fail("没有找到相应字典 category:{$category} first:{$first} second:{$second}");
  418. }
  419. return $respond[$first][$second];
  420. }
  421. if (isset($first)) {
  422. if (isset($respond[$first]) == false) {
  423. util::fail("没有找到相应字典 category:{$category} first:{$first}");
  424. }
  425. return $respond[$first];
  426. }
  427. return $respond;
  428. }
  429. //列出所有的常量 ssh 2021.3.18
  430. public static function get()
  431. {
  432. $respond = self::$data;
  433. //根据环境获取小程序原始ID
  434. if (isset($respond['miniOriginalId']['dev'])) {
  435. $respond['miniOriginalId']['current'] = $respond['miniOriginalId']['dev'];
  436. }
  437. if (getenv('YII_ENV') == 'production') {
  438. if (isset($respond['miniOriginalId']['product'])) {
  439. $respond['miniOriginalId']['current'] = $respond['miniOriginalId']['product'];
  440. }
  441. }
  442. if (getenv('YII_ENV') != 'production') {
  443. $respond['hdMiniMessage'] = $respond['hdMiniMessageDev'];
  444. }
  445. return $respond;
  446. }
  447. }