Skip to content

Commit

Permalink
Merge pull request #165 from uplink42/dev
Browse files Browse the repository at this point in the history
fixed bug with totals
  • Loading branch information
uplink42 authored Apr 25, 2017
2 parents 118d05d + 10ab51a commit 8d4f9d6
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 9 deletions.
2 changes: 1 addition & 1 deletion application/controllers/Updater.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public function index()
$this->load->model('Updater_profit_model', 'profits');
$this->profits->beginProfitCalculation($username);
// update totals and history
$this->Updater_model->updateTotals();
$this->Updater_model->updateTotals($username);
$this->db->trans_complete();

if ($this->db->trans_status() === false) {
Expand Down
2 changes: 1 addition & 1 deletion application/controllers/internal/Async_procedure.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public function index($iduser)
$this->load->model('Updater_profit_model', 'profits');
$this->profits->beginProfitCalculation($username);
// update totals and history
$this->Updater_model->updateTotals(true, $username);
$this->Updater_model->updateTotals($username, true);
// send email
$this->db->where('iduser', $iduser);
$query = $this->db->get('user');
Expand Down
8 changes: 1 addition & 7 deletions application/models/Updater_model.php
Original file line number Diff line number Diff line change
Expand Up @@ -727,14 +727,8 @@ public function setNewInfo() : void
* @param string|null $user username
* @return array result list, only for non global update
*/
public function updateTotals(bool $global = false, string $user = null)
public function updateTotals(string $user = null, bool $global = false)
{
if (!$global) {
$username = $this->username;
} else {
$username = $user;
}

$this->db->select('name, character_eve_idcharacter');
$this->db->where('username', $username);
$character_list = $this->db->get('v_user_characters');
Expand Down

0 comments on commit 8d4f9d6

Please sign in to comment.