* Fix test unit error.

This commit is contained in:
tianshujie
2023-12-23 15:09:46 +08:00
parent a364d34a33
commit 6067378d26
2 changed files with 4 additions and 4 deletions
+3 -3
View File
@@ -405,7 +405,7 @@ class productplanModel extends model
*/
public function create(object $plan, int $isFuture): int|false
{
$product = $this->loadModel('product')->getByID($plan->product);
$product = $this->loadModel('product')->getByID((int)$plan->product);
if($product->type != 'normal' && $plan->branch == '')
{
$this->lang->product->branch = sprintf($this->lang->product->branch, $this->lang->product->branchName[$product->type]);
@@ -427,7 +427,7 @@ class productplanModel extends model
$plan->begin = $isFuture || empty($plan->begin) ? $this->config->productplan->future : $plan->begin;
$plan->end = $isFuture || empty($plan->end) ? $this->config->productplan->future : $plan->end;
$plan = $this->loadModel('file')->processImgURL($plan, $this->config->productplan->editor->create['id'], $this->post->uid);
$plan = $this->loadModel('file')->processImgURL($plan, $this->config->productplan->editor->create['id'], (string)$this->post->uid);
$this->dao->insert(TABLE_PRODUCTPLAN)->data($plan)
->autoCheck()
->batchCheck($this->config->productplan->create->requiredFields, 'notempty')
@@ -484,7 +484,7 @@ class productplanModel extends model
}
if(dao::isError()) return false;
$plan = $this->loadModel('file')->processImgURL($plan, $this->config->productplan->editor->edit['id'], $this->post->uid);
$plan = $this->loadModel('file')->processImgURL($plan, $this->config->productplan->editor->edit['id'], (string)$this->post->uid);
$this->dao->update(TABLE_PRODUCTPLAN)->data($plan)
->autoCheck()
->batchCheck($this->config->productplan->edit->requiredFields, 'notempty')
+1 -1
View File
@@ -27,5 +27,5 @@ $storyIdList[] = array(4);
$storyIdList[] = array(1111);
$plan = new productPlan('admin');
r($plan->linkStory($planID[0], $storyIdList[0])) && p('4:plan,story,order') && e('2,4,1'); //关联计划id为2的需求4
r($plan->linkStory($planID[0], $storyIdList[0])) && p('4:plan,story,order') && e('2,4,2'); //关联计划id为2的需求4
r($plan->linkStory($planID[1], $storyIdList[1])) && p() && e('0'); //传入不存在id的情况