正在显示
4 个修改的文件
包含
10 行增加
和
9 行删除
@@ -87,12 +87,12 @@ class Goods extends Frontend | @@ -87,12 +87,12 @@ class Goods extends Frontend | ||
87 | //获取评论 | 87 | //获取评论 |
88 | $evaluateModel = new Evaluate(); | 88 | $evaluateModel = new Evaluate(); |
89 | $comments_count1 = $evaluateModel->countData(['goods_id'=>$goods_id]);//全部评论数量 | 89 | $comments_count1 = $evaluateModel->countData(['goods_id'=>$goods_id]);//全部评论数量 |
90 | - $comments_count2 = $evaluateModel->countData(['goods_id'=>$goods_id,'level'=>['in',[5]]]);//好评评论数量 | ||
91 | - $comments_count3 = $evaluateModel->countData(['goods_id'=>$goods_id,'level'=>['in',[3,4]]]);//中评评论数量 | 90 | + $comments_count2 = $evaluateModel->countData(['goods_id'=>$goods_id,'level'=>['in',[4,5]]]);//好评评论数量 |
91 | + $comments_count3 = $evaluateModel->countData(['goods_id'=>$goods_id,'level'=>['in',[3]]]);//中评评论数量 | ||
92 | $comments_count4 = $evaluateModel->countData(['goods_id'=>$goods_id,'level'=>['in',[1,2]]]);//差评评论数量 | 92 | $comments_count4 = $evaluateModel->countData(['goods_id'=>$goods_id,'level'=>['in',[1,2]]]);//差评评论数量 |
93 | $comments1 = $evaluateModel->selectData(['goods_id'=>$goods_id]);//全部评论 | 93 | $comments1 = $evaluateModel->selectData(['goods_id'=>$goods_id]);//全部评论 |
94 | - $comments2 = $evaluateModel->selectData(['goods_id'=>$goods_id,'level'=>['in',[5]]]);//好评评论 | ||
95 | - $comments3 = $evaluateModel->selectData(['goods_id'=>$goods_id,'level'=>['in',[3,4]]]);//中评评论 | 94 | + $comments2 = $evaluateModel->selectData(['goods_id'=>$goods_id,'level'=>['in',[4,5]]]);//好评评论 |
95 | + $comments3 = $evaluateModel->selectData(['goods_id'=>$goods_id,'level'=>['in',[3]]]);//中评评论 | ||
96 | $comments4 = $evaluateModel->selectData(['goods_id'=>$goods_id,'level'=>['in',[1,2]]]);//差评评论 | 96 | $comments4 = $evaluateModel->selectData(['goods_id'=>$goods_id,'level'=>['in',[1,2]]]);//差评评论 |
97 | //计算好评、中评、差评率 | 97 | //计算好评、中评、差评率 |
98 | $probability1 = !empty($comments_count2) ? round(($comments_count2/$comments_count1)*100,2) : 0;//好评率 | 98 | $probability1 = !empty($comments_count2) ? round(($comments_count2/$comments_count1)*100,2) : 0;//好评率 |
@@ -295,7 +295,7 @@ class Member extends Frontend | @@ -295,7 +295,7 @@ class Member extends Frontend | ||
295 | $this->error('当前订单状态无法评价'); | 295 | $this->error('当前订单状态无法评价'); |
296 | } | 296 | } |
297 | $order['store_name'] = $store_model->where('id',$order['store_id'])->value('name'); | 297 | $order['store_name'] = $store_model->where('id',$order['store_id'])->value('name'); |
298 | - $order['goods'] = $order_info_model->where('order_id',$order['id'])->select(); | 298 | + $order['goods'] = $order_info_model->where('order_detail_id',$order['id'])->select(); |
299 | $this->view->assign('order',$order); | 299 | $this->view->assign('order',$order); |
300 | return $this->view->fetch(); | 300 | return $this->view->fetch(); |
301 | } | 301 | } |
@@ -65,7 +65,6 @@ class Order extends Frontend | @@ -65,7 +65,6 @@ class Order extends Frontend | ||
65 | ]; | 65 | ]; |
66 | } | 66 | } |
67 | $goodsModel = new \app\index\model\Goods(); | 67 | $goodsModel = new \app\index\model\Goods(); |
68 | - $goods_price = []; | ||
69 | $store_ids = []; | 68 | $store_ids = []; |
70 | foreach($data as $key1 => $vo){ | 69 | foreach($data as $key1 => $vo){ |
71 | //获取店铺id | 70 | //获取店铺id |
@@ -91,6 +90,7 @@ class Order extends Frontend | @@ -91,6 +90,7 @@ class Order extends Frontend | ||
91 | } | 90 | } |
92 | $store[$key2]['goods_ids'] = $goods_ids; | 91 | $store[$key2]['goods_ids'] = $goods_ids; |
93 | $goods_arr = []; | 92 | $goods_arr = []; |
93 | + $goods_price = []; | ||
94 | foreach($goods_ids as $key4 => $goods_id){ | 94 | foreach($goods_ids as $key4 => $goods_id){ |
95 | $goods = $goodsModel->findData(['g.id'=>$goods_id]); | 95 | $goods = $goodsModel->findData(['g.id'=>$goods_id]); |
96 | if($goods['inventory'] < $number[$key4]){ | 96 | if($goods['inventory'] < $number[$key4]){ |
@@ -122,6 +122,7 @@ class Order extends Frontend | @@ -122,6 +122,7 @@ class Order extends Frontend | ||
122 | //总合计 | 122 | //总合计 |
123 | $goods_total1 = 0; | 123 | $goods_total1 = 0; |
124 | $postage_total1 = 0; | 124 | $postage_total1 = 0; |
125 | +// dump(collection($store)->toArray()); | ||
125 | foreach($store as $key => $vo3){ | 126 | foreach($store as $key => $vo3){ |
126 | $goods_total1 = $goods_total1 + $vo3['goods_total']; | 127 | $goods_total1 = $goods_total1 + $vo3['goods_total']; |
127 | $postage_total1 = $postage_total1 + $vo3['postage_price']; | 128 | $postage_total1 = $postage_total1 + $vo3['postage_price']; |
@@ -190,7 +191,6 @@ class Order extends Frontend | @@ -190,7 +191,6 @@ class Order extends Frontend | ||
190 | ]; | 191 | ]; |
191 | } | 192 | } |
192 | $goodsModel = new \app\index\model\Goods(); | 193 | $goodsModel = new \app\index\model\Goods(); |
193 | - $goods_price = []; | ||
194 | $store_ids = []; | 194 | $store_ids = []; |
195 | foreach($data as $key1 => $vo){ | 195 | foreach($data as $key1 => $vo){ |
196 | //获取店铺id | 196 | //获取店铺id |
@@ -216,6 +216,7 @@ class Order extends Frontend | @@ -216,6 +216,7 @@ class Order extends Frontend | ||
216 | } | 216 | } |
217 | $store[$key2]['goods_ids'] = $goods_ids; | 217 | $store[$key2]['goods_ids'] = $goods_ids; |
218 | $goods_arr = []; | 218 | $goods_arr = []; |
219 | + $goods_price = []; | ||
219 | foreach($goods_ids as $key4 => $goods_id){ | 220 | foreach($goods_ids as $key4 => $goods_id){ |
220 | $goods = $goodsModel->findData(['g.id'=>$goods_id]); | 221 | $goods = $goodsModel->findData(['g.id'=>$goods_id]); |
221 | if($goods['inventory'] < $number[$key4]){ | 222 | if($goods['inventory'] < $number[$key4]){ |
@@ -303,7 +304,6 @@ class Order extends Frontend | @@ -303,7 +304,6 @@ class Order extends Frontend | ||
303 | } | 304 | } |
304 | } | 305 | } |
305 | $goodsModel = new \app\index\model\Goods(); | 306 | $goodsModel = new \app\index\model\Goods(); |
306 | - $goods_price = []; | ||
307 | $store_ids = []; | 307 | $store_ids = []; |
308 | foreach($data as $key1 => $vo){ | 308 | foreach($data as $key1 => $vo){ |
309 | //获取店铺id | 309 | //获取店铺id |
@@ -329,6 +329,7 @@ class Order extends Frontend | @@ -329,6 +329,7 @@ class Order extends Frontend | ||
329 | } | 329 | } |
330 | $store[$key2]['goods_ids'] = $goods_ids; | 330 | $store[$key2]['goods_ids'] = $goods_ids; |
331 | $goods_arr = []; | 331 | $goods_arr = []; |
332 | + $goods_price = []; | ||
332 | foreach($goods_ids as $key4 => $goods_id){ | 333 | foreach($goods_ids as $key4 => $goods_id){ |
333 | $goods = $goodsModel->findData(['g.id'=>$goods_id]); | 334 | $goods = $goodsModel->findData(['g.id'=>$goods_id]); |
334 | if($goods['inventory'] < $number[$key4]){ | 335 | if($goods['inventory'] < $number[$key4]){ |
@@ -745,7 +745,7 @@ | @@ -745,7 +745,7 @@ | ||
745 | }); | 745 | }); |
746 | var str = "<tr onclick=\"window.location.href='{:url('index/goods/detail',array('goods_id'=>'GOODS_ID'))}'\">\n" + | 746 | var str = "<tr onclick=\"window.location.href='{:url('index/goods/detail',array('goods_id'=>'GOODS_ID'))}'\">\n" + |
747 | " <td>"+vo.id+"</td>\n" + | 747 | " <td>"+vo.id+"</td>\n" + |
748 | - " <td><img src=\""+vo.thumbnail+"\" alt=\"\" style='width: 100px;height:50px'></td>\n" + | 748 | + " <td><img src=\""+vo.thumbnail+"\" alt=\"\" style='width: 100px;height:100px'></td>\n" + |
749 | " <td>"+vo.goodsname+"</td>\n" + | 749 | " <td>"+vo.goodsname+"</td>\n" + |
750 | " <td>"+vo.inventory+"</td>\n" + | 750 | " <td>"+vo.inventory+"</td>\n" + |
751 | " <td onclick=\"window.event.stopPropagation();window.location.href='{:url('index/shop/detail',array('store_id'=>'STORE_ID'))}'\">"+vo.store_name+property+"\n" + | 751 | " <td onclick=\"window.event.stopPropagation();window.location.href='{:url('index/shop/detail',array('store_id'=>'STORE_ID'))}'\">"+vo.store_name+property+"\n" + |
-
请 注册 或 登录 后发表评论