diff --git a/Application/Admin/Controller/CompanyStatementSetController.class.php b/Application/Admin/Controller/CompanyStatementSetController.class.php index 02e956cf5..8b5de7dac 100644 --- a/Application/Admin/Controller/CompanyStatementSetController.class.php +++ b/Application/Admin/Controller/CompanyStatementSetController.class.php @@ -376,13 +376,14 @@ class CompanyStatementSetController extends Controller { if($type < 2){ //非补点奖罚 $rrmap = array( - "confirm_time" => ['between', [$begintime,$endtime]], + "d.confirm_time" => ['between', [$begintime,$endtime]], "company_type"=>1, "company_id"=>$add_data['company_id'], "settlement_type"=>2, "is_verify"=>1, ); $rfres = M("RewardDetail","tab_") + ->alias("d") ->field(" IFNULL(SUM(CASE WHEN type = 1 THEN amount ELSE 0 END),0) as reward_count, IFNULL(SUM(CASE WHEN type = 2 THEN amount ELSE 0 END),0) as fine_count @@ -891,13 +892,14 @@ class CompanyStatementSetController extends Controller { if($type < 2){ //非补点计算奖罚 $rrmap = array( - "confirm_time" => ['between', [$begintime,$endtime]], + "d.confirm_time" => ['between', [$begintime,$endtime]], "company_type"=>2, "company_id"=>$add_data['company_id'], "settlement_type"=>2, "is_verify"=>1, ); $rfres = M("RewardDetail","tab_") + ->alias("d") ->field(" IFNULL(SUM(CASE WHEN type = 1 THEN amount ELSE 0 END),0) as reward_count, IFNULL(SUM(CASE WHEN type = 2 THEN amount ELSE 0 END),0) as fine_count