|
|
@ -16,6 +16,7 @@ use app\api\model\Goods as GoodsModel; |
|
|
|
use app\api\model\Setting as SettingModel; |
|
|
|
use app\api\model\Setting as SettingModel; |
|
|
|
use app\api\model\GoodsSku as GoodsSkuModel; |
|
|
|
use app\api\model\GoodsSku as GoodsSkuModel; |
|
|
|
use app\api\model\Category as CategoryModel; |
|
|
|
use app\api\model\Category as CategoryModel; |
|
|
|
|
|
|
|
use app\api\service\User as UserService; |
|
|
|
use app\common\model\store\Shop as ShopModel; |
|
|
|
use app\common\model\store\Shop as ShopModel; |
|
|
|
use app\api\service\sharp\Active as ActiveService; |
|
|
|
use app\api\service\sharp\Active as ActiveService; |
|
|
|
use app\common\enum\Setting as SettingEnum; |
|
|
|
use app\common\enum\Setting as SettingEnum; |
|
|
@ -23,6 +24,7 @@ use app\common\service\Goods as GoodsService; |
|
|
|
use app\api\model\sharp\Active as SharpActiveModel; |
|
|
|
use app\api\model\sharp\Active as SharpActiveModel; |
|
|
|
use app\api\model\sharp\ActiveTime as ActiveTimeModel; |
|
|
|
use app\api\model\sharp\ActiveTime as ActiveTimeModel; |
|
|
|
use app\api\controller\sharp\Goods as miaosha; |
|
|
|
use app\api\controller\sharp\Goods as miaosha; |
|
|
|
|
|
|
|
use app\store\model\goods\GoodsPrice as GoodsPriceModel; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 商品服务类 |
|
|
|
* 商品服务类 |
|
|
@ -52,19 +54,19 @@ class Goods extends GoodsService |
|
|
|
|
|
|
|
|
|
|
|
switch (request()->get('type')) { |
|
|
|
switch (request()->get('type')) { |
|
|
|
case 1: |
|
|
|
case 1: |
|
|
|
$data['imgurl']= 'https://www.saas.njrenzhou.com/uploads/10001/20240131/bdc5f17f3ff8c53ce0853177bc4f1917.png'; |
|
|
|
$data['imgurl'] = 'https://www.saas.njrenzhou.com/uploads/10001/20240131/bdc5f17f3ff8c53ce0853177bc4f1917.png'; |
|
|
|
return $data; |
|
|
|
return $data; |
|
|
|
break; |
|
|
|
break; |
|
|
|
case 2: |
|
|
|
case 2: |
|
|
|
$data['imgurl']= 'https://www.saas.njrenzhou.com/uploads/10001/20240131/e8e10653875e779bc72dbee65b8072c0.png'; |
|
|
|
$data['imgurl'] = 'https://www.saas.njrenzhou.com/uploads/10001/20240131/e8e10653875e779bc72dbee65b8072c0.png'; |
|
|
|
return $data; |
|
|
|
return $data; |
|
|
|
break; |
|
|
|
break; |
|
|
|
case 3: |
|
|
|
case 3: |
|
|
|
$data['imgurl']= 'https://www.saas.njrenzhou.com/uploads/10001/20240131/5c4ec6ffeb23223936295e290dc3d1f9.png'; |
|
|
|
$data['imgurl'] = 'https://www.saas.njrenzhou.com/uploads/10001/20240131/5c4ec6ffeb23223936295e290dc3d1f9.png'; |
|
|
|
return $data; |
|
|
|
return $data; |
|
|
|
break; |
|
|
|
break; |
|
|
|
case 4: |
|
|
|
case 4: |
|
|
|
$data['imgurl']= [ |
|
|
|
$data['imgurl'] = [ |
|
|
|
'https://www.saas.njrenzhou.com/uploads/10001/20240131/5c4ec6ffeb23223936295e290dc3d1f9.png', |
|
|
|
'https://www.saas.njrenzhou.com/uploads/10001/20240131/5c4ec6ffeb23223936295e290dc3d1f9.png', |
|
|
|
]; |
|
|
|
]; |
|
|
|
return $data; |
|
|
|
return $data; |
|
|
@ -278,7 +280,7 @@ class Goods extends GoodsService |
|
|
|
{ |
|
|
|
{ |
|
|
|
$data = []; |
|
|
|
$data = []; |
|
|
|
foreach ($goodsList as $goods) { |
|
|
|
foreach ($goodsList as $goods) { |
|
|
|
$data[] = [ |
|
|
|
$temp = [ |
|
|
|
'goods_id' => $goods['goods_id'], |
|
|
|
'goods_id' => $goods['goods_id'], |
|
|
|
'goods_name' => $goods['goods_name'], |
|
|
|
'goods_name' => $goods['goods_name'], |
|
|
|
'selling_point' => $goods['selling_point'], |
|
|
|
'selling_point' => $goods['selling_point'], |
|
|
@ -290,6 +292,25 @@ class Goods extends GoodsService |
|
|
|
'goods_sales' => $goods['goods_sales'], |
|
|
|
'goods_sales' => $goods['goods_sales'], |
|
|
|
'remaizhishu' => $goods['remaizhishu'], |
|
|
|
'remaizhishu' => $goods['remaizhishu'], |
|
|
|
]; |
|
|
|
]; |
|
|
|
|
|
|
|
if (UserService::isLogin()) { |
|
|
|
|
|
|
|
$catService = new \app\store\model\GoodsCategoryRel(); |
|
|
|
|
|
|
|
$catIds = $catService->where(['goods_id' => $goods['goods_id']])->column('category_id'); |
|
|
|
|
|
|
|
$price_list_plus = $price_list_dealer = []; |
|
|
|
|
|
|
|
foreach ($catIds as $k => $v) { |
|
|
|
|
|
|
|
$price_list_plus[] = GoodsPriceModel::getDiscountPrice($v, 1, $goods['goods_price_min']); |
|
|
|
|
|
|
|
$price_list_dealer[] = GoodsPriceModel::getDiscountPrice($v, 2, $goods['goods_price_min']); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
//价格判断 |
|
|
|
|
|
|
|
if (UserService::isstore()) { |
|
|
|
|
|
|
|
$temp['goods_price_min_plus'] = min($price_list_plus); |
|
|
|
|
|
|
|
$temp['goods_price_min_dealer'] = min($price_list_dealer); |
|
|
|
|
|
|
|
} elseif (UserService::isPlusMember()) { |
|
|
|
|
|
|
|
$temp['goods_price_min_plus'] = min($price_list_plus); |
|
|
|
|
|
|
|
} elseif (UserService::isDealerMember()) { |
|
|
|
|
|
|
|
$temp['goods_price_min_dealer'] = min($price_list_dealer); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
$data[] = $temp; |
|
|
|
} |
|
|
|
} |
|
|
|
return $data; |
|
|
|
return $data; |
|
|
|
} |
|
|
|
} |
|
|
|