dict.php 16 KB

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