* Finish task#8334.

This commit is contained in:
leiyong
2020-11-12 13:23:39 +08:00
parent 29b585ba35
commit db4328a225
4 changed files with 12 additions and 21 deletions
+7 -16
View File
@@ -46,25 +46,16 @@ class workestimationModel extends model
*/
public function save($program)
{
$budget = $this->getBudget($program);
$postBudget = fixer::input('post')->get();
$postBudget->PRJ = $program;
if(empty($budget))
{
$this->dao->insert(TABLE_WORKESTIMATION)
->batchcheck($this->config->workestimation->index->requiredFields, 'notempty')
->data($postBudget)
->exec();
}
else
{
$postBudget->id = $budget->id;
$this->dao->replace(TABLE_WORKESTIMATION)
->batchcheck($this->config->workestimation->index->requiredFields, 'notempty')
->data($postBudget)
->exec();
}
$budget = $this->getBudget($program);
if(!empty($budget)) $postBudget->id = $budget->id;
$this->dao->replace(TABLE_WORKESTIMATION)->data($postBudget)
->batchCheck($this->config->workestimation->index->requiredFields, 'notempty')
->exec();
return !dao::isError();
}
}