Commit e9333fcb authored by zw's avatar zw

Merge remote-tracking branch 'origin/1210-v3.0.2' into 1210-v3.0.2

parents 3b8ec0cd 1ae6507b
...@@ -177,20 +177,25 @@ class Setting extends Basic ...@@ -177,20 +177,25 @@ class Setting extends Basic
* @return \think\Response * @return \think\Response
*/ */
public function configWeek() { public function configWeek() {
if (empty($this->params['site_id']) || empty($this->params['total_date_start']) || empty($this->params['total_date_end']) ||
empty($this->params['sort_date_start']) || empty($this->params['sort_date_end'])) {
return $this->response(101, '参数错误');
}
try { try {
$code = 200; $code = 200;
$msg = ''; $msg = '';
$data = []; $data = [];
$where['params'] = 'week_competition_'.$this->params['site_id']; $where['params'] = 'week_competition_'.$this->params['site_id'];
if (empty($this->params['site_id'])) {
return $this->response(101, '参数错误');
}
$id = $this->m_config->getSettingV2($where, 'id,rule'); $id = $this->m_config->getSettingV2($where, 'id,rule');
if ($this->request->isPost()) { if ($this->request->isPost()) {
if (empty($this->params['total_date_start']) || empty($this->params['total_date_end']) ||
empty($this->params['sort_date_start']) || empty($this->params['sort_date_end'])) {
return $this->response(101, '参数错误');
}
$rule['total_date_start'] = $this->params['total_date_start']; $rule['total_date_start'] = $this->params['total_date_start'];
$rule['total_date_end'] = $this->params['total_date_end']; $rule['total_date_end'] = $this->params['total_date_end'];
$rule['sort_date_start'] = $this->params['sort_date_start']; $rule['sort_date_start'] = $this->params['sort_date_start'];
......
...@@ -194,9 +194,9 @@ ...@@ -194,9 +194,9 @@
<span class="fore-span ld-Marheight">-</span> <span class="fore-span ld-Marheight">-</span>
<input class="btn4-pk ld-Marheight input-pk-style" value="" data-rule-phoneus="false" data-rule-required="false" id="create_time_end" name="end_date1" type="date"> <input class="btn4-pk ld-Marheight input-pk-style" value="" data-rule-phoneus="false" data-rule-required="false" id="create_time_end" name="end_date1" type="date">
<span class="fore-span ld-Marheight">分档根据时间:</span> <span class="fore-span ld-Marheight">分档根据时间:</span>
<input class="btn4-pk ld-Marheight input-pk-style" value="" data-rule-phoneus="false" data-rule-required="false" id="create_time_start" name="start_date1" type="date"> <input class="btn4-pk ld-Marheight input-pk-style" value="" data-rule-phoneus="false" data-rule-required="false" id="sort_time_start" name="start_date1" type="date">
<span class="fore-span ld-Marheight">-</span> <span class="fore-span ld-Marheight">-</span>
<input class="btn4-pk ld-Marheight input-pk-style" value="" data-rule-phoneus="false" data-rule-required="false" id="create_time_end" name="end_date1" type="date"> <input class="btn4-pk ld-Marheight input-pk-style" value="" data-rule-phoneus="false" data-rule-required="false" id="sort_time_end" name="end_date1" type="date">
<span class="produce-pk fore-span ld-Marheight">生成</span> <span class="produce-pk fore-span ld-Marheight">生成</span>
</div> </div>
<img src="/resource/image/gold@1x.png" class="img-gold"/> <img src="/resource/image/gold@1x.png" class="img-gold"/>
......
...@@ -21,8 +21,7 @@ define(['doT', 'text!temp/pk_week_list_template_tpl.html.html', 'css!style/home. ...@@ -21,8 +21,7 @@ define(['doT', 'text!temp/pk_week_list_template_tpl.html.html', 'css!style/home.
var day_end = y + '.' + (m < 10 ? ('0' + m) : m) + '.' + (d < 10 ? ('0' + d) : d); var day_end = y + '.' + (m < 10 ? ('0' + m) : m) + '.' + (d < 10 ? ('0' + d) : d);
$('#start_date').html(day_start); $('#start_date').html(day_start);
$('#end_date').html(day_end); $('#end_date').html(day_end);
pkList.getTime();
// pkList.getCitySite();
pkList.getTeamList(0); pkList.getTeamList(0);
pkList.event(); pkList.event();
}, },
...@@ -87,7 +86,10 @@ define(['doT', 'text!temp/pk_week_list_template_tpl.html.html', 'css!style/home. ...@@ -87,7 +86,10 @@ define(['doT', 'text!temp/pk_week_list_template_tpl.html.html', 'css!style/home.
$("#pk_list").html(doTtmpl(pkList.mainTabArr[pkList.mainTabIndexTwo])); $("#pk_list").html(doTtmpl(pkList.mainTabArr[pkList.mainTabIndexTwo]));
}); });
//生成pk榜
_doc.on('click', '.produce-pk', function(e){
pkList.setTime();
});
$(".export-pk").click(function() { //导出列表 $(".export-pk").click(function() { //导出列表
if(pkList.mainTabIndexTeam){ if(pkList.mainTabIndexTeam){
pkList.exportTeamList(); pkList.exportTeamList();
...@@ -217,6 +219,50 @@ define(['doT', 'text!temp/pk_week_list_template_tpl.html.html', 'css!style/home. ...@@ -217,6 +219,50 @@ define(['doT', 'text!temp/pk_week_list_template_tpl.html.html', 'css!style/home.
} }
}); });
}, },
//显示 隐藏城市 默认显示 当前账号 所在城市
getTime:function(){
$.ajax({
url: '/index/configWeek',
type: 'GET',
async: true,
data: {
'site_id':user_info_obj.site_id,
},
dataType: 'json',
success: function(data) {
if(data.code == 200 && data.data != null) {
console.log(data.data.total_date_start)
var data_= JSON.parse(data.data);
$('#create_time_start').val(data_.total_date_start);
$('#create_time_end').val(data_.total_date_end);
$('#sort_time_start').val(data_.sort_date_start);
$('#sort_time_end').val(data_.sort_date_end);
}
}
});
},
//设置时间
setTime:function(){
$.ajax({
url: '/index/configWeek',
type: 'POST',
async: true,
data: {
'site_id':user_info_obj.site_id,
'total_date_start':$('#create_time_start').val(),
'total_date_end':$('#create_time_end').val(),
'sort_date_start':$('#sort_time_start').val(),
'sort_date_end':$('#sort_time_end').val()
},
dataType: 'json',
success: function(data) {
if(data.code == 200 && data.data != null) {
}
}
});
},
}; };
return pkList; return pkList;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment