作者 王晓刚
1 个管道 的构建 通过 耗费 1 秒

订单?

... ... @@ -87,12 +87,12 @@ class Goods extends Frontend
//获取评论
$evaluateModel = new Evaluate();
$comments_count1 = $evaluateModel->countData(['goods_id'=>$goods_id]);//全部评论数量
$comments_count2 = $evaluateModel->countData(['goods_id'=>$goods_id,'level'=>['in',[5]]]);//好评评论数量
$comments_count3 = $evaluateModel->countData(['goods_id'=>$goods_id,'level'=>['in',[3,4]]]);//中评评论数量
$comments_count2 = $evaluateModel->countData(['goods_id'=>$goods_id,'level'=>['in',[4,5]]]);//好评评论数量
$comments_count3 = $evaluateModel->countData(['goods_id'=>$goods_id,'level'=>['in',[3]]]);//中评评论数量
$comments_count4 = $evaluateModel->countData(['goods_id'=>$goods_id,'level'=>['in',[1,2]]]);//差评评论数量
$comments1 = $evaluateModel->selectData(['goods_id'=>$goods_id]);//全部评论
$comments2 = $evaluateModel->selectData(['goods_id'=>$goods_id,'level'=>['in',[5]]]);//好评评论
$comments3 = $evaluateModel->selectData(['goods_id'=>$goods_id,'level'=>['in',[3,4]]]);//中评评论
$comments2 = $evaluateModel->selectData(['goods_id'=>$goods_id,'level'=>['in',[4,5]]]);//好评评论
$comments3 = $evaluateModel->selectData(['goods_id'=>$goods_id,'level'=>['in',[3]]]);//中评评论
$comments4 = $evaluateModel->selectData(['goods_id'=>$goods_id,'level'=>['in',[1,2]]]);//差评评论
//计算好评、中评、差评率
$probability1 = !empty($comments_count2) ? round(($comments_count2/$comments_count1)*100,2) : 0;//好评率
... ...
... ... @@ -295,7 +295,7 @@ class Member extends Frontend
$this->error('当前订单状态无法评价');
}
$order['store_name'] = $store_model->where('id',$order['store_id'])->value('name');
$order['goods'] = $order_info_model->where('order_id',$order['id'])->select();
$order['goods'] = $order_info_model->where('order_detail_id',$order['id'])->select();
$this->view->assign('order',$order);
return $this->view->fetch();
}
... ...
... ... @@ -65,7 +65,6 @@ class Order extends Frontend
];
}
$goodsModel = new \app\index\model\Goods();
$goods_price = [];
$store_ids = [];
foreach($data as $key1 => $vo){
//获取店铺id
... ... @@ -91,6 +90,7 @@ class Order extends Frontend
}
$store[$key2]['goods_ids'] = $goods_ids;
$goods_arr = [];
$goods_price = [];
foreach($goods_ids as $key4 => $goods_id){
$goods = $goodsModel->findData(['g.id'=>$goods_id]);
if($goods['inventory'] < $number[$key4]){
... ... @@ -122,6 +122,7 @@ class Order extends Frontend
//总合计
$goods_total1 = 0;
$postage_total1 = 0;
// dump(collection($store)->toArray());
foreach($store as $key => $vo3){
$goods_total1 = $goods_total1 + $vo3['goods_total'];
$postage_total1 = $postage_total1 + $vo3['postage_price'];
... ... @@ -190,7 +191,6 @@ class Order extends Frontend
];
}
$goodsModel = new \app\index\model\Goods();
$goods_price = [];
$store_ids = [];
foreach($data as $key1 => $vo){
//获取店铺id
... ... @@ -216,6 +216,7 @@ class Order extends Frontend
}
$store[$key2]['goods_ids'] = $goods_ids;
$goods_arr = [];
$goods_price = [];
foreach($goods_ids as $key4 => $goods_id){
$goods = $goodsModel->findData(['g.id'=>$goods_id]);
if($goods['inventory'] < $number[$key4]){
... ... @@ -303,7 +304,6 @@ class Order extends Frontend
}
}
$goodsModel = new \app\index\model\Goods();
$goods_price = [];
$store_ids = [];
foreach($data as $key1 => $vo){
//获取店铺id
... ... @@ -329,6 +329,7 @@ class Order extends Frontend
}
$store[$key2]['goods_ids'] = $goods_ids;
$goods_arr = [];
$goods_price = [];
foreach($goods_ids as $key4 => $goods_id){
$goods = $goodsModel->findData(['g.id'=>$goods_id]);
if($goods['inventory'] < $number[$key4]){
... ...
... ... @@ -745,7 +745,7 @@
});
var str = "<tr onclick=\"window.location.href='{:url('index/goods/detail',array('goods_id'=>'GOODS_ID'))}'\">\n" +
" <td>"+vo.id+"</td>\n" +
" <td><img src=\""+vo.thumbnail+"\" alt=\"\" style='width: 100px;height:50px'></td>\n" +
" <td><img src=\""+vo.thumbnail+"\" alt=\"\" style='width: 100px;height:100px'></td>\n" +
" <td>"+vo.goodsname+"</td>\n" +
" <td>"+vo.inventory+"</td>\n" +
" <td onclick=\"window.event.stopPropagation();window.location.href='{:url('index/shop/detail',array('store_id'=>'STORE_ID'))}'\">"+vo.store_name+property+"\n" +
... ...