{$meta_title}
@@ -93,16 +95,33 @@
菜单图标 |
-
-
-
-
-
- 
-
-
-
-
+
+
+
+
+
+
菜单图标
|
@@ -117,37 +136,37 @@
/* 初始化上传插件 */
//上传游戏图标
/* 初始化上传插件 */
-$("#upload_picture_icon").uploadify({
- "height" : 30,
- "swf" : "__STATIC__/uploadify/uploadify.swf",
- "fileObjName" : "download",
- "buttonText" : "上传图标",
- "uploader" : "{:U('File/uploadPicture',array('session_id'=>session_id()))}",
- "width" : 120,
- 'removeTimeout' : 1,
- 'fileTypeExts' : '*.jpg; *.jpeg; *.png; *.gif;',
- "onUploadSuccess" : upload_picture_icon{$field.name},
- 'onFallback' : function() {
- alert('未检测到兼容版本的Flash.');
- }
-});
-function upload_picture_icon{$field.name}(file, data){
- var data = $.parseJSON(data);
- var src = '';
- if(data.status){
- src = data.path || data.url;
- $("#cover_id_icon").val(src);
- $("#cover_id_icon").parent().find('.upload-img-box').html(
- '

'
- );
- } else {
- updateAlert(data.info);
- setTimeout(function(){
- $('#top-alert').find('button').click();
- $(that).removeClass('disabled').prop('disabled',false);
- },1500);
- }
-}
+//$("#upload_picture_icon").uploadify({
+// "height" : 30,
+// "swf" : "__STATIC__/uploadify/uploadify.swf",
+// "fileObjName" : "download",
+// "buttonText" : "上传图标",
+// "uploader" : "{:U('File/uploadPicture',array('session_id'=>session_id()))}",
+// "width" : 120,
+// 'removeTimeout' : 1,
+// 'fileTypeExts' : '*.jpg; *.jpeg; *.png; *.gif;',
+// "onUploadSuccess" : upload_picture_icon{$field.name},
+// 'onFallback' : function() {
+// alert('未检测到兼容版本的Flash.');
+// }
+//});
+//function upload_picture_icon{$field.name}(file, data){
+// var data = $.parseJSON(data);
+// var src = '';
+// if(data.status){
+// src = data.path || data.url;
+// $("#cover_id_icon").val(src);
+// $("#cover_id_icon").parent().find('.upload-img-box').html(
+// '

