|
|
@@ -13,6 +13,7 @@ use bizGhs\product\classes\ProductClass;
|
|
|
use common\components\imgUtil;
|
|
|
use common\components\util;
|
|
|
use common\services\xhItemService;
|
|
|
+use Yii;
|
|
|
|
|
|
class ItemClass extends BaseClass
|
|
|
{
|
|
|
@@ -378,6 +379,10 @@ class ItemClass extends BaseClass
|
|
|
{
|
|
|
$level = isset($custom->level) ? $custom->level : 1;
|
|
|
$field = 'id,cover,name,cost,itemId,classId,property,skPrice,variety,price,hjPrice,discountPrice,skDiscountPrice,hjDiscountPrice,stock,stockWarning,presell,ratioType,smallRatio,smallUnit,bigUnit,ratio,hjAddPrice,addPrice';
|
|
|
+
|
|
|
+ $get = Yii::$app->request->get();
|
|
|
+ $isCashier = $get['isCashier'] ?? 0;
|
|
|
+
|
|
|
$list = self::getAllByCondition($where, ['inTurn' => SORT_DESC, 'actualSold' => SORT_DESC], $field);
|
|
|
if (empty($list)) {
|
|
|
return $list;
|
|
|
@@ -385,12 +390,18 @@ class ItemClass extends BaseClass
|
|
|
$list = ProductClass::groupProductInfo($list, $level);
|
|
|
$data = [];
|
|
|
$data[ItemClassClass::TJ_CLASS_ID] = [];
|
|
|
- foreach ($list as $it) {
|
|
|
+ foreach ($list as $k => $it) {
|
|
|
$classId = $it['classId'] ?? 0;
|
|
|
$data[$classId][] = $it;
|
|
|
if (isset($it['discountPrice']) && $it['discountPrice'] > 0) {
|
|
|
$data[ItemClassClass::TJ_CLASS_ID][] = $it;
|
|
|
}
|
|
|
+ //如果收银机不需要显示这么多字段,类似惠雅花材多的会卡
|
|
|
+ if ($isCashier == 1) {
|
|
|
+ unset($data[$k]['bigCover']);
|
|
|
+ unset($data[$k]['largeCover']);
|
|
|
+ unset($data[$k]['shortCover']);
|
|
|
+ }
|
|
|
}
|
|
|
return $data;
|
|
|
}
|