ss 2 ماه پیش
والد
کامیت
e4209311a6
1فایلهای تغییر یافته به همراه8 افزوده شده و 7 حذف شده
  1. 8 7
      application/common/model/WasteRecord.php

+ 8 - 7
application/common/model/WasteRecord.php

@@ -454,7 +454,13 @@ class WasteRecord extends Base {
             ->sum('weight');
 //        $info['weight'] = $weight?round($weight/1000,2):0;
         $info['kg'] = $weight?round($weight/1000,2):0;
-        $info['weight'] = $weight;
+
+        if($platform == 'iOS'){
+            $info['weight'] = $weight;
+        }else{
+            $info['weight'] = $weight?round($weight/1000,2):0;
+        }
+
 
 
         $count = $this->where('package_id',$info['id'])
@@ -479,12 +485,7 @@ class WasteRecord extends Base {
             $record[$k]['cate_name'] =Db::name('waste_type')
                 ->where('id',$v['cateid'])->value('title');
 //            $record[$k]['weight'] = $v['weight']?round($v['weight']/1000,2):0;
-
-            if($platform == 'iOS'){
-                $record[$k]['weight'] = $v['weight']?$v['weight']:0;
-            }else{
-                $record[$k]['weight'] = $v['weight']?round($v['weight']/1000,2):0;
-            }
+            $record[$k]['weight'] = $v['weight']?$v['weight']:0;
 
             $record[$k]['kg'] = $v['weight']?round($v['weight']/1000,2):0;