Fix error on sql error (field does not exists)

This commit is contained in:
Laurent Destailleur 2018-06-08 16:49:14 +02:00
parent 485dc9a57a
commit 95d5a1088b
2 changed files with 3 additions and 1 deletions

View File

@ -143,6 +143,7 @@ class ProjectStats extends Stats
if (! empty($this->userid))
$sqlwhere[] = ' t.fk_user_resp=' . $this->userid;
// Forced filter on socid is similar to forced filter on project. TODO Use project assignement to allow to not use filter on project
if (! empty($this->socid))
$sqlwhere[] = ' t.fk_soc=' . $this->socid;
if (! empty($this->year) && empty($this->yearmonth))

View File

@ -138,8 +138,9 @@ class TaskStats extends Stats
if (! empty($this->userid))
$sqlwhere[] = ' t.fk_user_resp=' . $this->userid;
// Forced filter on socid is similar to forced filter on project. TODO Use project assignement to allow to not use filter on project
if (! empty($this->socid))
$sqlwhere[] = ' t.fk_soc=' . $this->socid;
$sqlwhere[] = ' p.fk_soc=' . $this->socid; // Link on thirdparty is on project, not on task
if (! empty($this->year) && empty($this->yearmonth))
$sqlwhere[] = " date_format(t.datec,'%Y')='" . $this->db->escape($this->year) . "'";
if (! empty($this->yearmonth))