dict.php 10 KB

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