|
|
@@ -16,7 +16,7 @@ class GoodsService extends BaseService
|
|
|
public static $baseFile = '\bizHd\goods\classes\GoodsClass';
|
|
|
|
|
|
//商品列表
|
|
|
- public static function getGoodsList($where)
|
|
|
+ public static function getGoodsList($where, $shop)
|
|
|
{
|
|
|
$page = Yii::$app->request->get('page', 1);
|
|
|
$pageSize = Yii::$app->request->get('pageSize', 20);
|
|
|
@@ -26,11 +26,13 @@ class GoodsService extends BaseService
|
|
|
return self::getCategoryGoodsList($where, $page, $pageSize);
|
|
|
} else {
|
|
|
$data = GoodsClass::getList('*', $where, 'updateTime DESC');
|
|
|
- $list = isset($data['list']) && !empty($data['list']) ? $data['list'] : [];
|
|
|
+ $list = !empty($data['list']) ? $data['list'] : [];
|
|
|
if (empty($list)) {
|
|
|
return $data;
|
|
|
}
|
|
|
- $data['list'] = GoodsClass::groupGoodsBaseInfo($list);
|
|
|
+ $custom = [];
|
|
|
+ $params = [];
|
|
|
+ $data['list'] = GoodsClass::groupGoodsBaseInfo($list, $shop, $custom, $params);
|
|
|
return $data;
|
|
|
}
|
|
|
}
|
|
|
@@ -120,7 +122,7 @@ class GoodsService extends BaseService
|
|
|
{
|
|
|
// 构建基础查询
|
|
|
$query = GoodsCategory::find()
|
|
|
- ->joinWith(['goods' => function($query) use ($where) {
|
|
|
+ ->joinWith(['goods' => function ($query) use ($where) {
|
|
|
// 商品表的筛选条件
|
|
|
if (isset($where['mainId'])) {
|
|
|
$query->andWhere(['xhGoods.mainId' => $where['mainId']]);
|