master
wangxinglong 2022-08-05 16:49:54 +08:00
parent c3406befd3
commit 81d6fcf7a0
3 changed files with 7 additions and 4 deletions

View File

@ -33,7 +33,9 @@ class Spu extends Base
public function index() public function index()
{ {
if ($this->request->isPost()) { 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); $res = SpuRepository::getInstance()->list($params);

View File

@ -74,7 +74,7 @@ class SpuRepository extends Repository
// $whereMap[] = ['is_activity', '=', Spu::COMMON_OFF]; // $whereMap[] = ['is_activity', '=', Spu::COMMON_OFF];
} }
if (isset($params['saleable'])) { if (isset($params['saleable']) &&!empty( $params['saleable'])) {
$whereMap[] = ['saleable', '=', $params['saleable']]; $whereMap[] = ['saleable', '=', $params['saleable']];
} }
@ -88,6 +88,7 @@ class SpuRepository extends Repository
$whereMap[] = ['deleted_at', '=', null]; $whereMap[] = ['deleted_at', '=', null];
$params['page'] = $params['page'] ?? 1; $params['page'] = $params['page'] ?? 1;
$params['size'] = $params['size'] ?? 20; $params['size'] = $params['size'] ?? 20;
@ -113,7 +114,7 @@ class SpuRepository extends Repository
$whereMap[] = ['activity_type', '=', $type]; $whereMap[] = ['activity_type', '=', $type];
} }
if (isset($params['saleable'])) { if (isset($params['saleable'])&&!empty( $params['saleable'])) {
$whereMap[] = ['saleable', '=', $params['saleable']]; $whereMap[] = ['saleable', '=', $params['saleable']];
} }

View File

@ -21,7 +21,7 @@
</div> </div>
</div> </div>
<div class="layui-inline"> <div class="layui-inline layui-hide">
<label class="layui-form-label">商品属性</label> <label class="layui-form-label">商品属性</label>
<div class="layui-input-block"> <div class="layui-input-block">
<select name="spu_type"> <select name="spu_type">