|
|
@@ -13,6 +13,7 @@ use bizHd\promote\services\CouponService;
|
|
|
use bizHd\user\classes\UserAssetClass;
|
|
|
use bizHd\user\services\UserService;
|
|
|
use common\components\error;
|
|
|
+use common\components\imgUtil;
|
|
|
use common\components\stringUtil;
|
|
|
use common\components\validate;
|
|
|
use common\components\util;
|
|
|
@@ -53,10 +54,19 @@ class OrderService extends BaseService
|
|
|
$merchantList = MerchantService::getByIds($sjIdList, null, 'id');
|
|
|
|
|
|
$periodData = [0 => '上午', 1 => '下午', 2 => '晚上'];
|
|
|
+ $defaultImg = imgUtil::groupImg('');
|
|
|
foreach ($data['list'] as $key => $val) {
|
|
|
$id = $val['id'];
|
|
|
$customId = $val['customId'];
|
|
|
- $data['list'][$key]['goodsInfoList'] = isset($goodsList[$id]) ? $goodsList[$id] : [];
|
|
|
+ $currentActPrice = $val['actPrice'] ?? 0;
|
|
|
+ $currentSendCost = $val['sendCost'] ?? 0;
|
|
|
+ $currentPrice = bcsub($currentActPrice, $currentSendCost, 2);
|
|
|
+ //没有商品显示的样式
|
|
|
+ $goodsInfoList = [['title' => '', 'coverUrl' => $defaultImg, 'unitPrice' => $currentPrice, 'num' => 1]];
|
|
|
+ if (isset($goodsList[$id])) {
|
|
|
+ $goodsInfoList = $goodsList[$id];
|
|
|
+ }
|
|
|
+ $data['list'][$key]['goodsInfoList'] = $goodsInfoList;
|
|
|
$data['list'][$key]['bookAvatar'] = isset($customList[$customId]['smallAvatarUrl']) ? $customList[$customId]['smallAvatarUrl'] : '';
|
|
|
$sjId = $val['sjId'];
|
|
|
$data['list'][$key]['name'] = isset($merchantList[$sjId]['name']) ? $merchantList[$sjId]['name'] : '';
|