Merge branch 'pailei'

This commit is contained in:
孙广明
2022-03-07 10:56:26 +08:00
54 changed files with 1012 additions and 419 deletions
+5 -1
View File
@@ -360,7 +360,7 @@ class productModel extends model
->andWhere('t2.vision')->eq($this->config->vision)
->beginIF(strpos($status, 'noclosed') !== false)->andWhere('t2.status')->ne('closed')->fi()
->orderBy($orderBy . 't2.order asc')
->fetchAll('id');
->fetchAll();
$products = array();
foreach($projectProducts as $product)
@@ -695,6 +695,7 @@ class productModel extends model
$this->loadModel('personnel')->updateWhitelist($whitelist, 'product', $productID);
if($product->acl != 'open') $this->loadModel('user')->updateUserView($productID, 'product');
if($product->type == 'normal' and $oldProduct->type != 'normal') $this->loadModel('branch')->unlinkBranch4Project($productID);
if($product->type != 'normal' and $oldProduct->type == 'normal') $this->loadModel('branch')->linkBranch4Project($productID);
return common::createChanges($oldProduct, $product);
}
@@ -745,6 +746,7 @@ class productModel extends model
if(dao::isError()) return print(js::error(dao::getError()));
$unlinkProducts = array();
$linkProducts = array();
foreach($products as $productID => $product)
{
$oldProduct = $oldProducts[$productID];
@@ -763,11 +765,13 @@ class productModel extends model
if($product->acl == 'open') $this->loadModel('personnel')->updateWhitelist('', 'product', $productID);
if($product->acl != 'open') $this->loadModel('user')->updateUserView($productID, 'product');
if($product->type == 'normal' and $oldProduct->type != 'normal') $unlinkProducts[] = $productID;
if($product->type != 'normal' and $oldProduct->type == 'normal') $linkProducts[] = $productID;
$allChanges[$productID] = common::createChanges($oldProduct, $product);
}
if(!empty($unlinkProducts)) $this->loadModel('branch')->unlinkBranch4Project($unlinkProducts);
if(!empty($linkProducts)) $this->loadModel('branch')->linkBranch4Project($linkProducts);
return $allChanges;
}