diff --git a/app/controller/manager/mall/Spu.php b/app/controller/manager/mall/Spu.php index 95a13a2..75527df 100755 --- a/app/controller/manager/mall/Spu.php +++ b/app/controller/manager/mall/Spu.php @@ -33,7 +33,9 @@ class Spu extends Base public function index() { if ($this->request->isPost()) { - $params = input(); + $params = input("searchParams/a"); + $params["page"] = input("page/d",1); + $params["size"] = input("size/d",20); $res = SpuRepository::getInstance()->list($params); diff --git a/app/repository/SpuRepository.php b/app/repository/SpuRepository.php index 25bfc15..4ceed65 100755 --- a/app/repository/SpuRepository.php +++ b/app/repository/SpuRepository.php @@ -74,7 +74,7 @@ class SpuRepository extends Repository // $whereMap[] = ['is_activity', '=', Spu::COMMON_OFF]; } - if (isset($params['saleable'])) { + if (isset($params['saleable']) &&!empty( $params['saleable'])) { $whereMap[] = ['saleable', '=', $params['saleable']]; } @@ -88,6 +88,7 @@ class SpuRepository extends Repository $whereMap[] = ['deleted_at', '=', null]; + $params['page'] = $params['page'] ?? 1; $params['size'] = $params['size'] ?? 20; @@ -113,7 +114,7 @@ class SpuRepository extends Repository $whereMap[] = ['activity_type', '=', $type]; } - if (isset($params['saleable'])) { + if (isset($params['saleable'])&&!empty( $params['saleable'])) { $whereMap[] = ['saleable', '=', $params['saleable']]; } diff --git a/view/manager/mall/spu/index.html b/view/manager/mall/spu/index.html index a0aa0dd..58e028e 100755 --- a/view/manager/mall/spu/index.html +++ b/view/manager/mall/spu/index.html @@ -21,7 +21,7 @@ -