Browse Source

boxlist update limit

ayHaru 4 years ago
parent
commit
d3402a7cc9
2 changed files with 5 additions and 5 deletions
  1. 2 2
      application/index/controller/Cabinet.php
  2. 3 3
      application/index/model/BoxModel.php

+ 2 - 2
application/index/controller/Cabinet.php

@@ -263,7 +263,7 @@ class Cabinet extends Base
         $limit = isset($param['pageSize']) ? $param['pageSize'] : 10;
         $param['pageNumber'] = isset($param['pageNumber']) ? $param['pageNumber'] : 1;
         $offset = ($param['pageNumber'] - 1) * $limit;
-        $selectResult = $BoxModel->getBoxsByWhere($where, $offset, $limit);
+        $selectResult = $BoxModel->getBoxsByWhere($where);
         $box_status = ['打开','关闭'];
         // 拼装参数
         foreach($selectResult as $key=>$vo){
@@ -275,7 +275,7 @@ class Cabinet extends Base
                 $selectResult[$key]['enter_time'] = date("m-d H:i",strtotime($vo['enter_time']));
             }
         }
-        $return['total'] = $BoxModel->getAllCounts();  //总数量
+        $return['total'] = $BoxModel->getAllCounts($where);  //总数量
         $return['rows'] = $selectResult;
         $this->action_log();
         json_success($return);

+ 3 - 3
application/index/model/BoxModel.php

@@ -50,15 +50,15 @@ class BoxModel extends Model {
      * @param $offset
      * @param $limit
      */
-    public function getBoxsByWhere($where, $offset, $limit)
+    public function getBoxsByWhere($where)
     {
-        return $this->Order()->haswhere($where)->order('sc_box.box_number asc')->field('sc_box.*,OrderModel.enter_time')->limit($offset, $limit)->select();
+        return $this->Order()->haswhere($where)->order('sc_box.box_number asc')->field('sc_box.*,OrderModel.enter_time')->select();
     }
 
     /**
      * 根据搜索条件获取所有的箱子数量
      */
-    public function getAllCounts()
+    public function getAllCounts($where)
     {
         return $this->count();
     }