Kirin il y a 3 ans
Parent
commit
4c42664aac
1 fichiers modifiés avec 1 ajouts et 0 suppressions
  1. 1 0
      app/models/store/StoreProduct.php

+ 1 - 0
app/models/store/StoreProduct.php

@@ -116,6 +116,7 @@ class StoreProduct extends BaseModel
         $model->order($baseOrder . 'sort DESC, add_time DESC');
         $list = $model->page((int)$page, (int)$limit)->field('id,store_name,store_info,keyword,cate_id,image,IFNULL(sales,0) + IFNULL(ficti,0) as sales,price,stock,ot_price')->select()->each(function ($item) use ($uid, $type, $store_id) {
             $item['percent'] = bcdiv($item['stock'], bcadd($item['stock'], $item['sales']), 4) * 100;
+            $item['keyword'] = explode(',', $item['keyword']);
             if ($type) {
                 $item['is_att'] = StoreProductAttrValueModel::where('product_id', $item['id'])->count() ? true : false;
                 if ($uid) $item['cart_num'] = StoreCart::where('is_pay', 0)->where('is_del', 0)->where('is_new', 0)->where('type', 'product')->where('product_id', $item['id'])->where('uid', $uid)->value('cart_num');