diff --git a/Application/Admin/Controller/AutoController.class.php b/Application/Admin/Controller/AutoController.class.php index a441c54f0..ba3504d8e 100644 --- a/Application/Admin/Controller/AutoController.class.php +++ b/Application/Admin/Controller/AutoController.class.php @@ -1070,7 +1070,6 @@ public function auto_rrdae(){ private function promoteWithdraw($settlement = 1, $initial = false) { $withdrawModel = new WithdrawModel(); - $map['id'] = 84; $map['level'] = 1; $map['ver_status'] = 1; $map['settlement_type'] = ($settlement == 3) ? 1 : $settlement; @@ -1083,17 +1082,22 @@ public function auto_rrdae(){ $error_repeat = 0; if (!empty($promotes)) { + switch ($settlement) { + case 1: + $fun = 'promoteWithdrawWeeklyByPromote'; + break; + case 2: + $fun = 'promoteWithdrawPerMonthByPromote'; + break; + case 3: + $fun = 'promoteWithdrawRecoupByPromote'; + break; + } foreach ($promotes as $promote) { - switch ($settlement) { - case 1: - $result = $withdrawModel->promoteWithdrawWeeklyByPromote($promote, $initial); - break; - case 2: - $result = $withdrawModel->promoteWithdrawRecoupByPromote($promote, $initial); - break; - case 3: - $result = $withdrawModel->promoteWithdrawRecoupByPromote($promote); - break; + if ($fun == 'promoteWithdrawRecoupByPromote') { + $result = $withdrawModel->$fun($promote); + } else { + $result = $withdrawModel->$fun($promote, $initial); } switch ($result) { case -4: