allen il y a 3 ans
Parent
commit
0af357fb43

+ 7 - 8
app/admin/controller/Award.php

@@ -42,9 +42,9 @@ class Award extends Controller
 //    left join awards_gift as g on o.gift_id = g.id
 //where u.portrait != '' and u.portrait is not null  and l.number >= 15 group by l.uid order by l.id desc limit 100");
 
-        $lists = Db::query("select u.uid,u.nickname, o.name, o.mobile, o.address, g.name as giftName, o.rank as giftName from awards_order as o 
+        $lists = Db::query("select o.id, u.uid,u.nickname, o.name, o.mobile, o.address, g.name as giftName, o.rank from awards_order as o 
     left join awards_user_info as u on o.uid = u.uid 
-    left join awards_gift as g on o.gift_id = g.id where o.type = 2 order by rank asc");
+    left join awards_gift as g on o.gift_id = g.id where o.type = 2 order by o.rank asc");
         $this->assign('lists', $lists);
         $this->fetch();
     }
@@ -60,9 +60,9 @@ class Award extends Controller
     public function award()
     {
 
-        $data = Db::query("select u.uid, u.nickname, o.name, o.mobile, o.address, g.name as giftName, o.rank as giftName from awards_order as o 
+        $data = Db::query("select u.uid, u.nickname, o.name, o.mobile, o.address, g.name as giftName, o.rank from awards_order as o 
     left join awards_user_info as u on o.uid = u.uid 
-    left join awards_gift as g on o.gift_id = g.id where o.type = 2 order by rank asc");
+    left join awards_gift as g on o.gift_id = g.id where o.type = 2 order by o.rank asc");
 
         //实例化
         $objExcel = new \PHPExcel();
@@ -87,7 +87,7 @@ class Award extends Controller
             $objActSheet->setCellValue('D' . $k, $v['mobile']." ");
             $objActSheet->setCellValue('E' . $k, $v['address']);
             $objActSheet->setCellValue('F' . $k, $v['giftName']);
-            $objActSheet->setCellValue('G' . $k, $v['rank']);
+            $objActSheet->setCellValue('G' . $k, $v['rank']." ");
         }
 
         $outfile = "排行榜前50名" . date('Ymd') . ".xlsx";
@@ -149,8 +149,8 @@ class Award extends Controller
         $objWriter = \PHPExcel_IOFactory::createWriter($objExcel, 'Excel2007');
         //设置内容
         $objActSheet = $objExcel->getActiveSheet();
-        $letter = explode(',', "A,B,C,D,E,F,G");
-        $arrHeader = ['微博UID', '微博昵称', '收件人姓名', '联系人电话', '收件地址', '奖品名称','中奖时间'];
+        $letter = explode(',', "A,B,C,D,E,F");
+        $arrHeader = ['微博UID', '微博昵称', '收件人姓名', '联系人电话', '收件地址', '奖品名称'];
         //填充表头信息
         $lenth = count($arrHeader);
         for ($i = 0; $i < $lenth; $i++) {
@@ -166,7 +166,6 @@ class Award extends Controller
             $objActSheet->setCellValue('D' . $k, $v['mobile']." ");
             $objActSheet->setCellValue('E' . $k, $v['address']);
             $objActSheet->setCellValue('F' . $k, $v['giftName']);
-            $objActSheet->setCellValue('G' . $k, $v['createAt']);
         }
 
         $outfile = "中奖信息" . date('Ymd') . ".xlsx";

+ 0 - 8
app/admin/view/award/index.html

@@ -10,11 +10,6 @@
                 <table cellspacing="0" cellpadding="0" border="0" class="layui-table" lay-even="">
                     <thead>
                     <tr>
-                        <th data-field="id" data-key="2-0-1" class="">
-                            <div class="layui-table-cell laytable-cell-2-0-1" align="center">
-                                <span>ID</span>
-                            </div>
-                        </th>
                         <th data-field="uid" data-key="2-0-2" class="">
                             <div class="layui-table-cell laytable-cell-2-0-2" align="center">
                                 <span>微博用户UID</span>
@@ -59,9 +54,6 @@
                     <tbody>
                     {foreach $lists as $val}
                     <tr data-index="0" class="">
-                        <td data-field="id" data-key="2-0-1" align="center" class="">
-                            <div class="layui-table-cell laytable-cell-2-0-1">{$val['id']}</div>
-                        </td>
                         <td data-field="uid" data-key="2-0-2" class="">
                             <div class="layui-table-cell laytable-cell-2-0-2">{$val['uid']}</div>
                         </td>

+ 1 - 1
app/admin/view/award/index_search.html

@@ -5,7 +5,7 @@
             <button type="button" onclick="exportAward()" class="layui-btn layui-btn-primary">
                 <i class="layui-icon layui-icon-export"></i> 导 出
             </button>
-            <a class="layui-btn layui-btn-sm layui-btn-danger" data-confirm="确定要加密用户信息吗?" data-value="id#{{d.id}}" data-action="{:url('dataEncode')}">数据加密</a>
+            <a class="layui-btn layui-btn-sm layui-btn-danger" data-confirm="确定要加密用户信息吗?" data-value="id" data-action="{:url('dataEncode')}">数据加密</a>
         </div>
     </form>
 </fieldset>

+ 0 - 1
app/admin/view/award/luck_draw.html

@@ -23,7 +23,6 @@
                 {field: 'mobile', title: '联系人电话', sort: false},
                 {field: 'address', title: '收件地址', sort: false},
                 {field: 'giftName', title: '奖品名称', sort: false},
-                {field: 'createAt', title: '中奖时间', sort: false},
             ]]
         });
     });

+ 1 - 1
app/index/controller/Index.php

@@ -470,7 +470,7 @@ class Index extends Controller
 
         $orders = Db::query("select u.nickname, u.portrait, g.name as giftName from awards_order as o 
     left join awards_user_info as u on o.uid = u.uid 
-    left join awards_gift as g on o.gift_id = g.id where o.type = 2 order by rank asc");
+    left join awards_gift as g on o.gift_id = g.id where o.type = 2 order by o.rank asc");
 
         return $this->successResponse([
             'isBeginActivity' => $isBeginActivity,