'
+// );
+// } else {
+// updateAlert(data.info);
+// setTimeout(function(){
+// $('#top-alert').find('button').click();
+// $(that).removeClass('disabled').prop('disabled',false);
+// },1500);
+// }
+//}
@@ -167,4 +186,259 @@ function upload_picture_icon{$field.name}(file, data){
//导航高亮
highlight_subnav('{:U('SdkMenu/lists')}');
+
diff --git a/Application/Home/Controller/DownloadController.class.php b/Application/Home/Controller/DownloadController.class.php
index 84b9d0026..9af6d7ab2 100644
--- a/Application/Home/Controller/DownloadController.class.php
+++ b/Application/Home/Controller/DownloadController.class.php
@@ -10,6 +10,7 @@ use Base\Repository\UserRepository;
use Base\Service\PromoteService;
use Base\Facade\Request;
use Base\Service\ApplyService;
+use Base\Service\PromoteCoinRecordService;
/**
* @author elf<360197197@qq.com>
@@ -1010,58 +1011,46 @@ class DownloadController extends BaseController {
* @author sunke
*/
public function mycoinrecord_data_export() {
- $map['tab_promote_coin_record.target_id'] = PID;
- empty(I('type')) || $map['tab_promote_coin_record.type'] = I('type');
- empty(I('sub_type')) || $map['tab_promote_coin_record.sub_type'] = I('sub_type');
-
- if (!empty(I('start_time')) && empty(I('end_time'))) {
- $map['tab_promote_coin_record.create_time'] = ['egt', strtotime(I('start_time'))];
- } elseif (empty(I('start_time')) && !empty(I('end_time'))) {
- $map['tab_promote_coin_record.create_time'] = ['elt', strtotime(I('end_time')) + 86399];
- } elseif (!empty(I('start_time')) && !empty(I('end_time'))) {
- $map['tab_promote_coin_record.create_time'] = ['between', [strtotime(I('start_time')), strtotime(I('end_time')) + 86399]];
+ $type = I('type', 0);
+ $subType = I('sub_type', 0);
+ $targetType = I('target_type', '');
+ $startTime = I('start_time', '');
+ $endTime = I('end_time', '');
+ $gameId = I('game_id', 0);
+ $loginPromote = $this->getLoginPromote();
+ $map = [];
+ $map['game_id'] = $gameId;
+ $map['promote_id'] = $loginPromote['id'];
+ if ($type != 0) {
+ $map['type'] = $type;
}
-
- $having = '';
- $where['_string'] = '1 = 1';
- if (empty(I('get.game_id'))) {
- $where['_logic'] = 'or';
- $join = 'left join tab_promote_coin on tab_promote_coin_record.ref_id = tab_promote_coin.id and tab_promote_coin_record.sub_type > 2 and tab_promote_coin.banlan_type = 1';
- $having = '(coin_id > 0 or pay_id > 0)';
- } else {
- $where['tab_promote_coin_record.sub_type'] = ['gt', 2];
- $join = 'inner join tab_promote_coin on tab_promote_coin_record.ref_id = tab_promote_coin.id and tab_promote_coin.banlan_type = 2 and tab_promote_coin.game_id = ' . I('get.game_id');
+ if ($subType != 0) {
+ $map['sub_type'] = $subType;
+ }
+ if ($targetType != '') {
+ $targetTypeRow = explode('_', $targetType);
+ $map['target_type'] = $targetTypeRow[0];
+ if (count($targetTypeRow) == 2) {
+ $map['target_level'] = $targetTypeRow[1];
+ }
}
- if (!empty(I('handle_type'))) {
- switch (I('handle_type')) {
- case 1:
- $where['tab_promote_coin.source_type'] = 1;
- $join .= ' inner join tab_promote on tab_promote_coin.source_id = tab_promote.id and tab_promote.parent_id = 0';
- break;
- case 2:
- $where['tab_promote_coin.source_type'] = 1;
- $join .= ' inner join tab_promote on tab_promote_coin.source_id = tab_promote.id and tab_promote.parent_id > 0 and tab_promote.grand_id = 0';
- break;
- case 3:
- $where['tab_promote_coin.source_type'] = 1;
- $join .= ' inner join tab_promote on tab_promote_coin.source_id = tab_promote.id and tab_promote.grand_id > 0';
- break;
- case 4:
- $where['tab_promote_coin.source_type'] = 2;
- break;
+ if ($startTime != '' || $endTime != '') {
+ if ($startTime != '') {
+ $map['create_time'] = ['egt', strtotime($startTime. ' 00:00:00')];
+ }
+ if ($endTime != '') {
+ $map['create_time'] = ['elt', strtotime($endTime. ' 23:59:59')];
}
}
-
- $join .= ' left join tab_coin_pay_order on tab_promote_coin_record.ref_id = tab_coin_pay_order.id and tab_promote_coin_record.sub_type in (1,2)';
- $map['_complex'] = $where;
+
+
$conditions = json_encode($map,TRUE);
$addtime = time();
- $type = "/Home/PromoteCoin/coinRecord";
$data = [
'logid' => 'pt_'.time(),
'admin_id' => PID,
- 'type' => $type,
+ 'type' => "/Home/PromoteCoin/coinRecord",
'dataname' => '我的平台币明细',
'status' => 0,
'addtime' => $addtime,
@@ -1362,7 +1351,7 @@ class DownloadController extends BaseController {
'isContainSubs' => true,
'basicPromotes' => json_encode($basicPromotes,FALSE),
];
- $map['promotes'] = json_encode($data,FALSE);
+ $map['promotes'] = json_encode($data,FALSE);
$map['ids'] = $ids;
if ($gameId > 0) {
$params['game_id'] = $gameId;
@@ -1881,7 +1870,6 @@ class DownloadController extends BaseController {
array('create_time','创建时间'),
);
-
$model = M('promote','tab_');
$data = $model->where($map)->select();
$xlsData = [];
@@ -1942,23 +1930,34 @@ class DownloadController extends BaseController {
$xlsName = "我的平台币明细";
$xlsCell = array(
array('sn','流水号'),
- array('type','操作类型'),
- array('sub_type','操作方式'),
- array('handle_type','账号类型'),
+ array('type_text','操作类型'),
+ array('sub_type_text','操作方式'),
+ array('target_type_text','对手操作类型'),
array('coin','平台币数量'),
array('balance_coin','平台币余额'),
array('description','交易说明'),
array('create_time','交易时间'),
);
- $join .= ' left join tab_coin_pay_order on tab_promote_coin_record.ref_id = tab_coin_pay_order.id and tab_promote_coin_record.sub_type in (1,2)';
- $data = M('PromoteCoinRecord', 'tab_')
- ->field('tab_promote_coin_record.*,tab_promote_coin.id as coin_id,tab_promote_coin.source_type,tab_promote_coin.source_id,tab_coin_pay_order.id as pay_id')
- ->join($join)
- ->where($map)
- ->having($having)
- ->order('id desc')
- // ->fetchSql(true)
- ->select();
+ $service = new PromoteCoinRecordService();
+ $data = M('promote_coin_record','tab_')->where($map)->select();
+ $records = [];
+ foreach ($data as $item) {
+ $records[] = [
+ 'id' => $item['id'],
+ 'sn' => $item['sn'],
+ 'type_text' => $service->getTypeText($item['type']),
+ 'sub_type_text' => $service->getSubTypeText($item['sub_type']),
+ 'target_type_text' => $service->getTargetTypeText($item['target_type'], $item['target_level']),
+ 'coin' => $item['coin'],
+ 'balance_coin' => $item['balance_coin'],
+ 'remark' => $item['remark'],
+ 'description' => $item['description'],
+ 'create_time' => date('Y-m-d H:i:s', $item['create_time']),
+ ];
+ }
+
+ $xlsData = $records;
+ $this->exportExcel($xlsName, $xlsCell, $xlsData,$id);
}
diff --git a/Application/Home/View/default/PromoteCoin/coinDetails.html b/Application/Home/View/default/PromoteCoin/coinDetails.html
index 5da236f25..398fdeeb5 100644
--- a/Application/Home/View/default/PromoteCoin/coinDetails.html
+++ b/Application/Home/View/default/PromoteCoin/coinDetails.html
@@ -205,6 +205,9 @@