* fix bug#345.
This commit is contained in:
@@ -86,7 +86,12 @@ class productplanModel extends model
|
||||
public function create()
|
||||
{
|
||||
$plan = fixer::input('post')->stripTags('title')->get();
|
||||
$this->dao->insert(TABLE_PRODUCTPLAN)->data($plan)->autoCheck()->batchCheck($this->config->productplan->create->requiredFields, 'notempty')->exec();
|
||||
$this->dao->insert(TABLE_PRODUCTPLAN)
|
||||
->data($plan)
|
||||
->autoCheck()
|
||||
->batchCheck($this->config->productplan->create->requiredFields, 'notempty')
|
||||
->check('end', 'gt', $plan->begin)
|
||||
->exec();
|
||||
if(!dao::isError()) return $this->dao->lastInsertID();
|
||||
}
|
||||
|
||||
@@ -101,7 +106,13 @@ class productplanModel extends model
|
||||
{
|
||||
$oldPlan = $this->getById($planID);
|
||||
$plan = fixer::input('post')->stripTags('title')->get();
|
||||
$this->dao->update(TABLE_PRODUCTPLAN)->data($plan)->autoCheck()->batchCheck($this->config->productplan->edit->requiredFields, 'notempty')->where('id')->eq((int)$planID)->exec();
|
||||
$this->dao->update(TABLE_PRODUCTPLAN)
|
||||
->data($plan)
|
||||
->autoCheck()
|
||||
->batchCheck($this->config->productplan->edit->requiredFields, 'notempty')
|
||||
->check('end', 'gt', $plan->begin)
|
||||
->where('id')->eq((int)$planID)
|
||||
->exec();
|
||||
if(!dao::isError()) return common::createChanges($oldPlan, $plan);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user