|
|
@@ -5,8 +5,6 @@ namespace bizHd\goods\services;
|
|
|
use bizHd\base\services\BaseService;
|
|
|
use bizHd\goods\classes\GoodsCategoryClass;
|
|
|
use bizHd\goods\classes\GoodsClass;
|
|
|
-use Yii;
|
|
|
-use linslin\yii2\curl;
|
|
|
|
|
|
class GoodsCategoryService extends BaseService
|
|
|
{
|
|
|
@@ -17,14 +15,14 @@ class GoodsCategoryService extends BaseService
|
|
|
public static function getGoodsList($where)
|
|
|
{
|
|
|
unset($where['delStatus']);//这个后面改进
|
|
|
- $data = GoodsCategoryClass::getList('*', $where, 'status DESC,inTurn DESC');
|
|
|
- $list = isset($data['list']) && !empty($data['list']) ? $data['list'] : [];
|
|
|
+ $data = GoodsCategoryClass::getList('*', $where, 'inTurn DESC');
|
|
|
+ $list = isset($data['list']) ? $data['list'] : [];
|
|
|
if (empty($list)) {
|
|
|
return $data;
|
|
|
}
|
|
|
$ids = array_column($list, 'gId');
|
|
|
- $list = GoodsService::getAllByCondition(['id' => ['in', $ids]], 'inTurn DESC, sold DESC', '*');
|
|
|
- $data['list'] = GoodsClass::groupGoodsBaseInfo($list);
|
|
|
+ $goodsList = GoodsClass::getAllByCondition(['id' => ['in', $ids]], null, '*');
|
|
|
+ $data['list'] = GoodsClass::groupGoodsBaseInfo($goodsList, false, $ids);
|
|
|
return $data;
|
|
|
}
|
|
|
|