11月功能提交

master
zhengyongxing 4 years ago
parent f3a45dfac6
commit 2040991894

@ -109,9 +109,9 @@ class CompanyGameRatioController extends AdminController
$gameres = M("game","tab_")->field("tab_game.relation_game_id,tab_game.relation_game_name,IF(tab_game.original_package_name='','未配置',tab_game.original_package_name) original_package_name,tab_game_type.type_name game_type_name")->where($gamewhere)->join("tab_game_type on tab_game.game_type_id = tab_game_type.id")->group("tab_game.relation_game_id")->select(false);
$dbres = M("company_game_ratio","tab_")
->alias('m')
->field("m.*,g.*,p.company_name,m.company_belong,IFNULL(r.settlement_type,-1) settlement_type,group_concat(turnover_type ORDER BY begin_time ASC SEPARATOR '|') turnover_type,group_concat(ratio ORDER BY begin_time ASC SEPARATOR '|') ratio,group_concat(begin_time ORDER BY begin_time ASC SEPARATOR '|') begin_time,group_concat(end_time ORDER BY begin_time ASC SEPARATOR '|') end_time,group_concat(m.turnover_ratio ORDER BY begin_time ASC SEPARATOR '|') turnover_ratio,group_concat(m.id ORDER BY begin_time ASC SEPARATOR '|') operate_id")
->field("m.*,g.*,p.company_name,(CASE WHEN p.company_belong is not null THEN p.company_belong ELSE m.company_belong END) company_belong,IFNULL(r.settlement_type,-1) settlement_type,group_concat(turnover_type ORDER BY begin_time ASC SEPARATOR '|') turnover_type,group_concat(ratio ORDER BY begin_time ASC SEPARATOR '|') ratio,group_concat(begin_time ORDER BY begin_time ASC SEPARATOR '|') begin_time,group_concat(end_time ORDER BY begin_time ASC SEPARATOR '|') end_time,group_concat(m.turnover_ratio ORDER BY begin_time ASC SEPARATOR '|') turnover_ratio,group_concat(m.id ORDER BY begin_time ASC SEPARATOR '|') operate_id")
->join("JOIN ({$gameres}) g ON m.relation_game_id = g.relation_game_id")
->join("JOIN tab_promote_company p ON ( m.company_id = p.id".$pwhere.")")
->join("left JOIN tab_promote_company p ON ( m.company_id = p.id".$pwhere.")")
->join("left JOIN tab_company_relation r ON (r.first_company_type =2 AND r.first_company_id = m.company_id) OR (r.second_company_type =2 AND r.second_company_id = m.company_id)");
if(isset($params['export'])){
$dbres = $dbres->where($where)->group("company_id,m.relation_game_id,m.company_belong")->select();
@ -125,6 +125,10 @@ class CompanyGameRatioController extends AdminController
$end_time = explode('|',$v['end_time']);
$turnover_type = explode('|',$v['turnover_type']);
if (!$v['company_name']) {
$v['company_name'] = '无';
}
foreach ($begin_time as $tk => $tv) {
$begintime = date("Y-m-d",$tv);
@ -150,8 +154,8 @@ class CompanyGameRatioController extends AdminController
//
// $v["valid"] = "{$v['begin_time']} ~ {$v['end_time']}";
// $v['company_belong'] ="下游".getCompanyBlong($v['company_belong']);
$v['company_belong'] ="下游".$this->setCompanyBelong($v['company_belong']);
$v['company_belong'] ="下游".getCompanyBlong($v['company_belong']);
// $v['company_belong'] ="下游".$this->setCompanyBelong($v['company_belong']);
if (isset($params['export'])) {
$symbol = "\n";
@ -260,9 +264,9 @@ class CompanyGameRatioController extends AdminController
$gameres = M("game","tab_")->field("tab_game.relation_game_id,tab_game.relation_game_name,IF(tab_game.original_package_name='','未配置',tab_game.original_package_name) original_package_name,tab_game_type.type_name game_type_name")->where($gamewhere)->join("tab_game_type on tab_game.game_type_id = tab_game_type.id")->group("tab_game.relation_game_id")->select(false);
$dbres = M("company_game_ratio_log","tab_")
->alias('m')
->field("m.*,g.*,p.company_name,m.company_belong,IFNULL(r.settlement_type,0) settlement_type")
->field("m.*,g.*,p.company_name,(CASE WHEN p.company_belong is not null THEN p.company_belong ELSE m.company_belong END) company_belong,IFNULL(r.settlement_type,0) settlement_type")
->join("JOIN ({$gameres}) g ON m.relation_game_id = g.relation_game_id")
->join("JOIN tab_promote_company p ON ( m.company_id = p.id".$pwhere.")")
->join("left JOIN tab_promote_company p ON ( m.company_id = p.id".$pwhere.")")
->join("left JOIN tab_company_relation r ON (r.first_company_type =2 AND r.first_company_id = m.company_id) OR (r.second_company_type =2 AND r.second_company_id = m.company_id)")
->where($where)
->order("FIELD(m.status,0,1,-1,-2,2),id desc");
@ -277,6 +281,10 @@ class CompanyGameRatioController extends AdminController
$v['begin_time'] = date("Y-m-d",$v['begin_time']);
$v['end_time'] = $v['end_time'] ? date('Y-m-d', $v['end_time']) : '永久';
if (!$v['company_name']) {
$v['company_name'] = '无';
}
$v["valid"] = "{$v['begin_time']} ~ {$v['end_time']}";
if($v["turnover_type"] == 0) {
@ -292,8 +300,8 @@ class CompanyGameRatioController extends AdminController
}
// $v['company_belong'] ="下游".getCompanyBlong($v['company_belong']);
$v['company_belong'] ="下游".$this->setCompanyBelong($v['company_belong']);
$v['company_belong'] ="下游".getCompanyBlong($v['company_belong']);
// $v['company_belong'] ="下游".$this->setCompanyBelong($v['company_belong']);
$v['verify_log'] = json_decode($v['verify_log'], true);
if (isset($params['export'])) {
$symbol = "\n";
@ -499,7 +507,7 @@ class CompanyGameRatioController extends AdminController
public function companyRatioTimeChange($company_belong = 0,$company_id = 0, $relation_game_id = 0, $begin_time = 0, $end_time = 0,$ratiov=[]) {
if (!$company_id || !$relation_game_id) {
if (!$relation_game_id) {
$this->error("公司与游戏的参数错误.");
}
// dump($end_time);dump($begin_time);die();

@ -948,18 +948,12 @@ class CompanyStatementSetController extends Controller {
"s.payed_time"=>['between', [$begintime,$endtime]],
];
// dump($spenMap);
$cpSpendList = $Spend->alias('s')->field('sum(s.pay_amount) pay_amount,s.game_id,g.relation_game_id,g.relation_game_name game_name')->where($spenMap)->group('game_id')
->join("left join tab_game g on s.game_id = g.id")
->select();
$cpMap = $spenMap;
$cpAllMap = $spenMap;
$cpAllMap["s.payed_time"] = ['elt',$endtime];
// unset($cpAllMap["s.payed_time"]);
$cpAllSpendList = $Spend->alias('s')->field('sum(s.pay_amount) pay_amount,s.game_id,g.relation_game_id,g.relation_game_name game_name')->where($cpAllMap)->group('game_id')
->join("left join tab_game g on s.game_id = g.id")
->select();
for ($i=0; $i <count($idarr); $i++) {
$company_id = $idarr[$i];
@ -994,35 +988,6 @@ class CompanyStatementSetController extends Controller {
}
}
foreach($cpSpendList as $k=>$v){
try {
$cp_res[$company_id]["pay_amount"] += $v['pay_amount'];
} catch (\Throwable $th) {
$cp_res[$company_id]["pay_amount"] = $v['pay_amount'];
}
if(isset($cp_res[$company_id][$v['relation_game_id']])){
//
$cp_res[$company_id][$v['relation_game_id']]['pay_amount'] += $v['pay_amount'];
}else{
unset($v['game_id']);
$cp_res[$company_id][$v['relation_game_id']]= $v;
}
}
foreach($cpAllSpendList as $k=>$v){
try {
$cp_all_res[$company_id]["pay_amount"] += $v['pay_amount'];
} catch (\Throwable $th) {
$cp_all_res[$company_id]["pay_amount"] = $v['pay_amount'];
}
if(isset($cp_all_res[$company_id][$v['relation_game_id']])){
//
$cp_all_res[$company_id][$v['relation_game_id']]['pay_amount'] += $v['pay_amount'];
}else{
unset($v['game_id']);
$cp_all_res[$company_id][$v['relation_game_id']]= $v;
}
}
if(empty($list)){continue;}
foreach($list as $k=>$v){
@ -1064,16 +1029,59 @@ class CompanyStatementSetController extends Controller {
// ];
// $turnover_type = D("CompanyGameRatio")->field("turnover_type")->where($turnover_where)->find()['turnover_type'];
$turnover_type = $this->getTurnoverType($v[$j],$company_id,$begintime,$endtime);
if ($turnover_type == 2) {
$res[$company_id][$v[$j]]['ratio_pay_amount'] = $all_res[$company_id][$v[$j]]['pay_amount'];
$temp += $all_res[$company_id][$v[$j]]['pay_amount'];
} elseif($turnover_type == 3){
if (empty($cp_res)) {
$cpSpendList = $Spend->alias('s')->field('sum(s.pay_amount) pay_amount,s.game_id,g.relation_game_id,g.relation_game_name game_name')->where($cpMap)->group('game_id')
->join("left join tab_game g on s.game_id = g.id")
->select();
foreach($cpSpendList as $ck=>$cv){
try {
$cp_res[$company_id]["pay_amount"] += $cv['pay_amount'];
} catch (\Throwable $th) {
$cp_res[$company_id]["pay_amount"] = $cv['pay_amount'];
}
if(isset($cp_res[$company_id][$cv['relation_game_id']])){
//
$cp_res[$company_id][$cv['relation_game_id']]['pay_amount'] += $cv['pay_amount'];
}else{
unset($cv['game_id']);
$cp_res[$company_id][$cv['relation_game_id']]= $cv;
}
}
}
$res[$company_id][$v[$j]]['ratio_pay_amount'] = $cp_res[$company_id][$v[$j]]['pay_amount'];
$temp += $cp_res[$company_id][$v[$j]]['pay_amount'];
} elseif($turnover_type == 4){
if (empty($cp_all_res)) {
$cpAllSpendList = $Spend->alias('s')->field('sum(s.pay_amount) pay_amount,s.game_id,g.relation_game_id,g.relation_game_name game_name')->where($cpAllMap)->group('game_id')
->join("left join tab_game g on s.game_id = g.id")
->select();
foreach ($cpAllSpendList as $ck => $cv) {
try {
$cp_all_res[$company_id]["pay_amount"] += $cv['pay_amount'];
} catch (\Throwable $th) {
$cp_all_res[$company_id]["pay_amount"] = $cv['pay_amount'];
}
if (isset($cp_all_res[$company_id][$cv['relation_game_id']])) {
//
$cp_all_res[$company_id][$cv['relation_game_id']]['pay_amount'] += $cv['pay_amount'];
} else {
unset($cv['game_id']);
$cp_all_res[$company_id][$cv['relation_game_id']] = $cv;
}
}
}
$res[$company_id][$v[$j]]['ratio_pay_amount'] = $cp_all_res[$company_id][$v[$j]]['pay_amount'];
$temp += $cp_all_res[$company_id][$v[$j]]['pay_amount'];
@ -1133,12 +1141,22 @@ class CompanyStatementSetController extends Controller {
}
$turnover_where = [
"company_belong"=>$company_belong['company_belong'],
"relation_game_id"=>$relation_game_id,
"company_id"=>$company_id,
"_string"=>"begin_time <={$end_time} AND ( end_time = 0 OR end_time >= {$begin_time})"
];
$turnover_type = D("CompanyGameRatio")->field("turnover_type")->where($turnover_where)->find();
if (!$turnover_type) {
$turnover_where = [
"company_belong"=>$company_belong['company_belong'],
"relation_game_id"=>$relation_game_id,
"company_id"=>0,
"_string"=>"begin_time <={$end_time} AND ( end_time = 0 OR end_time >= {$begin_time})"
];
$turnover_type = D("CompanyGameRatio")->field("turnover_type")->where($turnover_where)->find();
}
//判断特殊比例是否存在,存在直接返回结算流水类型
if (!$turnover_type) {
@ -1178,19 +1196,16 @@ class CompanyStatementSetController extends Controller {
"s.pay_status"=>1,
"s.payed_time"=>['between', [$begintime,$endtime]],
];
$cpallgame = [];
$cpgame = [];
$cpMap = $spenMap;
$cpSpendList = $Spend->alias('s')->field('sum(s.pay_amount) pay_amount,s.game_id,g.relation_game_id,g.relation_game_name game_name')->where($spenMap)->group('game_id')
->join("left join tab_game g on s.game_id = g.id")
->select();
$cpAllMap = $spenMap;
$cpAllMap["s.payed_time"] = ['elt',$endtime];
// unset($cpAllMap["s.payed_time"]);
$cpAllSpendList = $Spend->alias('s')->field('sum(s.pay_amount) pay_amount,s.game_id,g.relation_game_id,g.relation_game_name game_name')->where($cpAllMap)->group('game_id')
->join("left join tab_game g on s.game_id = g.id")
->select();
for ($i=0; $i <count($idarr); $i++) {
$company_id = $idarr[$i];
@ -1247,24 +1262,6 @@ class CompanyStatementSetController extends Controller {
}
}
$cpgame = [];
foreach($cpSpendList as $k=>$v){
if(isset($cpgame[$v['relation_game_id']])){
$cpgame[$v['relation_game_id']]['pay_amount'] += $v['pay_amount'];
}else{
$cpgame[$v['relation_game_id']]['pay_amount'] = $v['pay_amount'];
}
}
$cpallgame = [];
foreach($cpAllSpendList as $k=>$v){
if(isset($cpallgame[$v['relation_game_id']])){
$cpallgame[$v['relation_game_id']]['pay_amount'] += $v['pay_amount'];
}else{
$cpallgame[$v['relation_game_id']]['pay_amount'] = $v['pay_amount'];
}
}
//同cp同一个原包名的共享总流水分成
$game_ids = implode(",",array_keys($game));
$game_ids = $this->getModuleRatioGame($company_id,$game_ids,$begintime,$endtime);
@ -1278,8 +1275,38 @@ class CompanyStatementSetController extends Controller {
if ($turnover_type == 2) {
$temp += $allgame[$v[$j]]['pay_amount'];
} elseif($turnover_type == 3) {
if (empty($cpgame)) {
$cpSpendList = $Spend->alias('s')->field('sum(s.pay_amount) pay_amount,s.game_id,g.relation_game_id,g.relation_game_name game_name')->where($cpMap)->group('game_id')
->join("left join tab_game g on s.game_id = g.id")
->select();
foreach($cpSpendList as $ck=>$cv){
if(isset($cpgame[$cv['relation_game_id']])){
$cpgame[$cv['relation_game_id']]['pay_amount'] += $cv['pay_amount'];
}else{
$cpgame[$cv['relation_game_id']]['pay_amount'] = $cv['pay_amount'];
}
}
}
$temp += $cpgame[$v[$j]]['pay_amount'];
} elseif($turnover_type == 4) {
if (empty($cpallgame)) {
$cpAllSpendList = $Spend->alias('s')->field('sum(s.pay_amount) pay_amount,s.game_id,g.relation_game_id,g.relation_game_name game_name')->where($cpAllMap)->group('game_id')
->join("left join tab_game g on s.game_id = g.id")
->select();
foreach($cpAllSpendList as $ck=>$cv){
if(isset($cpallgame[$cv['relation_game_id']])){
$cpallgame[$cv['relation_game_id']]['pay_amount'] += $cv['pay_amount'];
}else{
$cpallgame[$cv['relation_game_id']]['pay_amount'] = $cv['pay_amount'];
}
}
}
$temp += $cpallgame[$v[$j]]['pay_amount'];
} else {
// $res[$company_id][$v[$j]]['ratio_pay_amount'] = $res[$company_id][$v[$j]]['pay_amount'];
@ -1316,8 +1343,10 @@ class CompanyStatementSetController extends Controller {
// $temp += $allgame[$v[$j]]['pay_amount'];
$res[$company_id][$p_account][$v['relation_game_id']]['all_pay_amount']= $allgame[$v['relation_game_id']]['pay_amount'];
} elseif($turnover_type == 3) {
$res[$company_id][$p_account][$v['relation_game_id']]['all_pay_amount']= $cpgame[$v['relation_game_id']]['pay_amount'];
} elseif($turnover_type == 4) {
$res[$company_id][$p_account][$v['relation_game_id']]['all_pay_amount']= $cpallgame[$v['relation_game_id']]['pay_amount'];
} else {
// $res[$company_id][$v[$j]]['ratio_pay_amount'] = $res[$company_id][$v[$j]]['pay_amount'];
@ -2044,19 +2073,27 @@ class CompanyStatementSetController extends Controller {
*/
protected function getModuleRatioGame($company_id,$relation_game_ids,$begintime,$endtime){
$company_belong = M("promote_company","tab_")->field("company_belong")->where(['id'=>$company_id])->find();
if(empty($company_belong)){
return $relation_game_ids;
}
$where = [
"company_belong"=>$company_belong['company_belong'],
"relation_game_id"=>["in",$relation_game_ids],
"company_id"=>$company_id,
"_string"=>"begin_time <={$endtime} AND ( end_time = 0 OR end_time >= {$begintime})"
];
$dbres = D("CompanyGameRatio")->field("relation_game_id")->where($where)->select();
if (!$dbres) {
$company_belong = M("promote_company","tab_")->field("company_belong")->where(['id'=>$company_id])->find();
$where = [
"company_id"=>0,
"company_belong"=>$company_belong['company_belong'],
"relation_game_id"=>["in",$relation_game_ids],
"_string"=>"begin_time <={$endtime} AND ( end_time = 0 OR end_time >= {$begintime})"
];
$dbres = D("CompanyGameRatio")->field("relation_game_id")->where($where)->select();
}
if(is_string($relation_game_ids)) $relation_game_ids = explode(",",$relation_game_ids);
if(empty($dbres)){

@ -95,6 +95,18 @@ class PromoteCompanyController extends ThinkController
}
}
if (isset($_REQUEST['time_start']) && isset($_REQUEST['time_end'])) {
$time_start = strtotime($_REQUEST['time_start']);
$time_end = strtotime($_REQUEST['time_end'])+ 86399;
$where["_string"] = "(begin_time BETWEEN {$time_start} AND {$time_end}) OR (end_time BETWEEN {$time_start} AND {$time_end}) OR (begin_time <= {$time_end} AND end_time >= {$time_end}) OR (begin_time >0 AND end_time = 0)";
} elseif (isset($_REQUEST['time_start'])) {
$time_start = strtotime($_REQUEST['time_start']);
$where["_string"] = "end_time >= {$time_start} OR end_time = 0";
} elseif (isset($_REQUEST['time_end'])) {
$time_end = strtotime($_REQUEST['time_end'])+ 86399;
$where["_string"] = "begin_time <= {$time_end}";
}
// dd($map);
@ -1319,8 +1331,28 @@ class PromoteCompanyController extends ThinkController
$CpRadio = $this->getPromoteCompanyCpRadio($game_ids);
}
// dd($CpRadio);
$endtime = time();
$rwhere = "(end_time = 0 OR end_time >= '{$endtime}') and company_id='{$company_id}' and relation_game_id in ({$game_ids})";
if (isset($_REQUEST['begintime']) && isset($_REQUEST['endtime'])) {
$time_start = strtotime($_REQUEST['begintime']);
$time_end = strtotime($_REQUEST['endtime'])+ 86399;
$rwhere["_string"] = "(begin_time BETWEEN {$time_start} AND {$time_end}) OR (end_time BETWEEN {$time_start} AND {$time_end}) OR (begin_time <= {$time_end} AND end_time >= {$time_end}) OR (begin_time >0 AND end_time = 0)";
$mwhere['_string'] = "(begin_time BETWEEN {$time_start} AND {$time_end}) OR (end_time BETWEEN {$time_start} AND {$time_end}) OR (begin_time <= {$time_end} AND end_time >= {$time_end}) OR (begin_time >0 AND end_time = 0)";
} elseif (isset($_REQUEST['begintime'])) {
$time_start = strtotime($_REQUEST['begintime']);
$rwhere["_string"] = "end_time >= {$time_start} OR end_time = 0";
$mwhere["_string"] = "end_time >= {$time_start} OR end_time = 0";
} elseif (isset($_REQUEST['time_end'])) {
$time_end = strtotime($_REQUEST['endtime'])+ 86399;
$rwhere["_string"] = "begin_time <= {$time_end}";
$mwhere["_string"] = "begin_time <= {$time_end}";
}
$company_belong = M("PromoteCompany","tab_")->field("company_belong")->where("id='{$company_id}'")->find()['company_belong'];
$rwhere['company_id'] = $company_id;
$rwhere['relation_game_id'] = ['in',$game_ids];
$rwhere['company_belong'] = $company_belong;
// dump($rwhere);
// $endtime = time();
// $rwhere = "(end_time = 0 OR end_time >= '{$endtime}') and company_id='{$company_id}' and relation_game_id in ({$game_ids})";
$cgr_res = M("CompanyGameRatio","tab_")->where($rwhere)->select();
//判断哪些游戏为空
@ -1361,9 +1393,14 @@ class PromoteCompanyController extends ThinkController
}
$diff_ids = implode(",",array_keys($game_arr));
$company_belong = M("PromoteCompany","tab_")->field("company_belong")->where("id='{$company_id}'")->find()['company_belong'];
$mwhere = "(end_time = 0 OR end_time >= '{$endtime}') and company_belong='{$company_belong}' and relation_game_id in ({$diff_ids})";
// $mwhere = "(end_time = 0 OR end_time >= '{$endtime}') and company_belong='{$company_belong}' and relation_game_id in ({$diff_ids})";
$mwhere['company_belong'] = $company_belong;
$mwhere['relation_game_id'] = ['in',$diff_ids];
$m_res = M("GameRatioMould","tab_")->where($mwhere)->select();
if(!empty($m_res)){

@ -118,11 +118,21 @@ class CompanyGameRatioModel extends Model
"company_id"=>$company_id,
"relation_game_id"=>$game_id,
"_string"=>"begin_time <={$endtime} AND ( end_time = 0 OR end_time >= {$begintime})",
"company_belong"=>$company_belong,
];
$res = $this->where($map)->order("begin_time asc")->select();
if (empty($res)) {
$map = [
"company_id"=>0,
"relation_game_id"=>$game_id,
"_string"=>"begin_time <={$endtime} AND ( end_time = 0 OR end_time >= {$begintime})",
"company_belong"=>$company_belong,
];
$res = $this->where($map)->order("begin_time asc")->select();
}
$data = [];
if(empty($res)){
$this->getGameMouldRadio($data,$game_id,$company_belong,$begintime,$endtime);

@ -293,7 +293,7 @@ $(function(){
//查看是否报错
var flag = true;
var obj = {
"company_id":["required","推广公司不能为空","select"],
// "company_id":["required","推广公司不能为空","select"],
"relation_game_id":["required","游戏不能为空","select"],
"ratio":["number","默认比例必须是大于0的数字"],
"begin_time":["date","开始时间不能为空"],

@ -116,6 +116,17 @@
</select>
</div>
<div class="input-list input-list-game search_label_rehab">
<input type="text" id="time-start" name="begintime" class="" value="{$begintime}"
placeholder="结算开始时间"/>
-
<div class="input-append date" id="datetimepicker" style="display:inline-block">
<input type="text" id="time-end" name="endtime" class="" value="{$endtime}"
placeholder="结算结束时间"/>
<span class="add-on"><i class="icon-th"></i></span>
</div>
</div>
<div class="input-list">
<a class="sch-btn" href="javascript:;" id="search" url="{:U('PromoteCompany/lists','model='.$model['name'].'&row='.I('row'),false)}">搜索</a>
@ -276,7 +287,7 @@
<if condition="$gamekey gt 0 or $rkey gt 0">
<tr>
<if condition="$rkey gt 0">
<if condition="$rkey gt 0 and $gamekey eq 0">
<td rowspan="{$ratio['row']}">{$ratio['time']|default="--"}</td>
</if>
@ -357,7 +368,7 @@
<foreach name="ratio['turnover_ratio']" item="game_ratio2" key="gamekey2">
<if condition="$gamekey2 gt 0 or $rkey gt 0">
<tr>
<if condition="$rkey gt 0">
<if condition="$rkey gt 0 and $gamekey2 eq 0">
<td rowspan="{$ratio['row']}">{$ratio['time']|default="--"}</td>
</if>
<td>{$game_ratio2['name']|default="--"}</td>
@ -460,6 +471,11 @@
<block name="script">
<script src="__STATIC__/layer/layer.js"></script>
<script src="__STATIC__/layer/extend/layer.ext.js"></script>
<link href="__STATIC__/datetimepicker/css/datetimepicker.css" rel="stylesheet" type="text/css">
<php>if(C('COLOR_STYLE')=='blue_color') echo '<link href="__STATIC__/datetimepicker/css/datetimepicker_blue.css" rel="stylesheet" type="text/css">';</php>
<link href="__STATIC__/datetimepicker/css/dropdown.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="__STATIC__/datetimepicker/js/bootstrap-datetimepicker.min.js"></script>
<script type="text/javascript" src="__STATIC__/datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js" charset="UTF-8"></script>
<style>
.layui-layer-demo .layui-layer-title {background:#F0F5F7;font-weight:bold;}
.layui-layer-demo .layui-layer-content {}
@ -481,6 +497,41 @@
//导航高亮
highlight_subnav("{:U('lists')}");
$(function(){
$('#time-start').datetimepicker({
format: 'yyyy-mm-dd',
language: "zh-CN",
showMeridian:true,
pickDate:true,
minView: 2,
autoclose: true,
pickTime:true,
todayBtn:true,
}).on('change',function(ev){
var val = new Date($.trim($(this).val())).getTime();
var end = new Date($.trim($('#time-end').val())).getTime();
if (val>end) {
layer.msg('开始时间大于结束时间!');$(this).val('');
}
return false;
});
$("#time-end").datetimepicker({
format:"yyyy-mm-dd",
language: "zh-CN",
showMeridian:true,
minView:2,
autoclose:true,
todayBtn:true,
}).on('change',function(ev){
var val = new Date($.trim($(this).val())).getTime();
var start = new Date($.trim($('#time-start').val())).getTime();
if (val<start) {
layer.msg('开始时间大于结束时间!');$(this).val('');
}
return false;
});
//搜索功能
$("#search").click(function(){
var url = $(this).attr('url');

Loading…
Cancel
Save