dict.php 15 KB

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