dict.php 19 KB

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