Quellcode durchsuchen

寄回,评价数量

lizhen_gitee vor 3 Monaten
Ursprung
Commit
a0357e1695

+ 1 - 0
addons/shopro/controller/Coupon.php

@@ -57,6 +57,7 @@ class Coupon extends Common
             ->goods($goods)       // 符合指定商品,并且检测商品所属分类
             ->order('id', 'desc');
 
+        //这里注释是因为多重循环导致不必要的数据结构
         /*if ($user) {
             // 关联用户优惠券
             $coupons = $coupons->with(['userCoupons']);

+ 3 - 0
addons/shopro/controller/goods/Goods.php

@@ -202,6 +202,9 @@ class Goods extends Common
         $goods['content'] = $content;
         unset($goods['new_sku_prices']);
 
+        //评价数量
+        $goods['comment_number'] = Db::name('shopro_goods_comment')->where('goods_id',$id)->where('status','normal')->where('deletetime',NULL)->count('id');
+
         $this->success('获取成功', $goods);
     }
 

+ 4 - 0
addons/shopro/controller/order/Aftersale.php

@@ -229,6 +229,10 @@ class Aftersale extends Common
             $this->error('商家还没有同意售后');
         }
 
+        // 不要重复寄回
+        if(!empty($aftersale['express_no'])){
+            $this->error('已经寄回了无需重复操作');
+        }
 
         $data = [
             'express_name' => $express['name'],