dict.php 9.1 KB

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