123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185 |
- <?php
- // 应用版本列表查询逻辑
- $page = SafeRequest("page", "get");
- $result = db("app")->where("in_uid", $this->userid)->where("in_appid", $id)->order("in_addtime desc")->paginate(["page" => $page, 'list_rows' => 5]);
- $render = $result->render();
- $count = $result->total();
- $del_vid = 0;
- if ($count > 3) {
- $del_vid = db("app")->where("in_uid", $this->userid)->where("in_appid", $id)->order("in_addtime asc")->value("in_id");
- }
- ?>
- <div class="table-list">
- <div class="table-responsive">
- <table class="table version-history-table">
- <tbody>
- <tr>
- <th>版本</th>
- <th>大小</th>
- <th>证书名称</th>
- <th>更新说明</th>
- <th>更新时间</th>
- <th>操作</th>
- </tr>
- <?php
- foreach ($result as $key => $value) {
- ?>
- <tr>
- <td class="angle-parent">
- <?php
- if ($value["in_release"] == 1) {
- ?><img class="angle" src="/static/index/image/angle-1.png"><?php
- }
- ?>
- <?php echo $value["in_bsvs"]; ?> (Build <?php echo $value["in_bvs"]; ?>)
- </td>
- <td><?php echo formatsize($value["in_size"]); ?></td>
- <td>
- <?php
- if ($value["in_form"] == "iOS") {
- ?>
- <div title="<?php echo $value["in_team"]; ?>">
- <?php echo $value["in_team"]; ?>
- </div>
- <?php
- } else {
- ?> -
- <?php
- }
- ?>
- </td>
- <td>
- <?php
- if (empty($value["in_desc"])) {
- ?> -- --
- <?php
- } else {
- ?> <?php echo $value["in_desc"]; ?>
- <?php
- }
- ?>
- </td>
- <td><?php echo date("Y-m-d H:i:s", $value["in_addtime"]); ?></td>
- <td>
- <input name="history_id" type="hidden" value="<?php echo bees_encrypt($value["in_id"]); ?>">
- <?php
- if ($value["in_release"] != 1) {
- ?><a href="javascript:;" class="btn-fabu" title="发布">发布</a><?php
- }
- ?>
- <a href="#" data-target="#updateModal" data-toggle="modal" class="btn-edit" title="编辑">编辑</a>
- <a href="<?php echo getapp_history($value["in_id"], 1); ?>" title="下载">下载</a>
- <?php
- if ($value["in_release"] != 1) {
- ?><a href="javascript:;" class="btn-shanchu" title="删除">删除</a><?php
- }
- ?>
- </td>
- </tr>
- <?php
- }
- ?>
- </tbody>
- <!-- <tfoot>
- <tr>
- <td colspan="9"><?php echo getRender($result, $page); ?></td>
- </tr>
- </tfoot> -->
- </table>
- </div>
- <div class="pagination-wrap">
- <?php echo getRender($result, $page); ?>
- </div>
- </div>
- <!-- 编辑模态框 -->
- <div class="modal fade" role="dialog" id="updateModal">
- <div class="modal-dialog" role="document">
- <div class="modal-content">
- <div class="modal-header">
- <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span>
- </button>
- <h4>版本编辑</h4>
- </div>
- <div class="modal-body">
- <div class="app-details-update">
- <div class="form-group clearfix">
- <label class="col-sm-2 control-label">更新说明</label>
- <div class="col-sm-10">
- <textarea rows="6" name="desc" class="form-control"></textarea>
- </div>
- </div>
- </div>
- </div>
- <div class="modal-footer">
- <button type="button" class="ms-btn ms-btn-primary w120 plugin-save mr20" data-dismiss="modal">
- 保存
- </button>
- </div>
- </div>
- </div>
- </div>
- <script>
- var app_id = '<?php echo bees_encrypt($id);?>';
-
- // 发布功能
- $('.btn-fabu').click(function () {
- var history_id = $(this).parent().find('input').val();
- $.post('/index/ajax_profile/setUseHistory', {id: history_id, app_id: app_id}, function (data) {
- if (data.code == 200) {
- alert('发布版本成功', function () {
- window.location.reload();
- });
- return true;
- }
- }, 'json');
- });
-
- // 删除功能
- $('.btn-shanchu').click(function () {
- var history_id = $(this).parent().find('input').val();
- alert('<b>你确定要删除该版本信息吗?</b><br/>删除后将无法恢复!', function () {
- $.post('/index/ajax_profile/delHistory', {'id': history_id, app_id: app_id}, function (data) {
- if (data.code == 200) {
- alert('删除版本成功', function () {
- window.location.reload();
- });
- return true;
- } else {
- alert(data.msg);
- }
- }, 'json');
- }, function () {
- }, 'center', '删除', '取消');
- });
-
- // 编辑功能
- $('.btn-edit').click(function () {
- var history_id = $(this).parent().find('input').val();
- $.get('/index/ajax_profile/getHistory?id=' + history_id + '&app_id=' + app_id, function (data) {
- if (data.code != 200) {
- alert('系统繁忙,请稍后重试');
- return true;
- }
- $("#updateModal textarea[name='desc']").val('').val(data.data.desc);
- $('#updateModal').modal('show');
- $('#updateModal .ms-btn-primary').unbind().click(function () {
- var desc = $("#updateModal textarea[name='desc']").val();
- $.post('/index/ajax_profile/updateHistory', {
- 'id': history_id,
- app_id: app_id,
- desc: desc
- }, function (data) {
- if (data.code == 200) {
- alert('更新说明操作成功', function () {
- window.location.reload();
- });
- return true;
- }
- }, 'json');
- })
- }, 'json');
- });
- </script>
|