* Finish task#8465.

This commit is contained in:
qiyu-xie
2020-11-23 20:56:34 +08:00
parent b42d47e257
commit c658c271f4
7 changed files with 28 additions and 18 deletions
+22 -12
View File
@@ -1208,13 +1208,18 @@ class programModel extends model
if(dao::isError()) return false;
}
}
/* Judge products not empty. */
if(!$_POST['products'][0])
{
dao::$errors[] = $this->lang->program->productNotEmpty;
return false;
}
/* Judge products not empty. */
$linkedProductsCount = 0;
foreach($_POST['products'] as $product)
{
if(!empty($product)) $linkedProductsCount++;
}
if(empty($linkedProductsCount))
{
dao::$errors[] = $this->lang->program->productNotEmpty;
return false;
}
$requiredFields = $this->config->program->PRJCreate->requiredFields;
@@ -1336,13 +1341,18 @@ class programModel extends model
if(dao::isError()) return false;
}
}
/* Judge products not empty. */
if(!$_POST['products'][0])
{
dao::$errors[] = $this->lang->program->productNotEmpty;
return false;
}
/* Judge products not empty. */
$linkedProductsCount = 0;
foreach($_POST['products'] as $product)
{
if(!empty($product)) $linkedProductsCount++;
}
if(empty($linkedProductsCount))
{
dao::$errors[] = $this->lang->program->productNotEmpty;
return false;
}
$project = $this->loadModel('file')->processImgURL($project, $this->config->program->editor->prjedit['id'], $this->post->uid);