Skip to content

Commit

Permalink
增加 批量邀请码生成
Browse files Browse the repository at this point in the history
  • Loading branch information
sendya committed Apr 6, 2016
1 parent d3dd51c commit 6912d5f
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Library/Controller/Admin/Invite.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public function add() {
}
if($inviteNumber > 1) {
for($i=0; $i<$inviteNumber;$i++){
InviteModel::addInvite($user->uid, $plan);
InviteModel::addInvite(-1, $plan);
}
} else {
InviteModel::addInvite(-1, $plan);
Expand Down
16 changes: 15 additions & 1 deletion Template/Default/admin/invite.htm
Original file line number Diff line number Diff line change
Expand Up @@ -115,14 +115,26 @@ <h4 class="modal-title">新增邀请码</h4>
<label for="field-4" class="control-label">添加时间</label>

<div class="date-and-time">
<input type="text" id="field-4" class="form-control datepicker" name="add_time1" data-format="yyyy-mm-dd">
<input type="text" id="field-4" class="form-control datepicker" placeholder="{(date('Y-m-d', time()))}" name="add_time1" data-format="yyyy-mm-dd">
<input type="text" class="form-control timepicker" name="add_time2" data-template="dropdown" data-show-seconds="true" data-default-time="11:25" data-show-meridian="false" data-minute-step="5" data-second-step="5" />
</div>
</div>

</div>
</div>

<div class="row">
<div class="col-md-6">

<div class="form-group">
<label for="field-5" class="control-label">添加邀请码个数</label>

<input type="number" class="form-control" name="number" id="field-5" value="1" placeholder="1" data-message-required="邀请码个数.">
</div>

</div>
</div>

</div>
<div class="modal-footer">
<button type="button" class="btn btn-white" data-dismiss="modal">关闭</button>
Expand Down Expand Up @@ -168,6 +180,7 @@ <h4 class="modal-title">新增邀请码</h4>
$("#plan").val(invite.plan);
$("input[name='expiration']").val(invite.expiration);
$("input[name='add_time1']").val(invite.dateLine);
$("input[name='number']").hide().val('');
$("#form1").attr("action", "/admin/invite/update.json");
jQuery('#modal-6 .modal-title').html('修改邀请码');
jQuery('#modal-6').modal('show', {backdrop: 'static'});
Expand All @@ -183,6 +196,7 @@ <h4 class="modal-title">新增邀请码</h4>
jQuery('#modal-6').modal('show', {backdrop: 'static'});
}
function inviteAdd(){
$("input[name='number']").show().val('');
$("input[name='invite']").val('');
$("input[name='invite_2']").val('');
$("#plan").val('A');
Expand Down

0 comments on commit 6912d5f

Please sign in to comment.