ss 2 bulan lalu
induk
melakukan
a3c1ac119c

+ 3 - 1
application/api/controller/v1/WasteRecord.php

@@ -114,9 +114,11 @@ class WasteRecord extends Base
 
     public function detail(){
         $serialNum = input('serialNum');
+        $platform = input('platform');
+
         $orgId = $this->orgId;
         if(strlen($serialNum) == 14){ // 包编号
-            $ret = $this->model->packInfo($serialNum,$orgId);
+            $ret = $this->model->packInfo($serialNum,$orgId,$platform);
         }else{
             $ret = $this->model->recordInfo($serialNum,$orgId);
         }

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

@@ -413,7 +413,7 @@ class WasteRecord extends Base {
         return $id;
     }
 
-    public function packInfo($serialNum,$orgId){
+    public function packInfo($serialNum,$orgId,$platform=''){
         $map[] = ['sn','=',$serialNum];
         $map[] = ['org_id','=',$orgId];
         $map[] = ['del','=',0];
@@ -479,7 +479,13 @@ 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;
-            $record[$k]['weight'] = $v['weight']?$v['weight']: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]['kg'] = $v['weight']?round($v['weight']/1000,2):0;
 
             $cate = Db::name('waste_type')->where('id',$v['cateid'])->find();