common_global.php 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  1. <?php
  2. //获取URL访问的ROOT地址 网站的相对路径
  3. define('BASE_SITE_ROOT', str_replace('/index.php', '', \think\facade\Request::instance()->root()));
  4. define('PLUGINS_SITE_ROOT', BASE_SITE_ROOT.'/static/plugins');
  5. define('ADMIN_SITE_ROOT', BASE_SITE_ROOT.'/static/admin');
  6. define('HOME_SITE_ROOT', BASE_SITE_ROOT.'/static/home');
  7. define("REWRITE_MODEL", FALSE); // 设置伪静态
  8. if (!REWRITE_MODEL) {
  9. define('BASE_SITE_URL', \think\facade\Request::instance()->domain() . \think\facade\Request::instance()->baseFile());
  10. } else {
  11. // 系统开启伪静态
  12. if (empty(BASE_SITE_ROOT)) {
  13. define('BASE_SITE_URL', \think\facade\Request::instance()->domain());
  14. } else {
  15. define('BASE_SITE_URL', \think\facade\Request::instance()->domain() . \think\facade\Request::instance()->root());
  16. }
  17. }
  18. //检测是否安装 DSMALL 系统
  19. if(file_exists("install/") && !file_exists("install/install.lock")){
  20. header('Location: '.BASE_SITE_ROOT.'/install/install.php');
  21. exit();
  22. }
  23. //error_reporting(E_ALL ^ E_NOTICE);//显示除去 E_NOTICE 之外的所有错误信息
  24. //define('BASE_SITE_URL', BASE_SITE_URL);
  25. define('HOME_SITE_URL', BASE_SITE_URL.'/home');
  26. define('ADMIN_SITE_URL', BASE_SITE_URL.'/admin');
  27. define('API_SITE_URL', BASE_SITE_URL.'/api');
  28. define('UPLOAD_SITE_URL',str_replace('/index.php', '', BASE_SITE_URL).'/uploads');
  29. define('EXAMPLES_SITE_URL',str_replace('/index.php', '', BASE_SITE_URL).'/examples');
  30. define('CHAT_SITE_URL', str_replace('/index.php', '', BASE_SITE_URL).'/static/chat');
  31. define('SESSION_EXPIRE',3600);
  32. defined('APP_PATH') or define('APP_PATH', dirname($_SERVER['SCRIPT_FILENAME']) . DIRECTORY_SEPARATOR);
  33. defined('ROOT_PATH') or define('ROOT_PATH', dirname(realpath(APP_PATH)) . DIRECTORY_SEPARATOR);
  34. define('PUBLIC_PATH',ROOT_PATH.'public');
  35. define('PLUGINS_PATH',ROOT_PATH.'plugins');
  36. define('BASE_DATA_PATH',PUBLIC_PATH.'/data');
  37. define('BASE_UPLOAD_PATH',PUBLIC_PATH.'/uploads');
  38. define('BASE_STATIC_PATH',PUBLIC_PATH.'/static');
  39. define('TIMESTAMP',time());
  40. define('DIR_HOME','home');
  41. define('DIR_ADMIN','admin');
  42. define('DIR_UPLOAD','public/uploads');
  43. define('ATTACH_PATH','home');
  44. define('ATTACH_COMMON',ATTACH_PATH.'/common');
  45. define('ATTACH_AVATAR',ATTACH_PATH.'/avatar');
  46. define('ATTACH_INVITER',ATTACH_PATH.'/inviter');
  47. define('ATTACH_BARGAIN',ATTACH_PATH.'/bargain');
  48. define('ATTACH_EDITOR',ATTACH_PATH.'/editor');
  49. define('ATTACH_MEMBERTAG',ATTACH_PATH.'/membertag');
  50. define('ATTACH_IDCARD_IMAGE',ATTACH_PATH.'/idcard_image');
  51. define('ATTACH_STORE',ATTACH_PATH.'/store');
  52. define('ATTACH_STORECLASS',ATTACH_PATH.'/storeclass');
  53. define('ATTACH_GOODS',ATTACH_PATH.'/store/goods');
  54. define('ATTACH_TAOBAO',ATTACH_PATH.'/store/taobao');
  55. define('ATTACH_GOODS_RESOURCE',ATTACH_PATH.'/store/goods_resource');
  56. define('ATTACH_LOGIN',ATTACH_PATH.'/login');
  57. define('ATTACH_ARTICLE',ATTACH_PATH.'/article');
  58. define('ATTACH_EDITABLE_PAGE',ATTACH_PATH.'/editable_page');
  59. define('ATTACH_BRAND',ATTACH_PATH.'/brand');
  60. define('ATTACH_COMPLAIN',ATTACH_PATH.'/complain');
  61. define('ATTACH_GOODS_CLASS',ATTACH_PATH.'/goods_class');
  62. define('ATTACH_CHAIN',ATTACH_PATH.'/chain');
  63. define('ATTACH_ADV',ATTACH_PATH.'/adv');
  64. define('ATTACH_APPADV',ATTACH_PATH.'/appadv');
  65. define('ATTACH_ACTIVITY',ATTACH_PATH.'/activity');
  66. define('ATTACH_WATERMARK',ATTACH_PATH.'/watermark');
  67. define('ATTACH_POINTPROD',ATTACH_PATH.'/pointprod');
  68. define('ATTACH_GROUPBUY',ATTACH_PATH.'/groupbuy');
  69. define('ATTACH_LIVE_GROUPBUY',ATTACH_PATH.'/livegroupbuy');
  70. define('ATTACH_SLIDE',ATTACH_PATH.'/store/slide');
  71. define('ATTACH_VOUCHER',ATTACH_PATH.'/voucher');
  72. define('ATTACH_STORE_JOININ',ATTACH_PATH.'/store_joinin');
  73. define('ATTACH_MOBILE','mobile');
  74. define('ATTACH_MALBUM',ATTACH_PATH.'/member');
  75. define('ATTACH_MFLEA',ATTACH_PATH.'/member/flea');
  76. define('ATTACH_LIVE_APPLY',ATTACH_PATH.'/live_apply');
  77. define('ATTACH_MINIPRO_LIVE',ATTACH_PATH.'/minipro_live');
  78. define('TPL_SHOP_NAME','default');
  79. define('TPL_ADMIN_NAME', 'default');
  80. define('TPL_MEMBER_NAME', 'default');
  81. define('DEFAULT_CONNECT_SMS_TIME', 60);//倒计时时间
  82. define('MD5_KEY', 'a2382918dbb49c8643f19bc3ab90ecf9');
  83. define('CHARSET','UTF-8');
  84. define('ALLOW_IMG_EXT','jpg,png,gif,bmp,jpeg');#上传图片后缀
  85. define('ALLOW_IMG_SIZE',2097152);#上传图片大小(2MB)
  86. define('ALLOW_VIDEO_SIZE',20971520);#上传视频大小(20MB)
  87. define('HTTP_TYPE', \think\facade\Request::instance()->isSsl() ? 'https://' : 'http://');#是否为SSL
  88. define('VERIFY_CODE_INVALIDE_MINUTE',15);//验证码失效时间(分钟)
  89. /*
  90. * 商家入驻状态定义
  91. */
  92. //新申请
  93. define('STORE_JOIN_STATE_NEW', 10);
  94. //完成付款
  95. define('STORE_JOIN_STATE_PAY', 11);
  96. //初审成功
  97. define('STORE_JOIN_STATE_VERIFY_SUCCESS', 20);
  98. //初审失败
  99. define('STORE_JOIN_STATE_VERIFY_FAIL', 30);
  100. //付款审核失败
  101. define('STORE_JOIN_STATE_PAY_FAIL', 31);
  102. //开店成功
  103. define('STORE_JOIN_STATE_FINAL', 40);
  104. //默认颜色规格id(前台显示图片的规格)
  105. define('DEFAULT_SPEC_COLOR_ID', 1);
  106. /**
  107. * 店铺相册图片规格形式, 处理的图片包含 商品图片以及店铺SNS图片
  108. */
  109. define('GOODS_IMAGES_WIDTH', '240,480,1280');
  110. define('GOODS_IMAGES_HEIGHT', '240,480,1280');
  111. define('GOODS_IMAGES_EXT', '_240,_480,_1280');
  112. /**
  113. * 通用图片生成规格形式
  114. */
  115. define('COMMON_IMAGES_EXT', '_240,_480,_1280');
  116. /**
  117. * 订单状态
  118. */
  119. //已取消
  120. define('ORDER_STATE_CANCEL', 0);
  121. //已产生但未支付
  122. define('ORDER_STATE_NEW', 10);
  123. //待付定金
  124. define('ORDER_STATE_DEPOSIT', 14);
  125. //待付尾款
  126. define('ORDER_STATE_REST', 15);
  127. //已支付
  128. define('ORDER_STATE_PAY', 20);
  129. //已发货
  130. define('ORDER_STATE_SEND', 30);
  131. //待自提
  132. define('ORDER_STATE_PICKUP', 35);
  133. //已收货,交易成功
  134. define('ORDER_STATE_SUCCESS', 40);
  135. //默认未删除
  136. define('ORDER_DEL_STATE_DEFAULT', 0);
  137. //已删除
  138. define('ORDER_DEL_STATE_DELETE', 1);
  139. //彻底删除
  140. define('ORDER_DEL_STATE_DROP', 2);
  141. //订单结束后可评论时间,15天,60*60*24*15
  142. define('ORDER_EVALUATE_TIME', 1296000);
  143. //抢购订单状态
  144. define('OFFLINE_ORDER_CANCEL_TIME', 3);//单位为天
  145. /**
  146. * 直播类型
  147. */
  148. define('LIVE_APPLY_TYPE_GOODS', 2);
  149. ?>