dict.php 19 KB

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