dict.php 14 KB

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