sunhao 5 years ago
parent
commit
92598d0d0f
1 changed files with 2 additions and 2 deletions
  1. 2 2
      app/Http/Controllers/Api/TemplateController.php

+ 2 - 2
app/Http/Controllers/Api/TemplateController.php

@@ -143,14 +143,14 @@ class TemplateController extends Controller {
143 143
         //$data['fan_count'] = CustDetail::where('is_del',0)->where('dtime','>=',$_start)->sum('fan_add');    
144 144
         //毛利 = 总销售额-总商品成本-总运费-总售后
145 145
         $data['profit'] = $order->order_amount - $order->goods_cost - $order->freight_cost - $order->aftersale_cost - $data['throw_cost'] + $order->refund_fee;
146
-        $data['roi'] = $data['throw_cost']>0?  round($order->order_amount / $data['throw_cost'], 4) * 100 .'%' : '';
146
+        $data['roi'] = $data['throw_cost']>0?  round($order->order_amount / $data['throw_cost'], 4) : '';
147 147
         
148 148
         //查询历史数据
149 149
         $result = DB::table('day_grand_total')->where('idate', '>', $stime)->orderBy('idate', 'desc')->get();
150 150
         $result = json_decode(json_encode($result), true); 
151 151
         foreach($result as $k=>&$v){
152 152
             unset($v['fan_count']);
153
-            $v['roi'] = $v['throw_cost']>0 ? round($v['order_amount'] / $v['throw_cost'], 4) * 100 .'%' : '';
153
+            $v['roi'] = $v['throw_cost']>0 ? round($v['order_amount'] / $v['throw_cost'], 4) : '';
154 154
         }       
155 155
         $result  = array_merge([$data], $result);
156 156