* adjust for fix first day.

This commit is contained in:
wangyidong
2017-05-11 14:30:28 +08:00
parent 6973cf1f39
commit c673bc92de
5 changed files with 11 additions and 20 deletions
+5 -3
View File
@@ -1557,16 +1557,18 @@ class projectModel extends model
* @access public
* @return void
*/
public function fixFirst($projectID, $withLeft = false)
public function fixFirst($projectID)
{
$project = $this->getById($projectID);
$burn = $this->dao->select('*')->from(TABLE_BURN)->where('project')->eq($projectID)->andWhere('date')->eq($project->begin)->fetch();
$project = $this->getById($projectID);
$burn = $this->dao->select('*')->from(TABLE_BURN)->where('project')->eq($projectID)->andWhere('date')->eq($project->begin)->fetch();
$withLeft = $this->post->withLeft ? $this->post->withLeft : 0;
$data = fixer::input('post')
->add('project', $projectID)
->add('date', $project->begin)
->add('left', $withLeft ? $this->post->estimate : $burn->left)
->add('consumed', empty($burn) ? 0 : $burn->consumed)
->remove('withLeft')
->get();
if(!is_numeric($data->estimate)) return false;