|
@@ -47,7 +47,7 @@ class MengbaoController extends CommonController {
|
|
|
if (isset($keyword) && !empty($keyword)) {
|
|
|
$this->assign('keyword', $keyword);
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
// var_dump(I('post.'));die;
|
|
|
$page = I('p') ? I('p') : 1;
|
|
|
$this->assign('p', $page);
|
|
@@ -67,7 +67,7 @@ class MengbaoController extends CommonController {
|
|
|
$this->display('Index');
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
+ /**
|
|
|
* [ExcelExport excel文件导出]
|
|
|
* @author Devil
|
|
|
* @blog http://gong.gg/
|
|
@@ -76,17 +76,17 @@ class MengbaoController extends CommonController {
|
|
|
*/
|
|
|
public function ExcelExport()
|
|
|
{
|
|
|
- $where = array();
|
|
|
+ $where = array();
|
|
|
$data = M('activity_mengbao')->where($where)->order('score desc , id asc')->select();
|
|
|
|
|
|
- $title = array(
|
|
|
- 'id' => array('col' => 'A', 'name' => 'ID'),
|
|
|
- 'name' => array('col' => 'B', 'name' => '名字'),
|
|
|
- 'uid' => array('col' => 'C', 'name' => 'uid'),
|
|
|
- 'phone' => array('col' => 'D', 'name' => '联系人手机号'),
|
|
|
- 'score' => array('col' => 'E', 'name' => '得票数'),
|
|
|
+ $title = array(
|
|
|
+ 'id' => array('col' => 'A', 'name' => 'ID'),
|
|
|
+ 'name' => array('col' => 'B', 'name' => '名字'),
|
|
|
+ 'uid' => array('col' => 'C', 'name' => 'uid'),
|
|
|
+ 'phone' => array('col' => 'D', 'name' => '联系人手机号'),
|
|
|
+ 'score' => array('col' => 'E', 'name' => '得票数'),
|
|
|
'is_show' => array('col' => 'F', 'name' => '在线状态(1在线,0下线)')
|
|
|
- );
|
|
|
+ );
|
|
|
// Excel驱动导出数据
|
|
|
$excel = new \My\Excel(array('filename' => '萌宝排行榜', 'title' => $title, 'data' => $data, 'msg' => L('common_not_data_tips')));
|
|
|
$excel->Export();
|
|
@@ -115,7 +115,7 @@ class MengbaoController extends CommonController {
|
|
|
//素材列表
|
|
|
if (I('id')) {
|
|
|
$sourceList = M('activity_mengbao')->where(['id' => array('neq', I('id'))])->field('id as source_id,name as source_name')->select();
|
|
|
- }
|
|
|
+ }
|
|
|
$this->assign('sourceList', $sourceList);
|
|
|
|
|
|
$this->assign('data', $data);
|
|
@@ -254,7 +254,7 @@ class MengbaoController extends CommonController {
|
|
|
"name" => array('name' => 'name'),
|
|
|
"age" => array('name' => 'age'),
|
|
|
"desc" => array('name' => 'desc'),
|
|
|
- 'score' => array('namr' => 'score'),
|
|
|
+ 'score' => array('name' => 'score'),
|
|
|
"image" => array('name' => 'image'),
|
|
|
"video" => array('name' => 'video'),
|
|
|
"media_id" => array('name' => 'media_id'),
|
|
@@ -312,7 +312,7 @@ class MengbaoController extends CommonController {
|
|
|
}
|
|
|
$msg = '导入完成';
|
|
|
goto end;
|
|
|
-
|
|
|
+
|
|
|
end:
|
|
|
$responsedata = array("msg" => $msg, "res" => 1, 'data' => []);
|
|
|
echo json_encode($responsedata,JSON_UNESCAPED_UNICODE);
|