wesley hace 7 años
padre
commit
eebeb36597

+ 2 - 1
app/Http/Controllers/Api/V1/HomeController.php

xqd
@@ -1371,7 +1371,8 @@ class HomeController extends Controller
         });
 
 
-        $usableCards = CardInfoModel::where('user_id', $user->id)->where('status', 1)->where('end_time', '>=', now())->where('product_id', 'like', '%' . request('product_id') . '%')->get();
+        $current_product = ProductInfoModel::find(request('product_id'));
+        $usableCards = CardInfoModel::where('user_id', $user->id)->where('status', 1)->where('end_time', '>=', now())->where('product_id', 'like', '%' . request('product_id') . '%')->where('min_price','<=',$current_product->origin_price)->get();
         foreach ($usableCards as $card) {
             $card->product = $card->product();
         }

+ 1 - 1
resources/views/admin/product/info/index.blade.php

xqd
@@ -41,7 +41,7 @@
                             <th class="sorting" data-sort="category_id"> 所属产品</th>
                             <th class="sorting" data-sort="origin_price">原价</th>
                             <th class="sorting" data-sort="current_price"> 优惠价</th>
-                            <th class="sorting" data-sort="service_time"> 优惠价</th>
+                            <th class="sorting" data-sort="service_time"> 服务时长</th>
                             <th class="sorting" data-sort="created_at"> 创建时间</th>
                             <th width="22%">相关操作</th>
                         </tr>