Kirin 2 年之前
父節點
當前提交
1820d85e7e

+ 1 - 1
app/admin/controller/store/StoreProduct.php

@@ -420,7 +420,7 @@ class StoreProduct extends AuthController
             ['in_stock', 0],
         ]);
         if ($where['in_stock'] < 1) return app('json')->fail('补货数量不能少于1');
-        $info = StoreProductAttrValue::alias('a')->join("StoreProduct b", "a.product_id=b.id", "left")->where('a.bar_code', $where['bar_code'])->field('a.price,a.unique,a.stock as in_stock,a.product_id,b.store_name,b.image,a.bar_code')->find();
+        $info = StoreProductAttrValue::alias('a')->join("StoreProduct b", "a.product_id=b.id", "left")->where('a.type', 0)->where('a.bar_code', $where['bar_code'])->field('a.price,a.unique,a.stock as in_stock,a.product_id,b.store_name,b.image,a.bar_code')->find();
         if (!$info) return app('json')->fail('商品条形码不存在');
         $info = $info->toarray();
         $info['in_stock'] = $where['in_stock'];

+ 0 - 1
app/admin/controller/store/StoreProductCheck.php

@@ -489,7 +489,6 @@ class StoreProductCheck extends AuthController
     public function check_ok($id)
     {
         $info = ProductModel::get($id);
-
         if (!$info || $info['status'] != 0 || $this->adminInfo['store_id'] != 0) {
             Json::fail('参数或身份错误');
         }

+ 1 - 1
app/models/system/SystemStoreStock.php

@@ -39,7 +39,7 @@ class SystemStoreStock extends BaseModel
         $data['store_id'] = $store_id;
         $data['in_stock'] = $num;
         $all = [];
-        $rs = StoreProductAttrValue::where('product_id', 'in', array_keys($list))->field('product_id,unique,image,bar_code,price')->select()->toArray();
+        $rs = StoreProductAttrValue::where('product_id', 'in', array_keys($list))->where('type', 0)->field('product_id,unique,image,bar_code,price')->select()->toArray();
         foreach ($rs as $v) {
             $data['product_id'] = $v['product_id'];
             $data['in_last_time'] = time();