This commit is contained in:
tianshujie
2024-05-28 09:04:40 +08:00
parent fffd6c1391
commit f994d2eddb
+5 -4
View File
@@ -2394,10 +2394,11 @@ class executionModel extends model
public function updateProducts(int $executionID, object|array $postData): bool
{
$this->loadModel('user');
$products = array_filter(array_merge(zget($postData, 'products', array()), zget($postData, 'otherProducts', array())));
$branches = zget($postData, 'branch', array(0));
$plans = zget($postData, 'plans', array());
$oldProducts = $this->dao->select('*')->from(TABLE_PROJECTPRODUCT)->where('project')->eq($executionID)->fetchGroup('product', 'branch');
$otherProducts = zget($postData, 'otherProducts', array());
$products = !empty($otherProducts) ? array_filter(array_merge(zget($postData, 'products', array()), $otherProducts)) : zget($postData, 'products', array());
$branches = zget($postData, 'branch', array(0));
$plans = zget($postData, 'plans', array());
$oldProducts = $this->dao->select('*')->from(TABLE_PROJECTPRODUCT)->where('project')->eq($executionID)->fetchGroup('product', 'branch');
if(empty($_POST['otherProducts'])) $this->dao->delete()->from(TABLE_PROJECTPRODUCT)->where('project')->eq($executionID)->exec();
$members = array_keys($this->getTeamMembers($executionID));
if(empty($products))