dict.php 13 KB

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