Parcourir la Source

物流,刷新按钮

sunhao il y a 5 ans
Parent
commit
249d2444ef

+ 5 - 3
app/Http/Controllers/Admin/StatisticsController.php

@@ -309,7 +309,7 @@ class StatisticsController extends Controller
309 309
             //当日加粉
310 310
             $phones = DB::table('customers')->where('fanTime', $v['dtime'])->lists('phone');
311 311
             #当日加粉订单总计:
312
-            $order = DB::table('order')->select(DB::raw('sum(receivedAmount) as order_amount, count(1) as order_count, sum(cost) as order_cost'))->whereIn('receiverMobile', $phones)->where('createTime','<',$end_time)->where('is_del', 0)->where(function($query) use($team_id){
312
+            $order = DB::table('order')->select(DB::raw('sum(receivedAmount) as order_amount, count(1) as order_count, sum(cost) as order_cost, sum(freight_cost) as freight_cost'))->whereIn('receiverMobile', $phones)->where('createTime','<',$end_time)->where('is_del', 0)->where(function($query) use($team_id){
313 313
                 if($team_id>0) $query->where('team_id', $team_id);
314 314
             })->first();
315 315
             #当日新粉成单:            
@@ -339,8 +339,10 @@ class StatisticsController extends Controller
339 339
             $v['fugou_order_amount'] = $fugou->order_amount;
340 340
             #货品成本
341 341
             $v['order_cost'] = $order->order_cost;
342
+            //加物流成本
343
+            $v['freight_cost'] = $order->freight_cost;
342 344
             #毛利
343
-            $v['profit'] = $v['order_amount'] - $v['order_cost'] - $v['total_cost'];
345
+            $v['profit'] = $v['order_amount'] - $v['order_cost'] - $v['total_cost'] - $v['freight_cost'];
344 346
             //综合成单率 综合成单率=订单数/微信好友数
345 347
             $v['order_rate'] = $custDetail->wx_fan_add>0 ? round($order->order_count/$custDetail->wx_fan_add, 4) * 100 .'%' : '';
346 348
             //新粉成单率
@@ -351,7 +353,7 @@ class StatisticsController extends Controller
351 353
 
352 354
             //加roi
353 355
             $v['total_roi'] = $v['total_cost']>0 ? round($v['order_amount'] / $v['total_cost'], 4) * 100 .'%' : '';
354
-            $v['new_roi'] = $v['total_cost']>0 ? round($v['new_order_amount'] / $v['total_cost'], 4) * 100 .'%' : '';
356
+            $v['new_roi'] = $v['total_cost']>0 ? round($v['new_order_amount'] / $v['total_cost'], 4) * 100 .'%' : '';            
355 357
             
356 358
         }
357 359
 

+ 3 - 4
resources/views/order/orderlist.blade.php

@@ -36,7 +36,7 @@
36 36
                 </select> 
37 37
                 <div style="float:right">
38 38
                     <a class="btn btn-primary radius" onclick="user_search()" href="javascript:;">搜索</a>
39
-                    <a class="btn btn-primary radius" onclick="order_export()" href="javascript:;"><i class="Hui-iconfont">&#xe600;</i> 导出订单</a>
39
+                    <a class="btn btn-primary radius" onclick="order_export()" href="javascript:;"> 导出订单</a>
40 40
                     <!--a class="btn btn-primary radius" onclick="order_verify_more()" href="javascript:;"><i class="Hui-iconfont">&#xe600;</i> 批量审核</a-->
41 41
                 </div>
42 42
             </div>
@@ -65,8 +65,7 @@
65 65
                     <th width="5%">退补备注</th>                 
66 66
                     <th width="4%">所属销售</th> 
67 67
                     <th width="4%">订单状态</th>                  
68
-                    @if($self_role =='销售' )<th width="5%">驳回原因</th>@endif                  
69
-                    <th width="3%">是否退款</th>                  
68
+                    @if($self_role =='销售' )<th width="5%">驳回原因</th>@endif                                    
70 69
                     <th width="5%">买家备注</th>                  
71 70
                     <th width="5%">卖家备注</th>                                                        
72 71
                     <th width="5%">发货备注</th>                                                        
@@ -127,7 +126,7 @@
127 126
                             <td id="order_verify{{$a['id']}}">{{$a['status_name']}}</td>
128 127
                             @if($self_role =='销售' ) <td>@if($a['status'] == 0)<font color='red'> {{$a['refuse_reason']}} </font> @endif</td> @endif
129 128
                            
130
-                            <td id="refund{{$a['id']}}">@if($a['order_status']==2) <span class="btn btn-danger radius">退款</span> @else 正常<br><span class="btn btn-primary radius" onclick="order_refund({{$a['id']}})">设为退款</span> @endif</td> 
129
+                            <!--td id="refund{{$a['id']}}">@if($a['order_status']==2) <span class="btn btn-danger radius">退款</span> @else 正常<br><span class="btn btn-primary radius" onclick="order_refund({{$a['id']}})">设为退款</span> @endif</td --> 
131 130
                             @if(($self_role =='销售' || $self_role =='管理员') && $a['status']>0)
132 131
                             <td>{{$a['buyerMemo']}}</td> 
133 132
                             <td>{{$a['sellerMemo']}}</td> 

+ 3 - 2
resources/views/order/warehouselist.blade.php

@@ -29,8 +29,9 @@
29 29
                
30 30
                 <div style="float:right">
31 31
                     <a class="btn btn-primary radius" onclick="user_search()" href="javascript:;">搜索</a>
32
-                    <a class="btn btn-primary radius" onclick="order_export()" href="javascript:;"><i class="Hui-iconfont">&#xe600;</i> 导出订单</a>
33
-                    <a class="btn btn-primary radius" onclick="importExcel('商品导入')" href="javascript:;"><i class="Hui-iconfont">&#xe600;</i> 导入订单</a>
32
+                    <a class="btn btn-primary radius" onclick="order_export()" href="javascript:;">导出订单</a>
33
+                    <a class="btn btn-primary radius" onclick="importExcel('商品导入')" href="javascript:;"> 导入订单</a>
34
+                    <a class="btn btn-primary radius" onclick="window.location.reload();" href="javascript:;"> 刷新</a>
34 35
                 </div>
35 36
             </div>
36 37
         </div>

+ 2 - 0
resources/views/statistics/orderDay.blade.php

@@ -39,6 +39,7 @@
39 39
                     <th width="5%">总成交额</th>                                 
40 40
                     <th width="5%">总投放成本</th>                                                 
41 41
                     <th width="5%">货品成本</th>                                                 
42
+                    <th width="5%">物流成本</th>                                                 
42 43
                     <th width="5%">毛利</th>                                                 
43 44
                     <th width="5%">当日新粉成单率</th>                                                 
44 45
                     <th width="5%">复购率</th>                                                 
@@ -63,6 +64,7 @@
63 64
                             <td>{{$a['order_amount']}}</td>                            
64 65
                             <td>{{$a['total_cost']}}</td>                            
65 66
                             <td>{{$a['order_cost']}}</td>                            
67
+                            <td>{{$a['freight_cost']}}</td>                            
66 68
                             <td>{{$a['profit']}}</td>                            
67 69
                             <td>{{$a['new_order_rate']}}</td>                                                       
68 70
                             <td>{{$a['fugou_rate']}}</td>