|
|
@@ -507,7 +507,7 @@ class ItemClass extends BaseClass
|
|
|
public static function getShowList($where)
|
|
|
{
|
|
|
$level = 0;
|
|
|
- $field = 'id,cover,name,cost,itemId,classId,property,py,skPrice,skMore,addPrice,variety,price,discountPrice,skDiscountPrice,stock,stockWarning,presell,ratioType,smallRatio,smallUnit,bigUnit,ratio';
|
|
|
+ $field = 'id,cover,name,cost,itemId,classId,property,py,skPrice,skMore,addPrice,variety,price,discountPrice,skDiscountPrice,stock,stockWarning,presell,reachNum,reachNumDiscount,ratioType,smallRatio,smallUnit,bigUnit,ratio';
|
|
|
$list = self::getAllByCondition($where, ['inTurn' => SORT_DESC, 'actualSold' => SORT_DESC], $field);
|
|
|
if (empty($list)) {
|
|
|
return $list;
|
|
|
@@ -515,12 +515,22 @@ class ItemClass extends BaseClass
|
|
|
$list = self::groupProductInfo($list, $level);
|
|
|
$data = [];
|
|
|
$data[ItemClassClass::TJ_CLASS_ID] = [];
|
|
|
+ $data[ItemClassClass::OFTEN_CLASS_ID] = [];
|
|
|
+ $data[ItemClassClass::PRESELL_CLASS_ID] = [];
|
|
|
foreach ($list as $it) {
|
|
|
$classId = $it['classId'] ?? 0;
|
|
|
$data[$classId][] = $it;
|
|
|
if (isset($it['discountPrice']) && $it['discountPrice'] > 0) {
|
|
|
$data[ItemClassClass::TJ_CLASS_ID][] = $it;
|
|
|
}
|
|
|
+ $reachNum = $it['reachNum'] ?? 0;
|
|
|
+ $reachNumDiscount = $it['reachNumDiscount'] ?? 0;
|
|
|
+ if ($reachNum > 0 && $reachNumDiscount > 0) {
|
|
|
+ $data[ItemClassClass::OFTEN_CLASS_ID][] = $it;
|
|
|
+ }
|
|
|
+ if (isset($it['presell']) && $it['presell'] == 1) {
|
|
|
+ $data[ItemClassClass::PRESELL_CLASS_ID][] = $it;
|
|
|
+ }
|
|
|
}
|
|
|
return $data;
|
|
|
}
|