|
|
@@ -28,16 +28,19 @@ class GoodsCategoryClass extends BaseClass
|
|
|
if (!empty($where['cId'])) {
|
|
|
$query->andWhere(['xhGoodsCategory.cId' => $where['cId']]);
|
|
|
}
|
|
|
- if (!empty($where['name'])) {
|
|
|
- $query->andWhere(['like', 'xhGoodsCategory.name', $where['name']]);
|
|
|
+ if (!empty($where['searchText'])) {
|
|
|
+ $query->andWhere(['like', 'xhGoodsCategory.name', $where['searchText']]);
|
|
|
}
|
|
|
|
|
|
$flowerNum = $params['flowerNum'] ?? -1;
|
|
|
$priceStatus = $where['priceStatus'] ?? -1;
|
|
|
$stockStatus = $where['stockStatus'] ?? -1;
|
|
|
+ $requestType = $get['requestType'] ?? '';
|
|
|
|
|
|
- $query->joinWith(['goods' => function ($query) use ($flowerNum, $priceStatus, $stockStatus) {
|
|
|
- $query->andWhere(['>', 'xhGoods.stock', 0]);
|
|
|
+ $query->joinWith(['goods' => function ($query) use ($flowerNum, $priceStatus, $stockStatus, $requestType) {
|
|
|
+ if ($requestType == 'kd') {
|
|
|
+ $query->andWhere(['>', 'xhGoods.stock', 0]);
|
|
|
+ }
|
|
|
if ($stockStatus == 1) {
|
|
|
$query->andWhere(['>', 'xhGoods.stock', 0]);
|
|
|
}
|