修改礼券预览功能

dev
曾超新 5 years ago
parent 78ae217d87
commit 4573aa5208
  1. 3
      frontend/controllers/MarketingStrategyController.php
  2. 4
      frontend/views/insurer/my-list-info.php

@ -632,8 +632,10 @@ class MarketingStrategyController extends UserBaseController
->where(['order_id'=>$order_id,'gift_type'=>$type]) ->where(['order_id'=>$order_id,'gift_type'=>$type])
->all(); ->all();
$order_gift_ids = []; $order_gift_ids = [];
$order_gift_srcs = [];
foreach($order_gift_items as $order_gift_item) { foreach($order_gift_items as $order_gift_item) {
$order_gift_ids[] = $order_gift_item->gift_id; $order_gift_ids[] = $order_gift_item->gift_id;
$order_gift_srcs[$order_gift_item->gift_id] = $order_gift_item->gift_src;
} }
$gifts = ZhongjiGiftT::find() $gifts = ZhongjiGiftT::find()
->where(['fanxian_id'=>$fanxian_id,'gift_type'=>$type]) ->where(['fanxian_id'=>$fanxian_id,'gift_type'=>$type])
@ -647,6 +649,7 @@ class MarketingStrategyController extends UserBaseController
foreach($tmp_row['gifts'] as $index => $gift_info) { foreach($tmp_row['gifts'] as $index => $gift_info) {
if(in_array($gift_info['id'], $order_gift_ids)) { if(in_array($gift_info['id'], $order_gift_ids)) {
$tmp_row['gifts'][$index]['selected'] = 1; $tmp_row['gifts'][$index]['selected'] = 1;
$tmp_row['gifts'][$index]['img_src'] = $order_gift_srcs[$gift_info['id']];
} else { } else {
$tmp_row['gifts'][$index]['selected'] = 0; $tmp_row['gifts'][$index]['selected'] = 0;
} }

@ -297,7 +297,9 @@ use common\models\PriceT;
html += '</div>'; html += '</div>';
<?php } else { ?> <?php } else { ?>
if(sub_item.selected == 1) if(sub_item.selected == 1)
html += '<div class="col-sm-4">' + sub_item.name + '</div>'; html += '<div class="col-sm-4">' + sub_item.name;
html += '<a href="' + sub_item.img_src + '" target="_blank"><i class="fa fa-image"></i></a>';
html += '</div>';
<?php } ?> <?php } ?>
}); });
html += '</td>'; html += '</td>';

Loading…
Cancel
Save