Parcourir la source

水电气分摊

unknown il y a 2 mois
Parent
commit
0faab5d1f6
1 fichiers modifiés avec 12 ajouts et 1 suppressions
  1. 12 1
      application/api/controller/CostAccounting.php

+ 12 - 1
application/api/controller/CostAccounting.php

@@ -574,15 +574,26 @@ class CostAccounting extends Api
         if (empty($param)) {
             $this->error('参数错误');
         }
+        $page = $this->request->param('page', 1);
+        $pageSize = $this->request->param('limit', 30);
+        $total = db('成本v23_月度成本明细')
+            ->where('车间名称', $param['sist'])
+            ->where('sys_ny', $param['month'])
+            ->count();
         $list = db('成本v23_月度成本明细')
             ->where('车间名称', $param['sist'])
             ->where('sys_ny', $param['month'])
             ->order('sczl_gdbh')
+            ->page($page, $pageSize)
             ->select();
+        $data = [
+            'total' => $total,
+            'list' => $list,
+        ];
         if (empty($list)) {
             $this->error('未找到数据');
         }else{
-            $this->success('成功', $list);
+            $this->success('成功', $data);
         }
     }