zgg 3 months ago
parent
commit
4d5e6b6b63
1 changed files with 2 additions and 3 deletions
  1. 2 3
      application/common/model/WasteRecord.php

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

@@ -95,7 +95,7 @@ class WasteRecord extends Base {
         $map[] = ['del','=',0];
         $info = $this->field('id,serial_number,org_id,waste_device_id,user_id,cateid,weight,status,create_time,reason,is_print,weight2')
            ->where($map)->find();
-
+        $info['weight'] =  $info['weight']?round( $info['weight']/1000,2):0;
         $info = $info?$info->toArray():[];
         if(!$info){
             $this->error = '记录不存在';
@@ -434,8 +434,7 @@ class WasteRecord extends Base {
         $weight =$this
             ->where('package_id',$info['id'])
             ->sum('weight');
-//        $info['weight'] = $weight?round($weight/1000,2):0;
-        $info['weight'] = $weight;
+        $info['weight'] = $weight?round($weight/1000,2):0;
 
         $count = $this->where('package_id',$info['id'])
           ->count();