dict.php 17 KB

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