|
|
@@ -84,12 +84,11 @@ class CategoryController extends BaseController
|
|
|
{
|
|
|
$get = Yii::$app->request->get();
|
|
|
$catId = $get['catId'] ?? 0;
|
|
|
- if (empty($catId)) {
|
|
|
- util::fail('没有分类');
|
|
|
- }
|
|
|
$where = [];
|
|
|
$where['mainId'] = $this->mainId;
|
|
|
- $where['cId'] = $catId;
|
|
|
+ if (!empty($catId)) {
|
|
|
+ $where['cId'] = $catId;
|
|
|
+ }
|
|
|
$flower = $get['flower'] ?? '';
|
|
|
if (is_numeric($flower)) {
|
|
|
$where['flower'] = $flower;
|
|
|
@@ -103,6 +102,10 @@ class CategoryController extends BaseController
|
|
|
if (!empty($flowerNum)) {
|
|
|
$where['flowerNum'] = $flowerNum;
|
|
|
}
|
|
|
+ $searchText = $get['searchText'] ?? '';
|
|
|
+ if (!empty($searchText)) {
|
|
|
+ $where['name'] = ['like', $searchText];
|
|
|
+ }
|
|
|
$data = GoodsCategoryService::getGoodsList($where);
|
|
|
util::success($data);
|
|
|
}
|