Просмотр исходного кода

Merge branch 'master' into huangfamily

family 1 год назад
Родитель
Сommit
969dafb18a

+ 3 - 0
app/common/repositories/store/product/ProductAttrValueRepository.php

@@ -122,6 +122,7 @@ class ProductAttrValueRepository extends BaseRepository
122 122
         //查询商品是否有货
123 123
         $stock = GongApiRequest::stock($sku_id,$address_id,$num);
124 124
         if($stock != '有货'){
125
+            Db::name('store_product')->where('product_id',$product_id)->update(['is_show' => 0, 'argument' => '此商品无货']);
125 126
             if($delivery){
126 127
                 return false;
127 128
             }else{
@@ -132,6 +133,7 @@ class ProductAttrValueRepository extends BaseRepository
132 133
         //查询商品上下架
133 134
         $goods_status = GongApiRequest::goods_status($spu_id);
134 135
         if(!isset($goods_status[0]['status']) || $goods_status[0]['status'] != 1){
136
+            Db::name('store_product')->where('product_id',$product_id)->update(['is_show' => 1, 'argument' => '此商品已下架'.json_encode($goods_status)]);
135 137
             if($delivery){
136 138
                 return false;
137 139
             }else{
@@ -142,6 +144,7 @@ class ProductAttrValueRepository extends BaseRepository
142 144
         //查询库存
143 145
         $sku_stock = GongApiRequest::sku_stock(json_encode($sku),$address_id);
144 146
         if(!isset($sku_stock[0]['stock']) || $sku_stock[0]['stock'] != '有货'){
147
+            Db::name('store_product')->where('product_id',$product_id)->update(['is_show' => 0, 'argument' => '此商品规格无货']);
145 148
             if($delivery){
146 149
                 return false;
147 150
             }else {

+ 3 - 0
app/common/repositories/store/product/ThirdPartyCategoryRepository.php

@@ -122,6 +122,7 @@ class ThirdPartyCategoryRepository extends BaseRepository
122 122
         //查询商品是否有货
123 123
         $stock = GongApiRequest::stock($sku_id,$address_id,$num);
124 124
         if($stock != '有货'){
125
+            Db::name('store_product')->where('product_id',$product_id)->update(['is_show' => 0, 'argument' => '此商品无货']);
125 126
             if($delivery){
126 127
                 return false;
127 128
             }else{
@@ -132,6 +133,7 @@ class ThirdPartyCategoryRepository extends BaseRepository
132 133
         //查询商品上下架
133 134
         $goods_status = GongApiRequest::goods_status($spu_id);
134 135
         if(!isset($goods_status[0]['status']) || $goods_status[0]['status'] != 1){
136
+            Db::name('store_product')->where('product_id',$product_id)->update(['is_show' => 0, 'argument' => '此商品已下架']);
135 137
             if($delivery){
136 138
                 return false;
137 139
             }else{
@@ -142,6 +144,7 @@ class ThirdPartyCategoryRepository extends BaseRepository
142 144
         //查询库存
143 145
         $sku_stock = GongApiRequest::sku_stock(json_encode($sku),$address_id);
144 146
         if(!isset($sku_stock[0]['stock']) || $sku_stock[0]['stock'] != '有货'){
147
+            Db::name('store_product')->where('product_id',$product_id)->update(['is_show' => 0, 'argument' => '此商品规格无货']);
145 148
             if($delivery){
146 149
                 return false;
147 150
             }else {