* [bug#54426,done,0.5h] get oldProducts at first and hide delete button if it's unmodifiable.

This commit is contained in:
liumengyi
2024-09-20 10:23:47 +08:00
committed by 刘刚
parent 7b1e56711c
commit 5c3f340c6e
2 changed files with 5 additions and 4 deletions
+3 -2
View File
@@ -2118,12 +2118,13 @@ class execution extends control
if(!empty($_POST))
{
$oldProducts = $this->loadModel('product')->getProducts($executionID);
$oldProducts = array_keys($oldProducts);
$postData = form::data()->get();
$this->execution->updateProducts($executionID, $postData);
if(dao::isError()) return $this->sendError(dao::getError());
$oldProducts = $this->loadModel('product')->getProducts($executionID);
$oldProducts = array_keys($oldProducts);
$newProducts = $this->product->getProducts($executionID);
$newProducts = array_keys($newProducts);
$diffProducts = array_merge(array_diff($oldProducts, $newProducts), array_diff($newProducts, $oldProducts));