diff --git a/Application/Admin/Conf/config.php b/Application/Admin/Conf/config.php index 21dfe2b40..dba99dbaa 100644 --- a/Application/Admin/Conf/config.php +++ b/Application/Admin/Conf/config.php @@ -116,7 +116,6 @@ return array( 'OFFICIEL_CHANNEL'=>"江息网络", /*分库的表格*/ 'SUBSITE_TABLE'=>[ - "tab_spend", "sys_auth_group", "tab_index_chart", "tab_deposit", diff --git a/Application/Admin/Controller/ExportController.class.php b/Application/Admin/Controller/ExportController.class.php index 1258e596f..b7d925114 100644 --- a/Application/Admin/Controller/ExportController.class.php +++ b/Application/Admin/Controller/ExportController.class.php @@ -1198,9 +1198,10 @@ class ExportController extends Controller // $map = '1 = 2'; // $map1 = $map; // } + D("Spend")->addSubsiteWhere($map); $map1 = $map; $map1['pay_status'] = 1; - $total = SM('Spend','tab_')->where($map1)->sum('pay_amount'); + $total = M('Spend','tab_')->where($map1)->sum('pay_amount'); // var_dump($total);die(); $total=$total?$total:0; @@ -1276,7 +1277,7 @@ class ExportController extends Controller mb_convert_variables('GBK', 'UTF-8', $xlsCell); fputcsv($fp, $xlsCell);//将数据格式化为CSV格式并写入到output流中 - $accessNum = SM('Spend') + $accessNum = M('Spend',"tab_") ->where($map) ->count(); @@ -1285,7 +1286,7 @@ class ExportController extends Controller // var_dump($count);die(); for($i = 1; $i <= $pages; $i++) { - $xlsData = SM('Spend') + $xlsData = M('Spend',"tab_") ->field($fields) ->where($map) ->limit(($i-1)*$perSize ,$perSize) diff --git a/Application/Admin/Controller/RechargeSumController.class.php b/Application/Admin/Controller/RechargeSumController.class.php index 595322480..9ab46a840 100644 --- a/Application/Admin/Controller/RechargeSumController.class.php +++ b/Application/Admin/Controller/RechargeSumController.class.php @@ -80,11 +80,12 @@ class RechargeSumController extends ThinkController } $map['pay_status'] = 1; - $newAddPay = SM('spend',"tab_")->where(array_merge($map, array('_string' => '( small_id = 0 or small_id = user_id)')))->sum('pay_amount'); + D("Spend")->addSubsiteWhere($map); + $newAddPay = M('spend',"tab_")->where(array_merge($map, array('_string' => '( small_id = 0 or small_id = user_id)')))->sum('pay_amount'); //当天累计付费 unset($map['user_id']); - $accumulated = SM('spend',"tab_")->where($map)->sum('pay_amount'); + $accumulated = M('spend',"tab_")->where($map)->sum('pay_amount'); $data[$key]['date'] = date('Y-m-d', $start); $data[$key]['game_id'] = empty($_REQUEST['game_name']) ? "全部" : $_REQUEST['game_name']; diff --git a/wm.php b/wm.php index ab8dd2e59..d5ecedd70 100644 --- a/wm.php +++ b/wm.php @@ -35,9 +35,12 @@ define ( 'RUNTIME_PATH', './Runtime/' ); * 项目配置 */ $JBC_DB_CONFIG = include_once APP_PATH."/Common/Conf/env.php"; +if(!isset($JBC_DB_CONFIG['SUBSITE_DB_CONFIG']['WM_DB_CONFIG'])){ + die("请先配置子站点连接参数"); +} $JBC_DB_CONFIG = $JBC_DB_CONFIG['SUBSITE_DB_CONFIG']['WM_DB_CONFIG']; define ( 'IS_SUBSITE', true); -define ( 'PARTNER_TYPE', 2); +define ( 'PARTNER_TYPE', 1); define ( 'SUBSITE_NAME', "wm"); define ( 'SUBSITE_DB', $JBC_DB_CONFIG ); define ( 'SUBSITE_INDEX', "wm.php" );//子站点路口,影响session