ss 4 mēneši atpakaļ
vecāks
revīzija
bb42f4c7d7

+ 1 - 1
application/api/controller/screen/Index.php

@@ -19,7 +19,7 @@ class Index extends Controller
         $token = input('token','','trim');
 
         $str = think_decrypt($token);
-      //  $str = '11|3';
+      //  $str = '4|3';
         $data = $str?explode('|',$str):[];
 
         if(count($data) != 2){

+ 13 - 5
application/api/controller/screen/Waste.php

@@ -20,7 +20,7 @@ class Waste extends Index
             //->where('org_id',$this->orgId)
             ->where('del',0)
             ->where('enable',1)
-            ->limit(6)
+            ->limit(5)
             ->select();
         foreach ($list as $k=>$v){
             $record = Db::name('waste_record')
@@ -53,6 +53,7 @@ class Waste extends Index
 //            ->where('org_id',$this->orgId)
             ->where('del',0)
             ->where('enable',1)
+            ->limit(5)
             ->select();
 
         foreach ($device as $k=>$v){
@@ -133,14 +134,19 @@ class Waste extends Index
             ->where('del',0)
             ->where('org_id',$this->orgId)
             ->where('create_yyyymmdd',date('Ymd'))
+            ->limit(30)
             ->select();
         foreach ($list as $k=>$v){
             $list[$k]['device_name'] = Db::name('address')
                 ->where('id',$v['waste_device_id'])
                 ->value('title');
-            $list[$k]['user_name'] = Db::name('user')
-                ->where('id',$v['user_id'])
-                ->value('real_name');
+            $list[$k]['device_name'] = Db::name('address')
+                ->where('id',$v['waste_device_id'])
+                ->value('title');
+            $list[$k]['cate_name'] = Db::name('waste_type')
+                ->where('id',$v['cateid'])
+                ->value('title');
+            $list[$k]['kg'] = $v['weight'] ? round($v['weight']/1000,2):0;
             if($v['status'] == 0){
                 $list[$k]['status'] = '已收取';
             }elseif ($v['status'] == 1){
@@ -157,6 +163,8 @@ class Waste extends Index
             $data[$k][] = $v['device_name'];
             $data[$k][] = $v['user_name'];
             $data[$k][] = $v['create_time'];
+            $data[$k][] = $v['cate_name'];
+            $data[$k][] = $v['kg'];
             $data[$k][] = $v['status'];
         }
         HelpHander::success($data);
@@ -188,7 +196,7 @@ class Waste extends Index
 
         $cate = Db::name('waste_type')
             ->field('id,title')
-//            ->where('org_id',$this->orgId)
+            ->where('org_id','in',[0,$this->orgId])
             ->where('del',0)
             ->where('enable',1)
             ->select();