From b460166b8c38fb33cc4ddc03629365f971b7d102 Mon Sep 17 00:00:00 2001 From: sugar1569 Date: Fri, 2 Nov 2018 16:04:13 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=BA=A7=E5=93=81=E9=94=80?= =?UTF-8?q?=E9=87=8F=E6=8E=92=E8=A1=8C=E8=AE=A1=E7=AE=97=E6=80=BB=E9=A2=9D?= =?UTF-8?q?bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/admin/model/store/StoreProduct.php | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/application/admin/model/store/StoreProduct.php b/application/admin/model/store/StoreProduct.php index 36998f4d..b806c656 100644 --- a/application/admin/model/store/StoreProduct.php +++ b/application/admin/model/store/StoreProduct.php @@ -71,13 +71,7 @@ class StoreProduct extends ModelBasic $model = $model->where('p.store_name|p.keyword|p.id','LIKE',"%$where[store_name]%"); } if(isset($where['cate_id']) && trim($where['cate_id'])!=''){ - $cate=CategoryModel::where('id',$where['cate_id'])->find(); - if($cate['pid']==0){ - $arr=CategoryModel::where('pid',$cate['id'])->column('id'); - $model = $model->where('p.cate_id','in',$arr); - }else{ - $model = $model->where('p.cate_id','LIKE',"%$where[cate_id]%"); - } + $model = $model->where('p.cate_id','LIKE',"%$where[cate_id]%"); } if(isset($where['order']) && $where['order']!=''){ $model = $model->order(self::setOrder($where['order'])); @@ -386,7 +380,7 @@ class StoreProduct extends ModelBasic ->select(); $count=self::setWhere($where)->where('a.is_pay',1)->group('a.product_id')->count(); foreach ($data as &$item){ - $item['sum_price']=bcdiv($item['num_product'],$item['price'],2); + $item['sum_price']=bcmul($item['num_product'],$item['price'],2); } return compact('data','count'); }