完善礼券策略功能开发

dev
曾超新 5 years ago
parent 85a864c178
commit fe6986f367
  1. 6
      frontend/controllers/MarketingStrategyController.php
  2. 9
      frontend/views/marketing-strategy/edit.php
  3. 6
      frontend/views/marketing-strategy/gifts.php

@ -386,15 +386,17 @@ class MarketingStrategyController extends UserBaseController
$request = Yii::$app->request; $request = Yii::$app->request;
$celuo_id = $request->get('celuo_id'); $celuo_id = $request->get('celuo_id');
$fanxian_id = $request->get('fanxian_id'); $fanxian_id = $request->get('fanxian_id');
$type = $request->get('type',1);
$items = GiftT::find() $items = GiftT::find()
->where(['type_id'=>1]) ->where(['type_id'=>$type])
->all(); ->all();
return $this->render('gifts',[ return $this->render('gifts',[
'celuo_id'=>$celuo_id, 'celuo_id'=>$celuo_id,
'fanxian_id'=>$fanxian_id, 'fanxian_id'=>$fanxian_id,
'items'=>$items 'items'=>$items,
'type' => $type
]); ]);
} }

@ -93,10 +93,10 @@ use \common\libs\MyLib;
html += '<div class="ibox-title">'; html += '<div class="ibox-title">';
html += '<label>客户返现:' + item.fanxian_rate + '%,最高返现:' + item.max_cashback + '元</label>'; html += '<label>客户返现:' + item.fanxian_rate + '%,最高返现:' + item.max_cashback + '元</label>';
html += '<div class="ibox-tools">'; html += '<div class="ibox-tools">';
html += '<a class="btn btn-primary btn-xs btn-users" data-id="0" href="javascript:void(0);" onclick="gifts(' + item.id + ')">'; html += '<a class="btn btn-primary btn-xs btn-users" data-id="0" href="javascript:void(0);" onclick="gifts(' + item.id + ',1)">';
html += '<i class="fa fa-users"></i> 添加礼品'; html += '<i class="fa fa-users"></i> 添加礼品';
html += '</a>'; html += '</a>';
html += '<a class="btn btn-primary btn-xs btn-users" data-id="0" href="javascript:void(0);" onclick="users()">'; html += '<a class="btn btn-primary btn-xs btn-users" data-id="0" href="javascript:void(0);" onclick="gifts(' + item.id + ',2)">';
html += '<i class="fa fa-users"></i> 添加礼券'; html += '<i class="fa fa-users"></i> 添加礼券';
html += '</a>'; html += '</a>';
html += '<button class="btn btn-danger btn-xs" style="margin-left: 8px;" onclick="deleteFanxian(' + item.id + ')">'; html += '<button class="btn btn-danger btn-xs" style="margin-left: 8px;" onclick="deleteFanxian(' + item.id + ')">';
@ -159,9 +159,10 @@ use \common\libs\MyLib;
// //
}); });
} }
function gifts(fanxian_id) { function gifts(fanxian_id, type) {
title = '添加礼品'; title = '添加礼品';
layer_show(title, '/marketing-strategy/gifts?celuo_id=<?=$info->id?>&fanxian_id=' + fanxian_id); if(type == 2) title = '添加礼券';
layer_show(title, '/marketing-strategy/gifts?celuo_id=<?=$info->id?>&fanxian_id=' + fanxian_id + '&type=' + type);
} }
function deleteGift(id) { function deleteGift(id) {
layer.confirm('是否确认删除礼品/礼券?', { layer.confirm('是否确认删除礼品/礼券?', {

@ -10,9 +10,9 @@ use \common\libs\MyLib;
<form role="form" class="form-horizontal" id="theFrm" onsubmit="return false;"> <form role="form" class="form-horizontal" id="theFrm" onsubmit="return false;">
<input type="hidden" name="celuo_id" value="<?=$celuo_id?>"> <input type="hidden" name="celuo_id" value="<?=$celuo_id?>">
<input type="hidden" name="fanxian_id" value="<?=$fanxian_id?>"> <input type="hidden" name="fanxian_id" value="<?=$fanxian_id?>">
<input type="hidden" name="gift_type" value="1"> <input type="hidden" name="gift_type" value="<?=$type?>">
<div class="form-group"> <div class="form-group">
<label class="col-sm-2 control-label">礼品类型</label> <label class="col-sm-2 control-label">模式</label>
<div class="col-sm-4"> <div class="col-sm-4">
<select name="free_type" id="type" class="form-control"> <select name="free_type" id="type" class="form-control">
<option value="3">M选N模式</option> <option value="3">M选N模式</option>
@ -29,7 +29,7 @@ use \common\libs\MyLib;
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-2 control-label">选择礼品</label> <label class="col-sm-2 control-label">选择礼品/礼券</label>
<div class="col-sm-9"> <div class="col-sm-9">
<div class="row"> <div class="row">
<?php foreach($items as $item) { ?> <?php foreach($items as $item) { ?>

Loading…
Cancel
Save