浏览代码

Merge branch 'master' into dev

shish 8 月之前
父节点
当前提交
ca699059fb

+ 6 - 5
app-ghs/controllers/ProductController.php

@@ -701,22 +701,23 @@ class ProductController extends BaseController
                     util::fail('没有找到花材');
                 }
                 $productName = $productInfo->name ?? '';
-                if (isset($product['id']) == false) {
+
+                if (!isset($product['id'])) {
                     util::fail('没有花材');
                 }
-                if (isset($product['price']) == false || is_numeric($product['price']) == false || $product['price'] < 0) {
+                if (!isset($product['price']) || !is_numeric($product['price']) || $product['price'] < 0) {
                     util::fail('请填写' . $productName . '的批发价');
                 }
                 $price = $product['price'];
-                if (isset($product['skPrice']) == false || is_numeric($product['skPrice']) == false || $product['skPrice'] < 0) {
+                if (!isset($product['skPrice']) || !is_numeric($product['skPrice']) || $product['skPrice'] < 0) {
                     util::fail('请填写' . $productName . '的零售价');
                 }
                 $skPrice = $product['skPrice'];
-                if (isset($product['hjPrice']) == false || is_numeric($product['hjPrice']) == false || $product['hjPrice'] < 0) {
+                if (!isset($product['hjPrice']) || !is_numeric($product['hjPrice']) || $product['hjPrice'] < 0) {
                     util::fail('请填写' . $productName . '的会员价');
                 }
                 $hjPrice = $product['hjPrice'] ?? 0;
-                if (isset($productInfo->mainId) == false || $productInfo->mainId != $this->mainId) {
+                if (!isset($productInfo->mainId) || $productInfo->mainId != $this->mainId) {
                     util::fail('无法访问');
                 }
                 if ($hjPrice > $price) {

+ 2 - 2
app-ghs/controllers/PurchaseOrderController.php

@@ -362,7 +362,7 @@ class PurchaseOrderController extends BaseController
         set_time_limit(0);
 
         $shopAdmin = $this->shopAdmin;
-        if (isset($shopAdmin->super) == false || $shopAdmin->super != 1) {
+        if (!isset($shopAdmin->super) || $shopAdmin->super != 1) {
             util::fail('超管才能修改');
         }
 
@@ -372,7 +372,7 @@ class PurchaseOrderController extends BaseController
             $get = Yii::$app->request->get();
             $id = $get['id'] ?? 0;
             $cg = PurchaseOrderClass::getLockById($id);
-            if (isset($cg->mainId) == false || $cg->mainId != $this->mainId) {
+            if (!isset($cg->mainId) || $cg->mainId != $this->mainId) {
                 util::fail('请确认是否您的采购单');
             }
 

+ 6 - 0
biz-ghs/order/classes/PurchaseOrderClass.php

@@ -554,6 +554,12 @@ class PurchaseOrderClass extends BaseClass
                 util::fail('没有找到花材哦');
             }
 
+            //有新入库就清掉做特价活动 ssh 20251112
+            $product->discountPrice = 0;
+            $product->skDiscountPrice = 0;
+            $product->hjDiscountPrice = 0;
+            $product->save();
+
             if ($presell == 0) {
 
                 //加库存和流水记录