Ver Fonte

Merge branch 'dev_wf' of wugg/phpstock into version1.5

wufeng há 2 anos atrás
pai
commit
331b2eb9e7
1 ficheiros alterados com 6 adições e 6 exclusões
  1. 6 6
      app/admin/controller/Resign.php

+ 6 - 6
app/admin/controller/Resign.php

@@ -142,14 +142,14 @@ class Resign extends BaseController
         }
 
         //校验数量
-        $goodnake =Db::name("good_nake")
-            ->field('id')
-            ->where([["spuCode","=",$good_code],["is_del","=",0]])
-            ->where('min_num','<=',$good_num)
-            ->order("min_num desc")
+        $goodnake = Db::name("good_nake")
+            ->field('id,min_num')
+            ->where([["spuCode", "=", $good_code], ["is_del", "=", 0]])
+            ->order("min_num asc")
             ->find();
 
-        if(empty($goodnake)) return error_show(1004,'未找到符合条件的商品成本数据');
+        if (empty($goodnake)) return error_show(1004, '未找到商品成本数据');
+        if ($goodnake['min_num'] > $good_num) return error_show(1004, '该商品最低采购数量为' . $goodnake['min_num']);
 
 
         $lastime = isset($this->post['lastime'])&&$this->post['lastime']!="" ? $this->post['lastime']:"";