浏览代码

商家后台-商品中规格模板-修复排序错误

xupuyuan 3 月之前
父节点
当前提交
4d21a7eb54
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      app/common/repositories/store/StoreAttrTemplateRepository.php

+ 2 - 1
app/common/repositories/store/StoreAttrTemplateRepository.php

@@ -58,7 +58,8 @@ class StoreAttrTemplateRepository extends BaseRepository
58
     public function getList($merId, array $where, $page, $limit)
58
     public function getList($merId, array $where, $page, $limit)
59
     {
59
     {
60
         $query = $this->dao->search($merId, $where);
60
         $query = $this->dao->search($merId, $where);
61
-        $count = $query->count($this->dao->getPk());
61
+        $CountQuery = clone $query;
62
+        $count = $CountQuery->count($this->dao->getPk());
62
         $list = $query->page($page, $limit)->select();
63
         $list = $query->page($page, $limit)->select();
63
         return compact('count', 'list');
64
         return compact('count', 'list');
64
     }
65
     }