diff --git a/.gitignore b/.gitignore index c4023a16c..685fe3db6 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,5 @@ Runtime/ Uploads/ Application/Common/Conf/env.php +Application/Common/Conf/pay_config.php .idea/ \ No newline at end of file diff --git a/Application/Admin/Controller/UserController.class.php b/Application/Admin/Controller/UserController.class.php index 0abfb29a0..f1feb8ee7 100644 --- a/Application/Admin/Controller/UserController.class.php +++ b/Application/Admin/Controller/UserController.class.php @@ -549,6 +549,7 @@ function think_ucenter_md5($str, $key = 'ThinkUCenter'){ public function rolelist() { + $map = []; if (isset($_REQUEST['game_name'])) { $map['game_name'] = trim($_REQUEST['game_name']); unset($_REQUEST['game_name']); @@ -562,7 +563,7 @@ function think_ucenter_md5($str, $key = 'ThinkUCenter'){ unset($_REQUEST['role_name']); } empty(I('user_account')) || $map['user_account'] = ['like',"%".I('user_account')."%"]; - $list = $this->lists(M('user_play_info', 'tab_'), $map); + $list = $this->lists(M('user_play_info', 'tab_'), $map, 'play_time desc'); $this->assign('list', $list); $this->meta_title = '角色数据'; diff --git a/Application/Admin/Event/SourceEvent.class.php b/Application/Admin/Event/SourceEvent.class.php index 1a0735ac1..0e43f2823 100644 --- a/Application/Admin/Event/SourceEvent.class.php +++ b/Application/Admin/Event/SourceEvent.class.php @@ -306,7 +306,7 @@ class SourceEvent extends Controller //$ossClient->multiuploadFile($bucket, $url, $file, $options); } catch (OssException $e) { printf(__FUNCTION__ . ": initiateMultipartUpload FAILED\n"); - $this -> error($e -> getMessage() . "\n"); + $this -> error('1' . $e -> getMessage() . "\n"); return; } /* diff --git a/Application/Admin/View/User/rolelist.html b/Application/Admin/View/User/rolelist.html index 8c25ebc62..a6b8e04ab 100644 --- a/Application/Admin/View/User/rolelist.html +++ b/Application/Admin/View/User/rolelist.html @@ -108,7 +108,7 @@ {$data['role_id']} {$rolename} {$data.role_level} - {$data.play_time|date='Y-m-d H:i:s',###} + {$data.play_ip} diff --git a/Application/Home/Controller/BaseController.class.php b/Application/Home/Controller/BaseController.class.php index 64885c9c0..f19cc2181 100644 --- a/Application/Home/Controller/BaseController.class.php +++ b/Application/Home/Controller/BaseController.class.php @@ -217,4 +217,10 @@ class BaseController extends HomeController{ } return $records; } + + public function getLoginPromote() + { + $promoteId = session('promote_auth.pid'); + return M('promote', 'tab_')->where(['id' => $promoteId])->find(); + } } diff --git a/Application/Home/Controller/PromoteController.class.php b/Application/Home/Controller/PromoteController.class.php index 1ace92bfa..434e276ca 100644 --- a/Application/Home/Controller/PromoteController.class.php +++ b/Application/Home/Controller/PromoteController.class.php @@ -10,6 +10,7 @@ namespace Home\Controller; use OT\DataDictionary; +use function Sodium\add; use User\Api\PromoteApi; use User\Api\UserApi; use Org\WeixinSDK\Weixin; @@ -40,40 +41,70 @@ class PromoteController extends BaseController $this->redirect("Home/Index/index"); } - $today = $this->total(1); - $month = $this->total(3); - $total = $this->total(); - $yesterday = $this->total(5); - $lastmonth = $this->total(6); - $this->assign("today", $today); - $this->assign("month", $month); - $this->assign("total", $total); - $this->assign("lastmonth", $lastmonth); - $this->assign("yesterday", $yesterday); - - $document = D('Document'); - $row = 10; - $list = $document->listspage(56,$p,$row,'level desc,id desc'); - - $count = $document->listCount(56); - - if($count > $row){ - $page = new \Think\Page($count, $row); - $list=array_slice($spend,$page->firstRow,$page->listRows); - $page->setConfig('theme','%FIRST% %UP_PAGE% %LINK_PAGE% %DOWN_PAGE% %END% %HEADER%'); - $this->assign('_page',$page->show()); - } - - $this->assign('list',$list); - - - $url = "http://" . $_SERVER['HTTP_HOST'] . __ROOT__ . "/media.php/member/preg/pid/" . get_pid(); - $this->assign("url", $url); + $quick_menu_list = M("quick_menu qmn","tab_") + ->join("tab_promote_quick_menu as pqmn on qmn.id=pqmn.quick_menu_id and promote_id=".get_pid()) + ->field("qmn.*") + ->where("qmn.status=0") + ->order("create_time desc") + ->limit("0,10") + ->select(); + + $game_list = M("game","tab_")->field("id,game_name")->order("id desc")->select(); + $gg_list = M("document","sys_")->limit('0,5')->where("category_id=56 and status=1")->order("update_time desc")->select(); //游戏公告 + $zx_list = M("document","sys_")->limit('0,5')->where("category_id=51 and status=1")->order("update_time desc")->select(); //游戏咨询 + $xx_list = null; + + $today_start = mktime(0, 0, 0, date('m'), date('d'), date('Y')); + $today_end = mktime(0, 0, 0, date('m'), date('d') + 1, date('Y')) - 1; + $today_open_server_list = M("server as sv","tab_")->where( + array("sv.start_time"=>array("BETWEEN", array($today_start, $today_end)), + "sv.show_status"=>1)) + ->join("left join tab_game gm on gm.id=sv.game_id") + ->field('sv.*,gm.icon') + ->order("sv.start_time desc") + //->page(1, 20) + ->select(); + + + $user_count = M("user","tab_")->where("promote_id=".get_pid())->count(); + $total_money = $this->pay_total(0,0); + $today_add_user_money = $this->pay_total(1); + $month_add_user_money = $this->pay_total(3); + + $yesterday_start = mktime(0, 0, 0, date('m'), date('d') - 1, date('Y')); + $yesterday_end = mktime(0, 0, 0, date('m'), date('d'), date('Y')); + $yesterday_user_regist_count = M("user","tab_")->where( + array("promote_id"=>get_pid(), + "register_time"=>array("BETWEEN", array($yesterday_start, $yesterday_end)))) + ->count(); + $yesterday_total_money = $this->pay_total(5,0); + $yesterday_regist_user_count = M("user","tab_") + ->where(array("promote_id"=>get_pid(), + "register_time"=>array("BETWEEN", array($yesterday_start, $yesterday_end)))) + ->count(); + + $yesterday_total_money = $this->pay_total(1,0); + + $this->assign("user_count",$user_count); + $this->assign("total_money", $total_money); + $this->assign("today_add_user_money", $today_add_user_money); + $this->assign("month_add_user_money", $month_add_user_money); + $this->assign("yesterday_user_regist_count",$yesterday_user_regist_count); + $this->assign("yesterday_total_money",$yesterday_total_money); + $this->assign("yesterday_regist_user_count",$yesterday_regist_user_count); + $this->assign("yesterday_total_money",$yesterday_total_money); + + $this->assign("menu_list", $quick_menu_list); + $this->assign("gg_list", $gg_list); + $this->assign("zx_list", $zx_list); + $this->assign("xx_list", $xx_list); + $this->assign("today_open_server_list", $today_open_server_list); + $this->assign("game_list",$game_list); $this->meta_title = "首页"; $this->display(); } - private function total($type=0) + private function pay_total($type=0,$newadd=1) { if ($_REQUEST['promote_id'] === null || $_REQUEST['promote_id'] === '0') { $map['parent_id'] = get_pid(); @@ -87,9 +118,9 @@ class PromoteController extends BaseController } else { $ids = array($_REQUEST['promote_id']); } - $where['promote_id'] = array('in', $ids); - $where['pay_status'] = 1; - $where['is_check'] = array('NEQ', 2); + $where['spend.promote_id'] = array('in', $ids); + $where['spend.pay_status'] = 1; + $where['spend.is_check'] = array('NEQ', 2); switch ($type) { case 1: { // 今天 $start = mktime(0, 0, 0, date('m'), date('d'), date('Y')); @@ -126,9 +157,17 @@ class PromoteController extends BaseController ; } if (isset($start) && isset($end)) { - $where['pay_time'] = array("BETWEEN", array($start, $end)); + $where['spend.pay_time'] = array("BETWEEN", array($start, $end)); + if($newadd==1){ + $where['user.register_time'] = array("BETWEEN", array($start, $end)); + } + } + if($newadd==1){ + $total = M('spend as spend', "tab_")->field("SUM(spend.pay_amount) as amount")->join("right join tab_user user on user.id=spend.user_id")->where($where)->select(); + }else{ + $total = M('spend as spend', "tab_")->field("SUM(spend.pay_amount) as amount")->where($where)->select(); } - $total = M('spend', "tab_")->field("SUM(pay_amount) as amount")->where($where)->select(); + $total = $this->huanwei($total[0]['amount']); return $total; } @@ -153,6 +192,97 @@ class PromoteController extends BaseController } + public function home_read_data(){ + $type = I("type","0"); + $game_id = I("game_id"); + $start = mktime(0, 0, 0, date('m'), date('d'), date('Y')); + $end = mktime(0, 0, 0, date('m'), date('d') + 1, date('Y')) - 1; + if($game_id){ + $map['game_id'] = $game_id; + } + if($type>0){ + $map['sv.start_time']=array("GT", $end); + }else{ + $map['sv.start_time']=array("BETWEEN", array($start, $end)); + } + $map['sv.show_status'] = 1; + + $open_server_list = M("server as sv","tab_")->where($map) + ->join("left join tab_game gm on gm.id=sv.game_id") + ->field('sv.*,gm.icon') + ->order("sv.start_time desc") + //->page(1, 20) + ->select();; + foreach ($open_server_list as $key => $server){ + $open_server_list[$key]['icon']=get_cover($server['icon'],'path'); + if($server['pay_type']==1){ + $open_server_list[$key]['pay_type']='安卓'; + }elseif ($server['pay_type']==1){ + $open_server_list[$key]['pay_type']='iOS'; + }else{ + $open_server_list[$key]['pay_type']='安卓、iOS'; + } + $open_server_list[$key]['pay_type']; + $open_server_list[$key]['start_time'] = date('Y-m-s h:i',$server['start_time']); + } + $this->ajaxReturn(['status'=>1,'info'=>'调用成功','data'=>$open_server_list],"JSON"); + } + + + public function quick_menu_list(){ + $data_list = M("quick_menu qmn","tab_") + ->join("left join tab_promote_quick_menu as pqmn on qmn.id=pqmn.quick_menu_id and promote_id=".get_pid()) + ->field("qmn.*,pqmn.id as exist_id") + ->where("qmn.status=0") + ->order("qmn.id asc") + ->select(); + $this->assign("data_list",$data_list); + $this->meta_title = "快捷菜单"; + $this->display(); + } + + + public function quick_menu_set(){ + $menu_id = I("menu_id"); + $info = M("promote_quick_menu ","tab_") + ->where( + array("quick_menu_id"=>$menu_id, + "promote_id"=>get_pid()) + ) + ->find(); + if($info){ + M("promote_quick_menu ","tab_")->where( + array("quick_menu_id"=>$menu_id, + "promote_id"=>get_pid()) + )->delete(); + $this->ajaxReturn(['status'=>1,'info'=>'移除成功'],"JSON"); + }else{ + M("promote_quick_menu ","tab_")->add( + array("quick_menu_id"=>$menu_id, + "promote_id"=>get_pid(), + "create_time"=>time()) + ); + $this->ajaxReturn(['status'=>1,'info'=>'添加成功'],"JSON"); + } + } + + + // 消息列表 + public function msg_list($type=56){ + if($type==51){ + $data_list = M("document","sys_")->limit('0,50')->where("category_id=51 and status=1")->order("update_time desc")->select(); //游戏咨询 + }elseif ($type==50){ + $data_list = null; + }else{ + $data_list = M("document","sys_")->limit('0,50')->where("category_id=56 and status=1")->order("update_time desc")->select(); //游戏公告 + } + $this->meta_title = "公告列表"; + $this->assign("type", $type); + $this->assign("data_list", $data_list); + $this->display(); + } + + /** * 我的基本信息 */ @@ -368,7 +498,7 @@ class PromoteController extends BaseController $this->meta_title = "基本信息"; $this->assign("data", $data); - $this->wxQrcode($data); + $this->wxQrcode($data); $this->display(); } @@ -429,7 +559,7 @@ class PromoteController extends BaseController 'parentPromotes' => [], ]; } - + $parentList = $promote->field(['id', 'account'])->where(['id' => ['in', $parentIds]])->select(); $parentPromotes = []; foreach($parentList as $parent) { @@ -591,7 +721,7 @@ class PromoteController extends BaseController $this->ajaxReturn(array('status'=>-1,'msg'=>'身份证格式错误')); } } - + $res = $user->promote_add($_POST); if (is_numeric($res)) { $ba = new \Admin\Model\BusinessAffairsModel(); @@ -723,7 +853,7 @@ class PromoteController extends BaseController } $pattern = "/^([0-9A-Za-z\\-_\\.]+)@([0-9a-z]+\\.[a-z]{2,3}(\\.[a-z]{2})?)$/i"; - if ( !preg_match( $pattern, $_REQUEST['email'] ) ){ + if ( !preg_match( $pattern, $_REQUEST['email'] ) ){ $this->error('您输入的电子邮箱地址不合法', U('Promote/edit_chlid',array('id'=>$id,'type'=>I('type',0)))); }; @@ -786,7 +916,7 @@ class PromoteController extends BaseController } - /** + /** * @param int $level * @param int $size */ @@ -800,243 +930,243 @@ class PromoteController extends BaseController echo $object->png(base64_decode(base64_decode($url)), false, $errorCorrectionLevel, $matrixPointSize, 2); } - public function checkAccount($account){ - $user = get_promote_entity($account, true); - if($user){ - $this->ajaxReturn(array('status'=>1)); - }else{ - $this->ajaxReturn(array('status'=>0)); - } + public function checkAccount($account){ + $user = get_promote_entity($account, true); + if($user){ + $this->ajaxReturn(array('status'=>1)); + }else{ + $this->ajaxReturn(array('status'=>0)); } - public function balance() { - if (IS_POST) { + } + public function balance() { + if (IS_POST) { - $real_amount = $amount = I('amount'); + $real_amount = $amount = I('amount'); - if(!is_numeric($amount)){ - $res_msg = '充值金额不是数字'; - $this->show_balance(); - echo "; + if(!is_numeric($amount)){ + $res_msg = '充值金额不是数字'; + $this->show_balance(); + echo "; return false;"; - $this->redirect('balance', array('status'=>1), 3, ''); - } - if($amount<0) { - $res_msg = '充值金额不正确'; - $this->show_balance(); - echo "; + $this->redirect('balance', array('status'=>1), 3, ''); + } + if($amount<0) { + $res_msg = '充值金额不正确'; + $this->show_balance(); + echo "; return false;"; - $this->redirect('balance', array('status'=>1), 3, ''); - } - $amount = abs($amount); - // $amount = 0.01;//测试金额 - if (empty($_REQUEST['account'])) { - $user = get_promote_entity(PID); - } else { - $user = get_promote_entity($_REQUEST['account'], true); - } - - $order_no = "TB_" . date('Ymd') . date('His') . sp_random_string(4); - $create['amount'] = $amount; - $create['pay_order_number'] = $order_no; - - $vo = new \Think\Pay\PayVo(); - $vo->setBody("账户余额") - ->setFee($amount)//支付金额 - ->setTitle("余额充值") - ->setOrderNo($order_no) - ->setSignType("MD5") - ->setPayMethod("direct_tb") - ->setTable("balance") - ->setUserId($user['id']) - ->setAccount($user['account']) - ->setPromoteId(PID) - ->setPromoteName(PROMOTE_ACCOUNT) - ->setMoney($user['balance_coin']); - - switch (I('pay_type')) { - case 'swiftpass': - //判断是否开启微信充值 - if (pay_set_status('wei_xin') == 0 && pay_set_status('weixin') == 0) { - $this->error("网站未开启微信充值", '', 1); - exit(); - } - if (get_wx_type() == 0) { - $weixn = new Weixin(); - $is_pay = json_decode($weixn->weixin_pay("余额充值", $order_no, $real_amount), true); - if ($is_pay['status'] === 1) { - $json_['out_trade_no'] = $order_no; - $json_['amount'] = $amount; - $json_['pay_money'] = $real_amount; - $json_['code_img_url'] = U('qrcode', array('level' => 3, 'size' => 4, 'url' => base64_encode(base64_encode($is_pay['url'])))); - } - $create['pay_way'] = 2; - $this->add_balance($user, $create); - - $this->show_balance(); - echo ""; - } else { - $vo->setService("pay.weixin.native") - ->setPayWay(2); - $pay = new \Think\Pay('swiftpass', C('weixin')); - $all = $pay->buildRequestForm($vo); - $all['amount'] = $vo->getMoney(); - $this->show_balance(); - echo ""; - } - break; - case 'goldpig': - - if (pay_set_status('goldpig') == 0) { - $this->error("网站未开启金猪充值", '', 1); - exit(); - } - - if(empty(C('goldpig.partner'))||empty(C('goldpig.wooolid'))) { - $this->error("网站未配置金猪充值", '', 1); - exit(); - } - if($amount<1) { - $this->error("单笔金额不小于1", '', 1); - exit(); + $this->redirect('balance', array('status'=>1), 3, ''); + } + $amount = abs($amount); + // $amount = 0.01;//测试金额 + if (empty($_REQUEST['account'])) { + $user = get_promote_entity(PID); + } else { + $user = get_promote_entity($_REQUEST['account'], true); + } + + $order_no = "TB_" . date('Ymd') . date('His') . sp_random_string(4); + $create['amount'] = $amount; + $create['pay_order_number'] = $order_no; + + $vo = new \Think\Pay\PayVo(); + $vo->setBody("账户余额") + ->setFee($amount)//支付金额 + ->setTitle("余额充值") + ->setOrderNo($order_no) + ->setSignType("MD5") + ->setPayMethod("direct_tb") + ->setTable("balance") + ->setUserId($user['id']) + ->setAccount($user['account']) + ->setPromoteId(PID) + ->setPromoteName(PROMOTE_ACCOUNT) + ->setMoney($user['balance_coin']); + + switch (I('pay_type')) { + case 'swiftpass': + //判断是否开启微信充值 + if (pay_set_status('wei_xin') == 0 && pay_set_status('weixin') == 0) { + $this->error("网站未开启微信充值", '', 1); + exit(); + } + if (get_wx_type() == 0) { + $weixn = new Weixin(); + $is_pay = json_decode($weixn->weixin_pay("余额充值", $order_no, $real_amount), true); + if ($is_pay['status'] === 1) { + $json_['out_trade_no'] = $order_no; + $json_['amount'] = $amount; + $json_['pay_money'] = $real_amount; + $json_['code_img_url'] = U('qrcode', array('level' => 3, 'size' => 4, 'url' => base64_encode(base64_encode($is_pay['url'])))); } + $create['pay_way'] = 2; + $this->add_balance($user, $create); + + $this->show_balance(); + echo ""; + } else { + $vo->setService("pay.weixin.native") + ->setPayWay(2); + $pay = new \Think\Pay('swiftpass', C('weixin')); + $all = $pay->buildRequestForm($vo); + $all['amount'] = $vo->getMoney(); + $this->show_balance(); + echo ""; + } + break; + case 'goldpig': + + if (pay_set_status('goldpig') == 0) { + $this->error("网站未开启金猪充值", '', 1); + exit(); + } + + if(empty(C('goldpig.partner'))||empty(C('goldpig.wooolid'))) { + $this->error("网站未配置金猪充值", '', 1); + exit(); + } + if($amount<1) { + $this->error("单笔金额不小于1", '', 1); + exit(); + } + + $sign=think_encrypt(md5($real_amount.$order_no)); + $create['pay_way'] = 8; + + $this->add_balance($user, $create); + file_put_contents("./Application/Home/OrderNo/".$order_no.'.txt',json_encode($create)); + redirect(U('goldpig_pay',array('userid'=>$user['id'],'account' =>$user['account'],'pay_amount'=>$real_amount,'sign'=>$sign,'pay_order_number'=>$order_no))); + break; + default: + //判断是否开启支付宝充值 + if (pay_set_status('alipay') == 0) { + $this->error("网站未开启支付宝充值", '', 1); + exit(); + } + $vo->setService("create_direct_pay_by_user") + ->setPayWay(1); + $pay = new \Think\Pay('alipay', C('alipay')); + echo $pay->buildRequestForm($vo); + break; + } + + - $sign=think_encrypt(md5($real_amount.$order_no)); - $create['pay_way'] = 8; + } else { + $model = M('Promote', 'tab_'); + $data = $model->find(session("promote_auth.pid")); + $data['bank_area'] = explode(',', $data['bank_area']); + $this->assign('data',$data); + $this->meta_title = '账户余额'; + $this->display(); + } - $this->add_balance($user, $create); - file_put_contents("./Application/Home/OrderNo/".$order_no.'.txt',json_encode($create)); - redirect(U('goldpig_pay',array('userid'=>$user['id'],'account' =>$user['account'],'pay_amount'=>$real_amount,'sign'=>$sign,'pay_order_number'=>$order_no))); - break; - default: - //判断是否开启支付宝充值 - if (pay_set_status('alipay') == 0) { - $this->error("网站未开启支付宝充值", '', 1); - exit(); - } - $vo->setService("create_direct_pay_by_user") - ->setPayWay(1); - $pay = new \Think\Pay('alipay', C('alipay')); - echo $pay->buildRequestForm($vo); - break; - } + } + + public function balance_recharge() { + if (IS_POST) { + $real_amount = $amount = I('amount',0,'intval'); + //$real_amount = $amount = 0.01; - } else { - $model = M('Promote', 'tab_'); - $data = $model->find(session("promote_auth.pid")); - $data['bank_area'] = explode(',', $data['bank_area']); - $this->assign('data',$data); - $this->meta_title = '账户余额'; - $this->display(); - } + if(!is_numeric($amount)){ + + $this->ajaxReturn(['status'=>0,'info'=>'充值金额不是数字']); + + } + if($amount<0){ - } + $this->ajaxReturn(['status'=>0,'info'=>'充值金额错误']); - public function balance_recharge() { - if (IS_POST) { + } - $real_amount = $amount = I('amount',0,'intval'); + if (empty($_REQUEST['account'])) { + $user = get_promote_entity(PID); + } else { + $user = get_promote_entity($_REQUEST['account'], true); + } - //$real_amount = $amount = 0.01; + $order_no = "TB_" . date('Ymd') . date('His') . sp_random_string(4); + $create['amount'] = $amount; + $create['pay_order_number'] = $order_no; + + $vo = new \Think\Pay\PayVo(); + $vo->setBody("账户余额") + ->setFee($amount)//支付金额 + ->setTitle("余额充值") + ->setOrderNo($order_no) + ->setSignType("MD5") + ->setPayMethod("direct_tb") + ->setTable("balance") + ->setUserId($user['id']) + ->setAccount($user['account']) + ->setPromoteId(PID) + ->setPromoteName(PROMOTE_ACCOUNT) + ->setMoney($user['balance_coin']); + + switch (I('pay_type')) { + case 'swiftpass': + //判断是否开启微信充值 + if (pay_set_status('wei_xin') == 0 && pay_set_status('weixin') == 0) { + $this->ajaxReturn(['status'=>0,'info'=>'网站未开启微信充值']); + } + if (get_wx_type() == 0) { + $weixn = new Weixin(); + $is_pay = json_decode($weixn->weixin_pay("余额充值", $order_no, $real_amount), true); + if ($is_pay['status'] === 1) { + $json_['out_trade_no'] = $order_no; + $json_['amount'] = $amount; + $json_['pay_money'] = $real_amount; + $json_['code_img_url'] = U('qrcode', array('level' => 3, 'size' => 4, 'url' => base64_encode(base64_encode($is_pay['url'])))); + } + $create['pay_way'] = 2; + $this->add_balance($user, $create); - if(!is_numeric($amount)){ + $this->ajaxReturn(['status'=>1,'info'=>'','data'=>$json_]); - $this->ajaxReturn(['status'=>0,'info'=>'充值金额不是数字']); + } else { + $vo->setService("pay.weixin.native") + ->setPayWay(2); + $pay = new \Think\Pay('swiftpass', C('weixin')); + $all = $pay->buildRequestForm($vo); + $all['amount'] = $vo->getMoney(); - } - if($amount<0){ + $this->ajaxReturn(['status'=>1,'info'=>'','data'=>$all]); - $this->ajaxReturn(['status'=>0,'info'=>'充值金额错误']); + } + break; + default: + //判断是否开启支付宝充值 + if (pay_set_status('alipay') == 0) { + $this->ajaxReturn(['status'=>0,'info'=>'网站未开启支付宝充值']); + } + $vo->setService("create_direct_pay_by_user") + ->setPayWay(1); + $pay = new \Think\Pay('alipay', C('alipay')); + $url = $pay->buildRequestForm($vo); + $this->ajaxReturn(['status'=>1,'info'=>'','url'=>$url]); + } - } - if (empty($_REQUEST['account'])) { - $user = get_promote_entity(PID); - } else { - $user = get_promote_entity($_REQUEST['account'], true); - } - - $order_no = "TB_" . date('Ymd') . date('His') . sp_random_string(4); - $create['amount'] = $amount; - $create['pay_order_number'] = $order_no; - - $vo = new \Think\Pay\PayVo(); - $vo->setBody("账户余额") - ->setFee($amount)//支付金额 - ->setTitle("余额充值") - ->setOrderNo($order_no) - ->setSignType("MD5") - ->setPayMethod("direct_tb") - ->setTable("balance") - ->setUserId($user['id']) - ->setAccount($user['account']) - ->setPromoteId(PID) - ->setPromoteName(PROMOTE_ACCOUNT) - ->setMoney($user['balance_coin']); - - switch (I('pay_type')) { - case 'swiftpass': - //判断是否开启微信充值 - if (pay_set_status('wei_xin') == 0 && pay_set_status('weixin') == 0) { - $this->ajaxReturn(['status'=>0,'info'=>'网站未开启微信充值']); - } - if (get_wx_type() == 0) { - $weixn = new Weixin(); - $is_pay = json_decode($weixn->weixin_pay("余额充值", $order_no, $real_amount), true); - if ($is_pay['status'] === 1) { - $json_['out_trade_no'] = $order_no; - $json_['amount'] = $amount; - $json_['pay_money'] = $real_amount; - $json_['code_img_url'] = U('qrcode', array('level' => 3, 'size' => 4, 'url' => base64_encode(base64_encode($is_pay['url'])))); - } - $create['pay_way'] = 2; - $this->add_balance($user, $create); - - $this->ajaxReturn(['status'=>1,'info'=>'','data'=>$json_]); - - } else { - $vo->setService("pay.weixin.native") - ->setPayWay(2); - $pay = new \Think\Pay('swiftpass', C('weixin')); - $all = $pay->buildRequestForm($vo); - $all['amount'] = $vo->getMoney(); - - $this->ajaxReturn(['status'=>1,'info'=>'','data'=>$all]); - - } - break; - default: - //判断是否开启支付宝充值 - if (pay_set_status('alipay') == 0) { - $this->ajaxReturn(['status'=>0,'info'=>'网站未开启支付宝充值']); - } - $vo->setService("create_direct_pay_by_user") - ->setPayWay(1); - $pay = new \Think\Pay('alipay', C('alipay')); - $url = $pay->buildRequestForm($vo); - $this->ajaxReturn(['status'=>1,'info'=>'','url'=>$url]); - } - - - - } else { - $this->ajaxReturn(['status'=>0,'info'=>'请求有误']); - } - - } - - - /** + + } else { + $this->ajaxReturn(['status'=>0,'info'=>'请求有误']); + } + + } + + + /** * 金猪支付 * @return [type] [description] * @author cb <[email address]> */ public function goldpig_pay(){ - if(IS_POST){ -SafeFilter($_POST); + if(IS_POST){ + SafeFilter($_POST); $msign=think_encrypt(md5($_POST['amount'].$_POST['pay_order_number'])); if($msign!==$_POST['sign']){ $this->error('验证失败',U('promote/balance'));exit; @@ -1044,24 +1174,24 @@ SafeFilter($_POST); if($_POST['amount']<=0){ $this->error('金额有误'); } - $url="./Application/Home/OrderNo/".$_POST['pay_order_number'].'.txt'; + $url="./Application/Home/OrderNo/".$_POST['pay_order_number'].'.txt'; if(!file_exists($url) ){ - $this->error('操作有误',U('promote/balance'));exit; + $this->error('操作有误',U('promote/balance'));exit; } - $user = M('Promote','tab_')->field('id,account')->where(['account'=>$_POST['UserName']])->find(); + $user = M('Promote','tab_')->field('id,account')->where(['account'=>$_POST['UserName']])->find(); if (empty($user)) { - $this->error("账号不存在"); - exit(); + $this->error("账号不存在"); + exit(); } - $baseurl = 'http://api.357p.com/?'; + $baseurl = 'http://api.357p.com/?'; - $url = $baseurl . "UserName={$_POST['UserName']}&Price={$_POST['amount']}&shouji={$_POST['shouji']}&PayID={$_POST['PayID']}&userid={$_POST['userid']}&wooolID={$_POST['wooolID']}&jinzhua={$_POST['pay_order_number']}&jinzhub={$_POST['jinzhub']}&jinzhuc={$_POST['jinzhuc']}&jinzhue={$_POST['pay_order_number']}"; + $url = $baseurl . "UserName={$_POST['UserName']}&Price={$_POST['amount']}&shouji={$_POST['shouji']}&PayID={$_POST['PayID']}&userid={$_POST['userid']}&wooolID={$_POST['wooolID']}&jinzhua={$_POST['pay_order_number']}&jinzhub={$_POST['jinzhub']}&jinzhuc={$_POST['jinzhuc']}&jinzhue={$_POST['pay_order_number']}"; - redirect($url);exit; + redirect($url);exit; }else{ $this->display(); @@ -1071,16 +1201,16 @@ SafeFilter($_POST); } - public function show_balance() { - $model = M('Promote', 'tab_'); - $data = $model->find(session("promote_auth.pid")); - $data['bank_area'] = explode(',', $data['bank_area']); - $this->assign('data',$data); - $this->meta_title = '账户余额'; - $this->display('balance'); - } + public function show_balance() { + $model = M('Promote', 'tab_'); + $data = $model->find(session("promote_auth.pid")); + $data['bank_area'] = explode(',', $data['bank_area']); + $this->assign('data',$data); + $this->meta_title = '账户余额'; + $this->display('balance'); + } - public function checkOrder($order_number){ + public function checkOrder($order_number){ $map['pay_order_number'] = $order_number; $data = M('Balance','tab_') ->where($map) @@ -1094,7 +1224,7 @@ SafeFilter($_POST); } - public function add_balance($promote,$data){ + public function add_balance($promote,$data){ $balance = M("Balance","tab_"); $balance_data['order_number'] = ""; $balance_data['pay_order_number'] = $data['pay_order_number']; @@ -1113,234 +1243,234 @@ SafeFilter($_POST); } - public function wxQrcode($promote='') { - if (C('wechat.status')>0) { - $appid = C('wechat.appid'); - $appsecret = C('wechat.appsecret'); - $token = session("token"); - if($token){ - $auth = new WechatAuth($appid, $appsecret, $token); - } else { - $auth = new WechatAuth($appid, $appsecret); - $token = $auth->getAccessToken(); + public function wxQrcode($promote='') { + if (C('wechat.status')>0) { + $appid = C('wechat.appid'); + $appsecret = C('wechat.appsecret'); + $token = session("token"); + if($token){ + $auth = new WechatAuth($appid, $appsecret, $token); + } else { + $auth = new WechatAuth($appid, $appsecret); + $token = $auth->getAccessToken(); - session(array('expire' => $token['expires_in'])); - session("token", $token['access_token']); - } - if (empty($promote)) { - $promote = D('promote')->detail(); - } - - $sign = $promote['weixin_openid_sign']?$promote['weixin_openid_sign']:rand(1,99999); - - $ticket = $auth->qrcodeCreate($sign,604800); - - $this->assign('wxQrcodeUrl',$ticket['url']); - - } else { - $this->assign('wxQrcodeUrl',null); - } - } - - public function wxQrcodeRedirect() { - - $xml_str = $GLOBALS['HTTP_RAW_POST_DATA']; - - $this->logger($xml_str); - - if(!empty($xml_str)){ - libxml_disable_entity_loader(true); - - $request_xml = simplexml_load_string($xml_str, 'SimpleXMLElement', LIBXML_NOCDATA); - - switch ($request_xml->MsgType){ - case 'event': - $this->_setOpenid($request_xml); - break; - } - } else { - die(''); - } - - } - - - public function _setOpenid($data,$type) { - $event = strtolower($data->Event); - $openid = $data->FromUserName; // 用户 - $auth = new WechatAuth(C('wechat.appid'), C('wechat.appsecret')); - $model = D('Promote'); - $promote = $model->detail(); - $data = array('id'=>$promote['id']); - $user = $auth->userInfo($openid); - switch($event) { - case 'subscribe':{ - // 关注事件 - if (!empty($promote['weixin_openid'])) { - $auth->setText($openid,date('Y-m-d H:i:s').' 请先解绑微信');exit; - } - if (str_replace('qrscene_', '', $data['EventKey']) != $promote['weixin_openid_sign']) { - $auth->setText($openid,date('Y-m-d H:i:s').' 页面错误,请刷新页面重试');exit; - } - $data['weixin_account']=emoji_encode($user['nickname']); - $data['weixin_openid']=$openid; - $res = $model->update($data); - if ($res) { - $auth->sendText($openid,date('Y-m-d H:i:s').' 微信绑定成功'); - } else { - $auth->sendText($openid,date('Y-m-d H:i:s').' 微信绑定失败'); - } - };break; - case 'scan':{ - // 关注以后 - if ($user['subscribe'] != 1) {$auth->setText($openid,date('Y-m-d H:i:s').' 你未关注微信');exit;} - if (empty($promote['weixin_openid'])) { - $auth->setText($openid,date('Y-m-d H:i:s').' 请先绑定微信');exit; - } - - - };break; - case 'unsubscribe':{ - // 取消关注 - if ($promote['weixin_openid'] != $openid) { - $auth->setText($openid,date('Y-m-d H:i:s').' 对不起,你没有权限');exit; - } - if (str_replace('qrscene_', '', $data['EventKey']) != $promote['weixin_openid_sign']) { - $auth->setText($openid,date('Y-m-d H:i:s').' 页面错误,请刷新页面重试');exit; - } - if (empty($promote['weixin_openid'])) { - $auth->setText($openid,date('Y-m-d H:i:s').' 暂未绑定微信');exit; - } - $data['weixin_account']=''; - $data['weixin_openid']=''; - $res = $model->update($data); - if ($res) { - $auth->sendText($openid,date('Y-m-d H:i:s').' 微信解绑成功'); - } else { - $auth->sendText($openid,date('Y-m-d H:i:s').' 微信解绑失败'); - } - - };break; - } - } - - - public function logger($log_content) { - $fg_str="\n============================================================\n"; - $max_size = 500000; - $log_filename = __ROOT__."/Uploads/Logs/log".date('Ymd').".xml"; - if(file_exists($log_filename) and (abs(filesize($log_filename)) > $max_size)){ - unlink($log_filename); + session(array('expire' => $token['expires_in'])); + session("token", $token['access_token']); + } + if (empty($promote)) { + $promote = D('promote')->detail(); } - if(is_array($log_content)){ - file_put_contents($log_filename, date('Y-m-d H:i:s')."\n".json_encode($log_content).$fg_str, FILE_APPEND); - }else{ - file_put_contents($log_filename, date('Y-m-d H:i:s')."\n".$log_content.$fg_str, FILE_APPEND); + $sign = $promote['weixin_openid_sign']?$promote['weixin_openid_sign']:rand(1,99999); - } + $ticket = $auth->qrcodeCreate($sign,604800); + $this->assign('wxQrcodeUrl',$ticket['url']); + + } else { + $this->assign('wxQrcodeUrl',null); } + } - public function promoteList($p=1){ + public function wxQrcodeRedirect() { - switch ($_GET['type']) { - case '': - case 1: - $this->promoteLists($p); - break; - default: - $this->siteApplyList($p); + $xml_str = $GLOBALS['HTTP_RAW_POST_DATA']; + + $this->logger($xml_str); + + if(!empty($xml_str)){ + libxml_disable_entity_loader(true); + + $request_xml = simplexml_load_string($xml_str, 'SimpleXMLElement', LIBXML_NOCDATA); + + switch ($request_xml->MsgType){ + case 'event': + $this->_setOpenid($request_xml); break; } + } else { + die(''); } -// 推广员列表 - const model_name = 'Promote'; - public function promoteLists($p){ - $map = []; - $map['_string'] = 'id='. session('promote_auth.pid') - . ' or parent_id=' . session('promote_auth.pid') - . ' or grand_id=' . session('promote_auth.pid'); + } - $selectMap = $map; - if(isset($_REQUEST['promote_id'])){ - $promoteid = $_REQUEST['promote_id']; - unset($_REQUEST['promote_id']); - if(isset($_REQUEST['parent_id'])) { + public function _setOpenid($data,$type) { + $event = strtolower($data->Event); + $openid = $data->FromUserName; // 用户 + $auth = new WechatAuth(C('wechat.appid'), C('wechat.appsecret')); + $model = D('Promote'); + $promote = $model->detail(); + $data = array('id'=>$promote['id']); + $user = $auth->userInfo($openid); + switch($event) { + case 'subscribe':{ + // 关注事件 + if (!empty($promote['weixin_openid'])) { + $auth->setText($openid,date('Y-m-d H:i:s').' 请先解绑微信');exit; + } + if (str_replace('qrscene_', '', $data['EventKey']) != $promote['weixin_openid_sign']) { + $auth->setText($openid,date('Y-m-d H:i:s').' 页面错误,请刷新页面重试');exit; + } + $data['weixin_account']=emoji_encode($user['nickname']); + $data['weixin_openid']=$openid; + $res = $model->update($data); + if ($res) { + $auth->sendText($openid,date('Y-m-d H:i:s').' 微信绑定成功'); + } else { + $auth->sendText($openid,date('Y-m-d H:i:s').' 微信绑定失败'); + } + };break; + case 'scan':{ + // 关注以后 + if ($user['subscribe'] != 1) {$auth->setText($openid,date('Y-m-d H:i:s').' 你未关注微信');exit;} + if (empty($promote['weixin_openid'])) { + $auth->setText($openid,date('Y-m-d H:i:s').' 请先绑定微信');exit; + } - $parent_id = $_REQUEST['parent_id']; - unset($_REQUEST['parent_id']); - if($promoteid == $parent_id) { - $map['id'] = $promoteid; - } else { - $maps['parent_id'] = $parent_id; - $maps['grand_id'] = $parent_id; - $maps['_logic'] = 'or'; - $pro = M('promote','tab_')->field('id,account')->where([array('id'=>$promoteid),$maps])->select(); - if (!empty($pro_ids)){ - $map['id'] = array('eq',-1); - } + };break; + case 'unsubscribe':{ + // 取消关注 + if ($promote['weixin_openid'] != $openid) { + $auth->setText($openid,date('Y-m-d H:i:s').' 对不起,你没有权限');exit; + } + if (str_replace('qrscene_', '', $data['EventKey']) != $promote['weixin_openid_sign']) { + $auth->setText($openid,date('Y-m-d H:i:s').' 页面错误,请刷新页面重试');exit; + } + if (empty($promote['weixin_openid'])) { + $auth->setText($openid,date('Y-m-d H:i:s').' 暂未绑定微信');exit; + } + $data['weixin_account']=''; + $data['weixin_openid']=''; + $res = $model->update($data); + if ($res) { + $auth->sendText($openid,date('Y-m-d H:i:s').' 微信解绑成功'); + } else { + $auth->sendText($openid,date('Y-m-d H:i:s').' 微信解绑失败'); + } - } + };break; + } + } - } else { + + public function logger($log_content) { + $fg_str="\n============================================================\n"; + $max_size = 500000; + $log_filename = __ROOT__."/Uploads/Logs/log".date('Ymd').".xml"; + if(file_exists($log_filename) and (abs(filesize($log_filename)) > $max_size)){ + unlink($log_filename); + } + if(is_array($log_content)){ + file_put_contents($log_filename, date('Y-m-d H:i:s')."\n".json_encode($log_content).$fg_str, FILE_APPEND); + + }else{ + file_put_contents($log_filename, date('Y-m-d H:i:s')."\n".$log_content.$fg_str, FILE_APPEND); + + } + + } + + public function promoteList($p=1){ + + switch ($_GET['type']) { + case '': + case 1: + $this->promoteLists($p); + break; + default: + $this->siteApplyList($p); + break; + } + } + +// 推广员列表 + const model_name = 'Promote'; + public function promoteLists($p){ + $map = []; + $map['_string'] = 'id='. session('promote_auth.pid') + . ' or parent_id=' . session('promote_auth.pid') + . ' or grand_id=' . session('promote_auth.pid'); + + $selectMap = $map; + + if(isset($_REQUEST['promote_id'])){ + $promoteid = $_REQUEST['promote_id']; + unset($_REQUEST['promote_id']); + if(isset($_REQUEST['parent_id'])) { + + $parent_id = $_REQUEST['parent_id']; + unset($_REQUEST['parent_id']); + if($promoteid == $parent_id) { $map['id'] = $promoteid; - /* $maps['parent_id'] = $promoteid; - $maps['grand_id'] = $promoteid; + } else { + $maps['parent_id'] = $parent_id; + $maps['grand_id'] = $parent_id; $maps['_logic'] = 'or'; - $pro = M('promote','tab_')->field('id,account')->where($maps)->select(); - $pro_ids = array_column($pro,'id'); - $pro_ids[] = $promoteid; - if (!empty($pro_ids)){ - $map['id'] = ['in',$pro_ids]; - }else{ - $map['id'] = array('eq',-1); - } */ + $pro = M('promote','tab_')->field('id,account')->where([array('id'=>$promoteid),$maps])->select(); + + if (!empty($pro_ids)){ + $map['id'] = array('eq',-1); + } } + } else { - if (isset($_REQUEST['parent_id'])) { - if ($_REQUEST['parent_id']=='全部') { - unset($_REQUEST['parent_id']); - } - $zid=get_zi_promote_id($_REQUEST['parent_id']); - if($zid){ - $zid=$zid.','.$_REQUEST['parent_id']; - }else{ - $zid=$_REQUEST['parent_id']; - } - $map['id']=array('in',$zid); + $map['id'] = $promoteid; + /* $maps['parent_id'] = $promoteid; + $maps['grand_id'] = $promoteid; + $maps['_logic'] = 'or'; + $pro = M('promote','tab_')->field('id,account')->where($maps)->select(); + $pro_ids = array_column($pro,'id'); + $pro_ids[] = $promoteid; + if (!empty($pro_ids)){ + $map['id'] = ['in',$pro_ids]; + }else{ + $map['id'] = array('eq',-1); + } */ + + } + } else { + if (isset($_REQUEST['parent_id'])) { + if ($_REQUEST['parent_id']=='全部') { unset($_REQUEST['parent_id']); } - } - if(isset($_REQUEST['admin_id'])){ - if($_REQUEST['admin_id']=="全部"){ - unset($_REQUEST['admin']); + $zid=get_zi_promote_id($_REQUEST['parent_id']); + if($zid){ + $zid=$zid.','.$_REQUEST['parent_id']; }else{ - $map['ba_id']=$_REQUEST['admin_id']; + $zid=$_REQUEST['parent_id']; } + $map['id']=array('in',$zid); + unset($_REQUEST['parent_id']); } - - if(I('promote_level') == 1){ - $map['parent_id'] = 0; - }elseif(I('promote_level') == 2){ - $map['parent_id'] = ['neq',0]; - $map['grand_id'] = 0; - }elseif (I('promote_level') == 3) { - $map['parent_id'] = ['neq',0]; - $map['grand_id'] = ['neq',0]; + } + if(isset($_REQUEST['admin_id'])){ + if($_REQUEST['admin_id']=="全部"){ + unset($_REQUEST['admin']); + }else{ + $map['ba_id']=$_REQUEST['admin_id']; } + } - $model = new PromoteModel(); - $promotes = $model->field(['id', 'account'])->where($selectMap)->select(); - - $this->assign('promotes', $promotes); - self::order_lists(self::model_name, $p, $map); + if(I('promote_level') == 1){ + $map['parent_id'] = 0; + }elseif(I('promote_level') == 2){ + $map['parent_id'] = ['neq',0]; + $map['grand_id'] = 0; + }elseif (I('promote_level') == 3) { + $map['parent_id'] = ['neq',0]; + $map['grand_id'] = ['neq',0]; } + $model = new PromoteModel(); + $promotes = $model->field(['id', 'account'])->where($selectMap)->select(); + + $this->assign('promotes', $promotes); + self::order_lists(self::model_name, $p, $map); + } + /** * [数组分页,二维数组字段排序] * @param [type] $model [description] @@ -1384,7 +1514,7 @@ SafeFilter($_POST); $fields[] = $array[0]; } } - + $fields[] = 'grand_id'; // 过滤重复字段信息 @@ -1561,7 +1691,7 @@ SafeFilter($_POST); } if (15==strlen($id)) { $regx = "/^(\d{6})+(\d{2})+(\d{2})+(\d{2})+(\d{3})$/"; - + @preg_match($regx, $id, $arr_split); //检查生日日期是否正确 $dtm_birth = "19".$arr_split[2] . '/' . $arr_split[3]. '/' .$arr_split[4]; diff --git a/Application/Home/Controller/QueryController.class.php b/Application/Home/Controller/QueryController.class.php index b1a2e29e3..38c7c8003 100644 --- a/Application/Home/Controller/QueryController.class.php +++ b/Application/Home/Controller/QueryController.class.php @@ -1158,23 +1158,268 @@ class QueryController extends BaseController $this->display('view_role'); } - public function userPlayers($p = 0) + public function users() { + $promote = $this->getLoginPromote(); + $promoteId = $promote['id']; + $map = [ + '_logic' => 'or', + 'id' => $promoteId, + 'parent_id' => $promoteId, + 'grand_id' => $promoteId, + ]; + $ids = M('promote', 'tab_')->where($map)->getField('id', true); + + $promotes = []; + $groupPromotes = []; + if ($promote['parent_id'] == 0) { + $groupPromotes = M('promote', 'tab_')->field(['id', 'account', 'real_name'])->where(['parent_id' => $promoteId])->select(); + $promotes = M('promote', 'tab_')->field(['id', 'account', 'real_name'])->where(['grand_id' => $promoteId])->select(); + } + if ($promote['parent_id'] > 0 && $promote['grand_id'] == 0) { + $promotes = M('promote', 'tab_')->field(['id', 'account', 'real_name'])->where(['parent_id' => $promoteId])->select(); + } + + $fields = [ + 'id', 'account', 'promote_account', 'promote_id', 'device_number', 'register_time', 'register_ip', 'login_time', 'login_ip', 'device_type' + ]; + $query = M('user', 'tab_')->field($fields)->where(['promote_id' => ['in', $ids]]); + list($records, $pagination, $count) = $this->paginate($query); + $this->assign('promotes', $promotes); + $this->assign('groupPromotes', $groupPromotes); + $this->assign('records', $records); + $this->assign('pagination', $pagination); + $this->assign('count', $count); + $this->display(); + } + + public function userRoles() + { + $gameId = I('game_id', 0); + $serverId = I('server_id', 0); + $isSelf = I('is_self', 0); + $roleName = I('role_name', ''); + $userAccount = I('user_account', ''); + $promoteId = I('promote_id', 0); + $sdkVersion = I('sdk_version', 0); + $roleLevelBegin = intval(I('role_level_begin', 0)); + $roleLevelEnd = intval(I('role_level_end', 0)); + $headmanPromoteId = I('headman_promote_id', 0); + $playTime = I('play_time', ''); + + $promote = $this->getLoginPromote(); + $map = [ + '_logic' => 'or', + 'id' => $promote['id'], + 'parent_id' => $promote['id'], + 'grand_id' => $promote['id'], + ]; + $ids = M('promote', 'tab_')->where($map)->getField('id', true); + + $promotes = $this->getGroupPromotes($promote); + $groupPromotes = $this->getGroupPromotes($promote); + $map = []; - if (isset($_REQUEST['game_name'])) { - $map['game_name'] = trim($_REQUEST['game_name']); - unset($_REQUEST['game_name']); + $map = ['promote_id' => ['in', $ids]]; + + if ($gameId != 0) { + $map['game_id'] = $gameId; } - if (isset($_REQUEST['server_id'])) { - $map['server_id'] = trim($_REQUEST['server_id']); - unset($_REQUEST['server_id']); + if ($serverId != 0) { + $map['serverId'] = $serverId; + } + if ($roleName != '') { + $map['role_name'] = ['like', '%' . $roleName . '%']; + } + if ($userAccount != '') { + $map['user_acount'] = ['like', '%' . $userAccount . '%']; + } + if ($sdkVersion != 0) { + $map['sdk_version'] = $sdkVersion; + } + if ($roleLevelBegin != 0 && $roleLevelEnd == 0) { + $map['role_level'] = ['egt', $roleLevelBegin]; + } elseif ($roleLevelEnd != 0 && $roleLevelBegin == 0) { + $map['role_level'] = ['elt', $roleLevelEnd]; + } elseif ($roleLevelEnd != 0 && $roleLevelBegin != 0) { + $map['role_level'] = ['between', [$roleLevelBegin, $roleLevelEnd]]; + } + if ($playTime != '') { + $playTimeRow = explode(' 至 ', $playTime); + $playTimeBegin = 0; + $playTimeEnd = 0; + if (count($playTimeRow) == 2) { + $playTimeBegin = strtotime($playTimeRow[0] . ' 00:00:00'); + $playTimeEnd = strtotime($playTimeRow[1] . ' 23:59:59'); + } else { + $playTimeBegin = strtotime($playTimeRow[0] . ' 00:00:00'); + $playTimeEnd = strtotime($playTimeRow[0] . ' 23:59:59'); + } + $map['play_time'] = ['between', [$playTimeBegin, $playTimeEnd]]; + } + if ($isSelf) { + $map['promote_id'] = $promote['id']; + } else { + if ($headmanPromoteId != 0) { + $map['promote_id'] = $headmanPromoteId; + } elseif ($promoteId != 0) { + $map['promote_id'] = $promoteId; + } + } + $query = M('user_play_info', 'tab_')->where($map); + list($records, $pagination, $count) = $this->paginate($query); + + $games = $this->getGamesByPromote($promote); + + $this->assign('games', $games); + $this->assign('records', $records); + $this->assign('pagination', $pagination); + $this->assign('count', $count); + $this->display('userRoles'); + } + + public function userRecharges() + { + $gameId = I('game_id', 0); + $serverId = I('server_id', 0); + $isSelf = I('is_self', 0); + $roleName = I('role_name', ''); + $userAccount = I('user_account', ''); + $promoteId = I('promote_id', 0); + $sdkVersion = I('sdk_version', 0); + $headmanPromoteId = I('headman_promote_id', 0); + + $promote = $this->getLoginPromote(); + $map = [ + '_logic' => 'or', + 'id' => $promote['id'], + 'parent_id' => $promote['id'], + 'grand_id' => $promote['id'], + ]; + $ids = M('promote', 'tab_')->where($map)->getField('id', true); + + $promotes = $this->getGroupPromotes($promote); + $groupPromotes = $this->getGroupPromotes($promote); + + $map = $spendMap = ['promote_id' => ['in' => $ids]]; + if ($gameId != 0) { + $map['game_id'] = $gameId; + } + if ($serverId != 0) { + $map['serverId'] = $serverId; } - if (isset($_REQUEST['role_name'])) { - $map['role_name'] = trim($_REQUEST['role_name']); - unset($_REQUEST['role_name']); + if ($roleName != '') { + $map['role_name'] = ['like', '%' . $roleName . '%']; } - $map['promote_id'] = session("promote_auth.pid"); - $this->data_lists($p, 'UserPlayInfo', ['map' => $map]); + if ($userAccount != '') { + $map['user_acount'] = ['like', '%' . $userAccount . '%']; + } + if ($sdkVersion != 0) { + $map['sdk_version'] = $sdkVersion; + } + if ($isSelf) { + $map['promote_id'] = $promote['id']; + $spendMap['promote_id'] = $promote['id']; + } else { + if ($headmanPromoteId != 0) { + $map['promote_id'] = $headmanPromoteId; + $spendMap['promote_id'] = $headmanPromoteId; + } elseif ($promoteId != 0) { + $map['promote_id'] = $promoteId; + $spendMap['promote_id'] = $promoteId; + } + } + $query = M('user_play_info', 'tab_')->where($map); + list($roles, $pagination, $count) = $this->paginate($query); + $roleIds = array_column($roles, 'role_id'); + + $spendMap['pay_status'] = 1; + $spendMap['pay_game_status'] = 1; + if (count($roleIds) > 0) { + $spendMap['game_player_id'] = ['in', $roleIds]; + } else { + $spendMap['_string'] = '1<>1'; + } + $allRecharges = M('spend', 'tab_')->field('count(*) count, sum(cost) cost, game_player_id')->where($gameMap)->group('game_player_id')->select(); + $allRecords = []; + foreach ($allRecharges as $recharge) { + $allRecords[$recharge['game_player_id']] = $recharge; + } + + $map['pay_time'] = ['between', [strtotime(date('Y-m-d 00:00:00')), strtotime(date('Y-m-d 23:59:59'))]]; + $todayRecharges = M('spend', 'tab_')->field('sum(cost) cost, game_player_id')->where($map)->group('game_player_id')->select(); + $todayRecords = []; + foreach ($todayRecharges as $recharge) { + $todayRecords[$recharge['game_player_id']] = $recharge; + } + + $records = []; + foreach ($roles as $role) { + $records[] = [ + 'user_account' => $role['user_account'], + 'game_name' => $role['game_name'], + 'role_name' => $role['role_name'], + 'role_id' => $role['role_id'], + 'role_level' => $role['role_level'], + 'server_id' => $role['server_id'], + 'server_name' => $role['server_name'], + 'recharge_cost' => isset($allRecords[$role['role_id']]) ? round(floatval($allRecords[$role['role_id']]['cost']), 2) : 0, + 'recharge_count' => isset($allRecords[$role['role_id']]) ? $allRecords[$role['role_id']]['count'] : 0, + 'recharge_cost_today' =>isset($todayRecords[$role['role_id']]) ? round(floatval($todayRecords[$role['role_id']]['cost']), 2) : 0, + 'play_time' => $role['play_time'], + 'play_ip' => $role['play_ip'], + 'promote_id' => $role['promote_id'], + 'promote_account' => $role['promote_account'], + 'sdk_version' => $role['sdk_version'], + 'unlogin_day' => intval((strtotime(date('Y-m-d 00:00:00')) - strtotime(date('Y-m-d 00:00:00', $role['play_time']))) / (24*3600) ) + ]; + } + + $games = $this->getGamesByPromote($promote); + + $this->assign('games', $games); + $this->assign('promotes', $promotes); + $this->assign('groupPromotes', $groupPromotes); + $this->assign('records', $records); + $this->assign('pagination', $pagination); + $this->assign('count', $count); + $this->display('userRecharges'); + } + + private function getGamesByPromote($promote) + { + return M('apply', 'tab_')->field(['game_id', 'game_name'])->where(['promote_id' => $promote['id']])->select(); + } + + private function getGroupPromotes($promote) + { + $promotes = []; + if ($promote['parent_id'] == 0) { + $promotes = M('promote', 'tab_')->field(['id', 'account', 'real_name'])->where(['parent_id' => $promote['id']])->select(); + } + return $promotes; + } + + private function getNormalPromotes($promote) + { + $promotes = []; + if ($promote['parent_id'] > 0 && $promote['grand_id'] == 0) { + $promotes = M('promote', 'tab_')->field(['id', 'account', 'real_name'])->where(['parent_id' => $promote['id']])->select(); + } elseif ($promote['parent_id'] == 0) { + $promotes = M('promote', 'tab_')->field(['id', 'account', 'real_name'])->where(['grand_id' => $promote['id']])->select(); + } + return $promotes; + } + + public function getGameServers() + { + $gameId = I('game_id', 0); + $servers = M('server', 'tab_')->field(['id', 'server_name'])->where(['game_id' => $gameId])->select(); + $this->ajaxReturn([ + 'status' => 1, + 'msg' => '成功', + 'data' => ['servers' => $servers] + ]); } /** diff --git a/Application/Home/Event/UserEvent.class.php b/Application/Home/Event/UserEvent.class.php index a0cb2da75..3bb224364 100644 --- a/Application/Home/Event/UserEvent.class.php +++ b/Application/Home/Event/UserEvent.class.php @@ -930,7 +930,7 @@ class UserEvent extends BaseEvent { - public function arpu_analysis_data() { + public function arpu_analysis_data() { if ($_REQUEST['time_start'] && $_REQUEST['time_end']) { $request = $_REQUEST; $game_id = $request['game_id']; diff --git a/Application/Home/View/default/Promote/index.html b/Application/Home/View/default/Promote/index.html index a7908ae1d..28e850a6d 100644 --- a/Application/Home/View/default/Promote/index.html +++ b/Application/Home/View/default/Promote/index.html @@ -1,44 +1,204 @@ - + -
-
    -
  • 今日充值

    ¥{$today}
  • -
  • 昨日充值

    ¥{$yesterday}
  • -
  • 本月充值

    ¥{$month}
  • -
  • 上月充值

    ¥{$lastmonth}
  • -
  • 总计充值

    ¥{$total}
  • -
+
+
    +
  • 推广总用户

    {$user_count}
  • +
  • 推广总充值

    ¥{$total_money}
  • +
  • 当日新增用户充值

    ¥{$today_add_user_money}
  • +
  • 当月新增用户充值

    ¥{$month_add_user_money}
  • +
+
    +
  • 昨日注册用户

    {$yesterday_user_regist_count}
  • +
  • 昨日充值金额

    ¥{$yesterday_total_money}
  • +
  • 今日注册用户

    {$yesterday_regist_user_count}
  • +
  • 今日充值金额

    ¥{$yesterday_total_money}
  • +
+
+
+
    +
  • +
    +
    快捷菜单自定义>
    +
    + + 暂无数据 + + + +
    +
    +
  • +
  • +
    +
    公告 消息 游戏活动查看更多>
    +
    + + 暂无公告 + + +

    + {$gg.title} + {$gg.update_time|date="Y/m/d",###} +

    +
    +
    +
    +
    + + 暂无消息 + + +

    + {$xx.title} + {$xx.update_time|date="Y/m/d",###} +

    +
    +
    +
    +
    + + 暂无活动信息 + + +

    + {$zx.title} + {$zx.update_time|date="Y/m/d",###} +

    +
    +
    +
    +
    +
  • +
+
+
+
开服信息
+
+ +
+ + + + + + + + + + + + + + + + + + + + + +
游戏ICON游戏名称平台开服时间服务器信息

暂无数据

{$data.game_name}安卓、iOS安卓iOS{$data.start_time|date="m-d H:i",###}{$data.server_name}
+
+
+ {$_page} +
-
-
新闻公告
-
- -
{$_page}
-
-
- + + + + } + \ No newline at end of file diff --git a/Application/Home/View/default/Promote/msg_list.html b/Application/Home/View/default/Promote/msg_list.html new file mode 100644 index 000000000..99636880f --- /dev/null +++ b/Application/Home/View/default/Promote/msg_list.html @@ -0,0 +1,36 @@ + + + + + + + + + + \ No newline at end of file diff --git a/Application/Home/View/default/Promote/quick_menu_list.html b/Application/Home/View/default/Promote/quick_menu_list.html new file mode 100644 index 000000000..097cf441b --- /dev/null +++ b/Application/Home/View/default/Promote/quick_menu_list.html @@ -0,0 +1,68 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Application/Home/View/default/Public/promote_base.html b/Application/Home/View/default/Public/promote_base.html index a83a5da5b..42e2049da 100644 --- a/Application/Home/View/default/Public/promote_base.html +++ b/Application/Home/View/default/Public/promote_base.html @@ -54,7 +54,8 @@ 注册明细 ARPU统计 留存统计 - 角色查询 + 角色查询 + 充值玩家
diff --git a/Application/Home/View/default/Query/userPlayers.html b/Application/Home/View/default/Query/userPlayers.html deleted file mode 100644 index 6d7a35184..000000000 --- a/Application/Home/View/default/Query/userPlayers.html +++ /dev/null @@ -1,162 +0,0 @@ - - - - - -
-
-
-
当前位置:数据中心>角色查询
-
- - 角色查询 -
-
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - -
玩家帐号推广账号游戏名称平台游戏区服角色名等级创建时间

暂无数据

{$vo.user_account}{$vo.promote_account}{$vo.game_name}{:getSDKTypeName($vo['sdk_version'])}{$vo.server_name}{$vo.role_name}{$vo.role_level}{$vo.play_time|date='Y-m-d H:i:s',###}
- -
-
- 导出 - {$_page} -
-
-
-
- -
-
-
-
- - - - \ No newline at end of file diff --git a/Application/Home/View/default/Query/userRecharges.html b/Application/Home/View/default/Query/userRecharges.html new file mode 100644 index 000000000..58eda9e60 --- /dev/null +++ b/Application/Home/View/default/Query/userRecharges.html @@ -0,0 +1,229 @@ + + + + + + +
+
+
+
当前位置:数据中心>玩家充值
+
+ + 玩家充值 +
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
玩家账号游戏名称平台游戏区服角色名等级充值总额充值次数今日充值未登录天数最后登录时间组长|推广员

暂无数据

{$record.user_account}{$record.game_name}{:getSDKTypeName($record['sdk_version'])}{$record.server_name}{$record.role_name}{$record.role_level}{$record.recharge_cost}{$record.recharge_count}{$record.recharge_cost_today}{$record.unlogin_day}{$record.play_time|date='Y-m-d H:i:s',###}{$record.promote_account}
+ +
+
+ 导出 + {$_page} +
+
+
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/Application/Home/View/default/Query/userRoles.html b/Application/Home/View/default/Query/userRoles.html new file mode 100644 index 000000000..9561484d7 --- /dev/null +++ b/Application/Home/View/default/Query/userRoles.html @@ -0,0 +1,157 @@ + + + + + + +
+
+
+
当前位置:数据中心>角色查询
+
+ + 角色查询 +
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
玩家帐号推广账号游戏名称平台游戏区服角色名等级创建时间

暂无数据

{$record.user_account}{$record.promote_account}{$record.game_name}{:getSDKTypeName($record['sdk_version'])}{$record.server_name}{$record.role_name}{$record.role_level}{$record.play_time|date='Y-m-d H:i:s',###}
+ +
+
+ 导出 + {$_page} +
+
+
+
+ +
+
+
+
+ + + + + + + \ No newline at end of file diff --git a/Application/Home/View/default/Query/users.html b/Application/Home/View/default/Query/users.html new file mode 100644 index 000000000..301e1a8a0 --- /dev/null +++ b/Application/Home/View/default/Query/users.html @@ -0,0 +1,121 @@ + + + + + +
+
+
+
当前位置:数据中心>注册明细
+
+ + 注册明细 +
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
玩家帐号推广账号设备IMIE/IDFA设备类型注册时间注册IP最近登录时间最近登陆IP操作

暂无数据

{$record.account}{$record.promote_account}{$record.device_number}{$record.register_time|date='Y-m-d H:i:s',###}{$record.register_ip}{$record.login_time|date='Y-m-d H:i:s',###}{$record.login_ip}查看角色
+ +
+
+ 导出 + {$_page} +
+
+
+
+ +
+
+
+
+ + + + + + + \ No newline at end of file diff --git a/Application/Mobile/Controller/SsgController.class.php b/Application/Mobile/Controller/SsgController.class.php index e6ff15a4c..07c49507c 100644 --- a/Application/Mobile/Controller/SsgController.class.php +++ b/Application/Mobile/Controller/SsgController.class.php @@ -21,9 +21,9 @@ class SsgController extends BaseController { public function login(){ $user = session("user_auth"); - if ($user) { + /*if ($user) { redirect(U("ssg/index")); - } + }*/ $this->display(); } @@ -146,6 +146,11 @@ class SsgController extends BaseController { $this->display(); } + public function clear(){ + \Think\Log::record('缓存清理业务触发'); + session(null); + } + public function timediffs($begin_time, $end_time) { if ($begin_time < $end_time) { $starttime = $begin_time; diff --git a/Application/Mobile/View/Ssg/index.html b/Application/Mobile/View/Ssg/index.html index 890599afd..88d83addd 100644 --- a/Application/Mobile/View/Ssg/index.html +++ b/Application/Mobile/View/Ssg/index.html @@ -108,6 +108,21 @@
- + + \ No newline at end of file diff --git a/Application/Sdk/Common/function.php b/Application/Sdk/Common/function.php index f1931af0f..dcc79890e 100644 --- a/Application/Sdk/Common/function.php +++ b/Application/Sdk/Common/function.php @@ -12,7 +12,7 @@ * @param sting $idcard 身份证号码 * @author 鹿文学 */ -function is_adult($idcard) { +function is_adult($idcard, $adult=16) { $id = substr($idcard,6,8); $year = substr($id,0,4); @@ -21,7 +21,7 @@ function is_adult($idcard) { $old = (time()-strtotime($year.'-'.$month.'-'.$day))/31536000; - if(intval($old)>=16) { + if(intval($old)>=$adult) { return true; } else { return false; @@ -29,6 +29,33 @@ function is_adult($idcard) { } +/* 支付验证 当前只有未成年 + * return: array code 1成功 0失败 msg :错误消息 + */ + +function pay_check($user_id) { + $ret = array( + 'code' => 1, + 'msg' => '', + ); + $idcard = M("user", "tab_")->where(array('id' => $user_id))->getField("idcard"); + if (!$idcard) { + $ret['code'] = 1; + $ret['msg'] = '身份证不存在'; + return $ret; + } + if (is_adult($idcard, 18)) { + $ret['code'] = 1; + $ret['msg'] = ''; + return $ret; + } else { + $ret['code'] = 0; + $ret['msg'] = '未成年,不能充值!'; + return $ret; + } + +} + /* //获取支付方式 */ function get_pay_way($id=null) { diff --git a/Application/Sdk/Controller/AppleController.class.php b/Application/Sdk/Controller/AppleController.class.php index 833eedc9f..3455d74fc 100644 --- a/Application/Sdk/Controller/AppleController.class.php +++ b/Application/Sdk/Controller/AppleController.class.php @@ -12,47 +12,7 @@ use Qiniu\json_decode; class AppleController extends BaseController{ - /** - * 'MerNo' => $data['merno'], - 'Amount'=>$data['amount'], - 'BillNo'=>$data['order_no'], - 'TranCode'=>"SMZF012", - 'PayType'=> "SMZF", - 'PaymentType'=> $data['paymenttype'],//"UNION","ZFBZF", - 'MerRemark' => 'MerRemark', - 'subject' => $data['subject'], - 'NotifyURL' => $data['notifyurl'], - 'ReturnURL' => $data['returnurl'], - 'mchAppId' => $data['mchAppId'], - 'mchAppName' => $data['mchAppName'], - 'deviceInfo' => $data['deviceInfo'], - 'clientIp' => $data['clientIp'], - */ - public function test() { - $sqpay=new Sqpay(); - $returl = C('pay_header'). "/sdk.php/Spend/pay_success/orderno/".$request['pay_order_number'].'/game_id/'.$request['game_id']; - $data['secret'] = C("sqpay.key"); - $data['merno'] = C("sqpay.partner"); - $data['amount'] = 0.01; - $data['order_no'] = '111111'; - $data['paymenttype'] = "ZFBZF"; - $data['MerRemark'] = "mark"; - $data['subject'] = "subject"; - $data['notifyurl'] = C('pay_header')."/callback.php/Notify/sq_callback";//通知 - $data['returnurl'] = $returl; - $data['mchAppId'] = "wmtxkj.com"; - $data['mchAppName'] = "mchAppName"; - $data['deviceInfo'] = "AND_WAP"; - $data['clientIp'] = get_client_ip(); - - $ret = $sqpay->sq_pay($data); - $ret = json_decode($ret, true); - pp($ret); - $json_data['url']=$ret[0]['payHtml']; - echo ($json_data['url']); - exit(); - - } + /** *ios移动支付 */ @@ -70,6 +30,11 @@ class AppleController extends BaseController{ if(!is_array(find_uc_account($request['account']))){ $this->set_message(0,"fail","Uc用户暂不支持"); } + } + // 支付验证 是否让支付 + $payCheck = pay_check($request['user_id']); + if (!$payCheck['code']) { + $this->set_message(1088, "fail", $payCheck['msg']); } $extend_data = M('spend','tab_')->where(array('extend'=>$request['extend'],'game_id'=>$request['game_id'],'pay_status'=>1))->find(); if($extend_data){ @@ -126,9 +91,18 @@ class AppleController extends BaseController{ $file=file_get_contents("./Application/Sdk/OrderNo/".$user_id."-".$game_id.".txt"); $request = json_decode(think_decrypt($file),true); C(api('Config/lists')); + + if (empty($request)) { echo json_encode(['code'=>0,'msg'=>'登录数据不能为空']);exit; } + + // 支付验证 是否让支付 + $payCheck = pay_check($request['user_id']); + if (!$payCheck['code']) { + echo json_encode(['code'=>0,'msg'=> $payCheck['msg']]);exit; + } + $game = M('Game','tab_')->where(['id'=>$request['game_id']])->field('pay_status')->find(); if($game['pay_status'] == 0){ echo json_encode(['code'=>0,'msg'=>'该游戏暂时无法充值,请联系客服!']);exit; @@ -152,7 +126,10 @@ class AppleController extends BaseController{ $request['payway'] = 1; $request['title']=$request['price']; $request['body']=$request['price']; + $request['callback'] = 'http://'.$_SERVER['HTTP_HOST']. "/sdk.php/Spend/pay_success/orderno/".$request['pay_order_number'].'/game_id/'.$request['game_id']; + $request['notifyurl'] = 'http://'.$_SERVER['HTTP_HOST']. "/callback.php/Notify/notify/apitype/alipay/method/notify"; $pay_url=$this->pay($request); + //echo $pay_url['url'];die; //redirect($pay_url['url']); echo json_encode(['code'=>200,'msg'=>'','data'=>['url'=>$pay_url['url'],'wap'=>1]]);exit; } else {/* app */ @@ -339,6 +316,8 @@ class AppleController extends BaseController{ ->setGameName(get_game_name($param['game_id'])) ->setGameAppid($param['game_appid']) ->setServerId(0) + ->setCallback($param['callback']) + ->setNotifyUrl($param['notifyurl']) ->setGameplayerName($param['game_player_name']) ->setServerName($param['server_name']) ->setUserId($param['user_id']) @@ -366,10 +345,23 @@ class AppleController extends BaseController{ { $file=file_get_contents("./Application/Sdk/OrderNo/".$user_id."-".$game_id.".txt"); $request = json_decode(think_decrypt($file),true); + /*$request['user_id'] = 1; + $request['game_id'] = 1; + $request['price'] = 0.01; + $request['extend'] = 21111177; + $request['pay_order_number'] = 21111177; + + $request['code'] =1; + */ if (empty($request)) { // $this->set_message(0, "fail", "登录数据不能为空"); redirect(U('Spend/notice',array('user_id'=>$user_id,'game_id'=>$game_id,'msg'=>'登录数据不能为空')));exit; } + // 支付验证 是否让支付 + $payCheck = pay_check($request['user_id']); + if (!$payCheck['code']) { + redirect(U('Spend/notice',array('user_id'=>$user_id,'game_id'=>$game_id,'msg'=> $payCheck['msg'])));exit; + } C(api('Config/lists')); $game = M('Game','tab_')->where(['id'=>$request['game_id']])->field('pay_status')->find(); if($game['pay_status'] == 0){ @@ -400,6 +392,7 @@ class AppleController extends BaseController{ if (get_wx_pay_type() == 0) { $weixn = new Weixin(); $is_pay = json_decode($weixn->weixin_pay("充值", $request['pay_order_number'], $pay_amount, 'MWEB'), true); + if($is_pay['status']==1){ if($request['code']==1){ $this->add_spend($request,1); @@ -550,6 +543,11 @@ class AppleController extends BaseController{ if (empty($request)) { redirect(U('Spend/notice',array('user_id'=>$user_id,'game_id'=>$game_id,'msg'=>'登录数据不能为空')));exit; } + // 支付验证 是否让支付 + $payCheck = pay_check($request['user_id']); + if (!$payCheck['code']) { + redirect(U('Spend/notice',array('user_id'=>$user_id,'game_id'=>$game_id,'msg'=>$payCheck['msg'])));exit; + } $game = M('Game','tab_')->where(['id'=>$request['game_id']])->field('pay_status')->find(); if($game['pay_status'] == 0){ redirect(U('Spend/notice',array('user_id'=>$user_id,'game_id'=>$game_id,'msg'=>'该游戏暂时无法充值,请联系客服!')));exit; @@ -628,6 +626,11 @@ class AppleController extends BaseController{ if (empty($request)) { redirect(U('Spend/notice',array('user_id'=>$user_id,'game_id'=>$game_id,'msg'=>'参数错误')));exit; } + // 支付验证 是否让支付 + $payCheck = pay_check($request['user_id']); + if (!$payCheck['code']) { + redirect(U('Spend/notice',array('user_id'=>$user_id,'game_id'=>$game_id,'msg'=> $payCheck['msg'])));exit; + } C(api('Config/lists')); $user_info = get_user_entity($request['user_id']); if($user_info['lock_status'] == 0 || $user_info['check_status'] == 0){ diff --git a/Application/Sdk/Controller/BaseController.class.php b/Application/Sdk/Controller/BaseController.class.php index f55299eed..3f583b8f1 100644 --- a/Application/Sdk/Controller/BaseController.class.php +++ b/Application/Sdk/Controller/BaseController.class.php @@ -378,6 +378,7 @@ class BaseController extends RestController{ $data_spned['selle_ratio'] = get_game_selle_ratio($param["game_id"]); $data_spned['server_id'] = $param["server_id"]; $data_spned['server_name'] = $param["server_name"]; + $data_spned['game_player_id'] = $param["game_player_id"]; $data_spned['game_player_name'] = $param["game_player_name"]; $data_spned['promote_id'] = $user_entity["promote_id"]; $data_spned['promote_account'] = $user_entity["promote_account"]; diff --git a/Application/Sdk/Controller/UserController.class.php b/Application/Sdk/Controller/UserController.class.php index ebbfaa7d2..11fb5d98c 100644 --- a/Application/Sdk/Controller/UserController.class.php +++ b/Application/Sdk/Controller/UserController.class.php @@ -10,6 +10,7 @@ use Com\WechatAuth; use App\Model\UserModel; use App\Model\PointShopRecordModel; use Qiniu\json_decode; +use Think\Log; class UserController extends BaseController { @@ -836,7 +837,7 @@ class UserController extends BaseController $request = json_decode(base64_decode(file_get_contents("php://input")), true); $user = get_user_entity($request['user_id']); if($user['lock_status'] == 0 || $user['check_status'] == 0){ - $this->set_message(0,"fail","账号被禁用,无法充值,请联系客服!"); + $this->set_message(0,"fail","账号被禁用,无法充值,请联系客服!2"); } $game = M('Game','tab_')->where(['id'=>$request['game_id']])->field('pay_status')->find(); if($game['pay_status'] == 0){ @@ -1186,20 +1187,15 @@ class UserController extends BaseController $data["sdk_version"] = $request["sdk_version"]; $data['play_ip'] = get_client_ip(); $data['pipuid'] = $user_data['puid']; - if ($res['id']>0) { - $user_play -> save($data); + Log::write('save_user_play_info:' . date('Y-m-d H:i:s') . ' ---- ' . json_encode($data), 'INFO'); + if ($res['id']>0) { + $user_play->save($data); $this->updateLoginRecord($data); - } else { - - - $user_play -> add($data); - + $user_play->add($data); $this->updateLoginRecord($data); - - } $this -> set_message(200, "success", "成功"); @@ -1215,7 +1211,6 @@ class UserController extends BaseController * */ private function updateLoginRecord($userPlay) { -//var_dump($userPlay);die; $map = array( 'game_id' => $userPlay['game_id'], 'user_id' => $userPlay['user_id'], @@ -1235,8 +1230,7 @@ class UserController extends BaseController 'id'=>$userLoginRecordData['id'] ); - $userLoginRecordModel->save($data); - + return $userLoginRecordModel->save($data); } @@ -1981,7 +1975,7 @@ class UserController extends BaseController $cardd = M('User', 'tab_') -> where(array('idcard' => $data['idcard'])) -> find(); if ($cardd) { - $this -> set_message(1087, "fail", "身份证号码已被使用!"); + // $this -> set_message(1087, "fail", "身份证号码已被使用!"); // 去掉身份证唯一验证 } @@ -1990,9 +1984,9 @@ class UserController extends BaseController if (C('tool_age.status') == 0) { if (is_adult($data['idcard'])) { - $data['age_status'] = 2; + $data['age_status'] = 2; // 成年 } else { - $data['age_status'] = 3; + $data['age_status'] = 3; // 未成年 } } else { diff --git a/Application/Sdk/Controller/WapPayController.class.php b/Application/Sdk/Controller/WapPayController.class.php index 129e83a58..e1591e516 100644 --- a/Application/Sdk/Controller/WapPayController.class.php +++ b/Application/Sdk/Controller/WapPayController.class.php @@ -12,6 +12,7 @@ use Org\SqpaySDK\Sqpay; use Qiniu\json_decode; use Think\Log; class WapPayController extends BaseController{ + private function pay($param=array()){ $table = $param['code'] == 1 ? "spend" : "deposit"; $user = get_user_entity($param['user_id']); @@ -91,19 +92,23 @@ class WapPayController extends BaseController{ */ public function alipay_pay(){ $request = json_decode(base64_decode(file_get_contents("php://input")),true); - + // 支付验证 是否让支付 + $payCheck = pay_check($request['user_id']); + if (!$payCheck['code']) { + $this->set_message(1088, "fail", $payCheck['msg']); + } file_put_contents(dirname(__FILE__) . '/alipay_paywap.txt',json_encode($request)); C(api('Config/lists')); if (empty($request)) { $this->set_message(1001, "fail", "登录数据不能为空"); } $game = M('Game','tab_')->where(['id'=>$request['game_id']])->field('pay_status')->find(); - if($game['pay_status'] == 0){die('a'); + if($game['pay_status'] == 0){ $this->set_message(0,"fail","该游戏暂时无法充值,请联系客服!"); } if($request['code'] == 1){ $extend_data = M('spend','tab_')->where(array('extend'=>$request['extend'],'pay_status'=>1,'game_id'=>$request['game_id']))->find(); - if($extend_data){die('a'); + if($extend_data){ $this->set_message(1089,"fail","订单号重复,请关闭支付页面重新支付"); } } @@ -256,6 +261,12 @@ Log::write(serialize($request), Log::DEBUG); $this->error("参数有误", '', true); } + // 支付验证 是否让支付 + $payCheck = pay_check($param['user_id']); + if (!$payCheck['code']) { + $this->set_message(1088, "fail", $payCheck['msg']); + } + $payInfo = M('pay_info', 'tab_')->where(array( 'user_id' => $param['user_id'], 'game_id' => $param['game_id'] @@ -460,6 +471,11 @@ Log::write(serialize($request), Log::DEBUG); $request = json_decode(base64_decode(file_get_contents("php://input")), true); file_put_contents("./Application/Sdk/OrderNo/".$request['user_id']."-".$request['game_id'].".txt",think_encrypt(json_encode($request))); + // 支付验证 是否让支付 + $payCheck = pay_check($request['user_id']); + if (!$payCheck['code']) { + $this->set_message(1088, "fail", $payCheck['msg']); + } $user_id = $request['user_id']; $game_id = $request['game_id']; $data = array( @@ -483,16 +499,22 @@ Log::write(serialize($request), Log::DEBUG); $file=file_get_contents("./Application/Sdk/OrderNo/".$user_id."-".$game_id.".txt"); $request = json_decode(think_decrypt($file),true); Log::write(serialize($request), Log::DEBUG); - $request['user_id'] = 232; + /* $request['user_id'] = 232; $request['game_id'] = 78; $request['price'] = 0.02; $request['code'] = 1; $request['extend'] = "SP_522992339581"; - $request['pay_order_number'] = "SP_24522992339581"; + $request['pay_order_number'] = "SP_24522992339581"; */ if (empty($request)) { redirect(U('Spend/notice',array('user_id'=>$user_id,'game_id'=>$game_id,'msg'=>'登录数据不能为空')));exit; } + // 支付验证 是否让支付 + $payCheck = pay_check($request['user_id']); + if (!$payCheck['code']) { + $this->set_message(1088, "fail", $payCheck['msg']); + } + $game = M('Game','tab_')->where(['id'=>$request['game_id']])->field('pay_status')->find(); if($game['pay_status'] == 0){ redirect(U('Spend/notice',array('user_id'=>$user_id,'game_id'=>$game_id,'msg'=>'该游戏暂时无法充值,请联系客服!')));exit; @@ -541,11 +563,11 @@ Log::write(serialize($request), Log::DEBUG); 'status' => 'normal', 'create_time' => time(), )); - /* if($request['code']==1){ + if($request['code']==1){ $this->add_spend($request,1); }else{ $this->add_deposit($request); - } */ + } } $this->assign("pay_amount", $request['actual_amount']); @@ -566,6 +588,11 @@ Log::write(serialize($request), Log::DEBUG); if (empty($request)) { $this->set_message(1001, "fail", "登录数据不能为空"); } + // 支付验证 是否让支付 + $payCheck = pay_check($request['user_id']); + if (!$payCheck['code']) { + $this->set_message(1088, "fail", $payCheck['msg']); + } C(api('Config/lists')); if($request['price']*1<=0){ $this->set_message(1011,"fail","充值金额有误"); @@ -817,6 +844,12 @@ Log::write(serialize($request), Log::DEBUG); if (empty($request)) { $this->set_message(1001, "fail", "登录数据不能为空"); } + // 支付验证 是否让支付 + $payCheck = pay_check($request['user_id']); + if (!$payCheck['code']) { + $this->set_message(1088, "fail", $payCheck['msg']); + } + C(api('Config/lists')); if($request['price']<0){ $this->set_message(1011,"fail","充值金额有误"); @@ -860,6 +893,12 @@ Log::write(serialize($request), Log::DEBUG); $request['extend'] = "11212452299229"; $request['pay_order_number'] = "11212452299229"; */ + // 支付验证 是否让支付 + $payCheck = pay_check($request['user_id']); + if (!$payCheck['code']) { + $this->set_message(1088, "fail", $payCheck['msg']); + } + if (empty($request)) { $this->set_message(1001, "fail","登录数据不能为空"); } diff --git a/Data/update.sql b/Data/update.sql new file mode 100644 index 000000000..fd9690007 --- /dev/null +++ b/Data/update.sql @@ -0,0 +1,60 @@ + +-- 推广员后台首页快捷菜单 ZCL + +DROP TABLE IF EXISTS `tab_quick_menu`; +CREATE TABLE `tab_quick_menu` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '文档ID', + `name` varchar(50) NOT NULL DEFAULT '' COMMENT '菜单名称', + `url` varchar(255) NOT NULL DEFAULT '' COMMENT '链接地址', + `icon` varchar(50) DEFAULT '0' COMMENT '菜单ICON', + `status` tinyint(1) NOT NULL DEFAULT '0' COMMENT '状态', + PRIMARY KEY (`id`), + KEY `status` (`status`) +) ENGINE=MyISAM AUTO_INCREMENT=17 DEFAULT CHARSET=utf8; + +-- ---------------------------- +-- Records of tab_quick_menu +-- ---------------------------- +INSERT INTO `tab_quick_menu` VALUES ('1', '账户信息', '/index.php?s=/Home/Promote/base_info.html', '11', '0'); +INSERT INTO `tab_quick_menu` VALUES ('2', '组长管理', '/index.php?s=/Home/Promote/mychlid.html', '12', '0'); +INSERT INTO `tab_quick_menu` VALUES ('3', '推广员管理', '/index.php?s=/Home/Promote/mygrand.html', '0', '0'); +INSERT INTO `tab_quick_menu` VALUES ('4', '数据汇总', '/index.php?s=/Home/Query/summary.html', '0', '0'); +INSERT INTO `tab_quick_menu` VALUES ('5', '充值明细', '/index.php?s=/Home/Query/recharge.html', '0', '0'); +INSERT INTO `tab_quick_menu` VALUES ('6', '注册明细', '/index.php?s=/Home/Query/register.html', '0', '0'); +INSERT INTO `tab_quick_menu` VALUES ('7', 'ARPU统计', '/index.php?s=/Home/Query/arpu_analysis.html', '0', '0'); +INSERT INTO `tab_quick_menu` VALUES ('8', '留存统计', '/index.php?s=/Home/Query/retention_analysis.html', '0', '0'); +INSERT INTO `tab_quick_menu` VALUES ('9', '角色查询', '/index.php?s=/Home/Query/userPlayers.html', '0', '0'); +INSERT INTO `tab_quick_menu` VALUES ('10', '专服管理', '/index.php?s=/Home/Apply/index.html', '0', '0'); +INSERT INTO `tab_quick_menu` VALUES ('11', '扶持申请', '/index.php?s=/Home/Support/index.html', '0', '0'); +INSERT INTO `tab_quick_menu` VALUES ('12', '扶持记录', '/index.php?s=/Home/Support/lists.html', '0', '0'); +INSERT INTO `tab_quick_menu` VALUES ('13', '扶持额度', '/index.php?s=/Home/Support/quota.html', '0', '0'); +INSERT INTO `tab_quick_menu` VALUES ('14', '我的平台币', '/index.php?s=/Home/PromoteCoin/myCoin.html', '0', '0'); +INSERT INTO `tab_quick_menu` VALUES ('15', '平台币转移', '/index.php?s=/Home/PromoteCoin/record.html', '0', '0'); +INSERT INTO `tab_quick_menu` VALUES ('16', '平台币充值', '/index.php?s=/Home/CoinOrder/order_list.html', '0', '0'); + +-- 推广员后台首页快捷菜单关联表 ZCL + +DROP TABLE IF EXISTS `tab_promote_quick_menu`; +CREATE TABLE `tab_promote_quick_menu` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `promote_id` int(11) DEFAULT NULL COMMENT '推广员ID', + `quick_menu_id` int(11) DEFAULT NULL COMMENT '快捷菜单ID', + `create_time` int(11) DEFAULT NULL COMMENT '创建时间', + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=19 DEFAULT CHARSET=latin1; + +-- ---------------------------- +-- Records of tab_promote_quick_menu +-- ---------------------------- +INSERT INTO `tab_promote_quick_menu` VALUES ('4', '1', '3', '1569719823'); +INSERT INTO `tab_promote_quick_menu` VALUES ('6', '1', '5', '1569719828'); +INSERT INTO `tab_promote_quick_menu` VALUES ('7', '1', '6', '1569719830'); +INSERT INTO `tab_promote_quick_menu` VALUES ('8', '1', '7', '1569719832'); +INSERT INTO `tab_promote_quick_menu` VALUES ('9', '1', '14', '1569719835'); +INSERT INTO `tab_promote_quick_menu` VALUES ('10', '1', '15', '1569719839'); +INSERT INTO `tab_promote_quick_menu` VALUES ('11', '1', '12', '1569719849'); +INSERT INTO `tab_promote_quick_menu` VALUES ('12', '1', '13', '1569719852'); +INSERT INTO `tab_promote_quick_menu` VALUES ('14', '1', '8', '1569719866'); +INSERT INTO `tab_promote_quick_menu` VALUES ('15', '1', '9', '1569719870'); +INSERT INTO `tab_promote_quick_menu` VALUES ('16', '1', '10', '1569719877'); +INSERT INTO `tab_promote_quick_menu` VALUES ('18', '1', '1', '1569720739'); diff --git a/Public/Home/css/index/index.new.css b/Public/Home/css/index/index.new.css new file mode 100644 index 000000000..c6dcaccd1 --- /dev/null +++ b/Public/Home/css/index/index.new.css @@ -0,0 +1,132 @@ +/* index */ +.promote-index-overview ul{width: 100%;float:left;} +.promote-index-overview li {background:#FFF;border-radius:3px;float:left;width:23.33%;height:120px;position: relative;border: 1px solid #E3E8EC;} +.promote-index-overview li~li{margin-left:2%;} +.promote-index-overview .index-user {text-align:center;} +.promote-index-overview .index-user img {border-radius:100%;width:66px;height:66px;padding-top:12px;} +.promote-index-overview .index-user p {margin:8px 0 0;} + +.promote-index-overview .icon {width:40px;height:40px;position:absolute;top:50%;margin-top:-34px;left: 22%;} +.promote-index-overview .icon img{width: 100%;height: 100%;} +.promote-index-overview .text {font-size:16px;color:#555;/* text-align:center; */padding-top:33px;padding-left: 140px;} +.promote-index-overview .text p {margin-bottom:6px;color: #6A7082;} +.promote-index-overview .text span {font-size:18px;color: #99B1CB;} + +.promote-index-list{background: #fff;margin-top: 2.4vh;border-radius: 3px;padding: 10px;height: auto;position: relative;border: 1px solid #E3E8EC;} +.promote-index-list .trunk-title-main{font-size: 16px;color: #6A7082;font-weight: 600;height: 40px;border-bottom: 1px solid #ddd;} +.promote-index-list .trunk-title-main span{vertical-align: middle;} +.promote-index-list .trunk-content{padding-top: 1%;} +.promote-index-list .trunk-content ul{min-height: 44vh;} +.promote-index-list .trunk-content ul li{border-top: 1px solid #F3F5F9;padding: 1vh;} +.promote-index-list .trunk-content ul li:nth-child(2n-1){background: #FAFAFC;} + +.index-tab-list ul{width: 100%;position: relative;column-count:1;margin-top: 20px;} +.index-tab-list li {background:#FFF;border-radius:3px;width:48.8%;height:350px;position: relative;border: 1px solid #E3E8EC;display: inline-block;vertical-align: middle} +.index-tab-list li:last-child{margin-left:1.7%;} + +.trunk-content article {margin-top:0!important;} +.trunk-content{margin-top: 0!important;} +.qcl-box{font-size: 14px;} +.qcl-box-hand{height: 45px;line-height: 35px;margin: 10px;border-bottom: 1px solid #ddd} +.qcl-tit{font-size: 16px;color: #6A7082;font-weight: 600} +.qcl-bnt{text-align: center;margin-top: -10px} +.qcl-bnt ul{width: 100%;float:left;} +.qcl-bnt li {background:#FFF;border-radius:3px;float:left;width:17%;height:115px;position: relative;border: 0;margin-bottom: 20px} +.qcl-bnt li{margin-left:2%;} +.qcl-bnt li span{display: block;} +.qcl-bnt li span:first-child{height: 80px;width: 80px;margin: auto} +.qcl-bnt li span:first-child img{height: 80px;width: 80px} +.qcl-bnt li span:last-child{height: 30px;line-height: 30px} + +.more{display: block;float: right;padding-top: 10px;font-size: 14px;color: #4A90F0} +.more:hover{color:#26C7DB} +.fxui-tab {font-size: 14px;} +.fxui-tab-hand{height: 45px;line-height: 35px;margin: 10px;border-bottom: 1px solid #ddd} +.fxui-tab-tit {display: block;float: left;font-size: 14px;height: 28px;line-height: 28px;padding: 2px 20px ;cursor: pointer;border: 1px solid #ddd} +.fxui-tab-tit:first-child{border-bottom-left-radius:3px;border-top-left-radius: 3px} +.fxui-tab-tit:last-child{border-bottom-right-radius:3px;border-top-right-radius: 3px} +.fxui-tab-hand .curr {background: #26C7DB;color: #fff;border: 1px solid #26C7DB} +.fxui-tab-nav {padding: 15px;height: 280px;margin-top: -10px} +.fxui-tab-nav p{height: 50px;line-height: 50px;border-bottom: 1px solid #ddd} +.fxui-tab-nav p span:first-child{width: 80%;overflow: hidden;white-space: nowrap;text-overflow: ellipsis;display: inline-block} +.fxui-tab-nav p span:last-child{float: right;width: 15%;display: inline-block} + + +/*.article-type{vertical-align: middle;padding-right: 10px;} +.article-title{width: 400px;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;display: inline-block;vertical-align: middle;color: #515974;font-size: 13px;} +.article-title:hover{color: #26c7db;} +.article-time{vertical-align: middle;font-size: 13px;color: #a5a6bb;}*/ +.page-overview{width: 100%;} + +@media screen and (max-width: 1440px) { + .promote-index-overview .icon {left: 12%;} + .promote-index-overview li{width:23.33%;} +} + +@media screen and (max-width: 1430px) { + .promote-index-overview .icon {left: 12%;} + .promote-index-overview li{width:48.7%;;margin-bottom: 20px} + .promote-index-overview li:nth-of-type(odd){ margin-left: 0;margin-right: 2%} + .promote-index-overview li:nth-of-type(even){margin-left: 0;margin-right: 0} + .promote-index-overview li:nth-child(3){margin-bottom: 0} + .promote-index-overview li:nth-child(4){margin-bottom: 0} +} + +@media screen and (max-width: 900px) { + .promote-index-overview .icon {left: 12%;} + .promote-index-overview li{width:48.7%;margin-bottom: 20px} + .promote-index-overview li:nth-of-type(odd){ margin-left: 0;margin-right: 2%} + .promote-index-overview li:nth-of-type(even){margin-left: 0;margin-right: 0} + .promote-index-overview li:nth-child(3){margin-bottom: 20px!important;} + .promote-index-overview li:nth-child(4){margin-bottom: 0} +} + +.promote-index-overview ul{width: 100%;float:left;} +.promote-index-overview li {background:#FFF;border-radius:3px;float:left;width:23.33%;height:120px;position: relative;border: 1px solid #E3E8EC;} +.promote-index-overview li~li{margin-left:2%;} + +.page-list .trunk-search .tab a{display: inline-block;width: 140px;height: 40px;text-align: center;line-height: 40px;font-size: 14px;background:#F6F7F9;color: #535875;} +.tab-bnt{clear:both;display: flex;} +.tab-bnt div{width: 100px;height: 35px;line-height: 35px;display: inline-block;border: 1px solid #ddd;text-align: center;cursor:pointer} +.tab-bnt div:first-child{border-top-left-radius: 3px;border-bottom-left-radius: 3px;} +.tab-bnt div:last-child{border-top-right-radius: 3px;border-bottom-right-radius: 3px;} +.tab-bnt .curr{background: #26C7DB;color: #fff;border: 1px solid #26C7DB;} + + +.page-list .trunk-search .tab td {border:1px solid #ddd;display: inline-block;margin-right: -5px;} +.page-list .trunk-search .tab td.first_border{border-top-left-radius: 3px;border-bottom-left-radius: 3px;} +.page-list .trunk-search .tab td.last_border{border-top-right-radius: 3px;border-bottom-right-radius: 3px;} +.page-list .trunk-search .tab td.current {border-color:#26C7DB;} +.page-list .trunk-search .tab td.current a{background: #26C7DB;color:#FFF;} +.page-list .tabpan {display:none;} +.page-list .tabpan.current {display:block;} +.baseInfo{margin-top: 1%;} +.trunk-list .table2 tr{height: 54px;} +.trunk-list .table2 .l {text-align:right;color: #8B8CA0;width: 95px;} +.trunk-list .table2 .l .req {color:red;display:inline-block;width:10px;text-align:center;} +.trunk-list .table2 .r {padding-left:15px;color: #535875;} +.trunk-list .table2 .r .formtxt {padding:0 10px;} +.trunk-list .table2 .r input[type=text] {width: 230px;height: 32px;padding-left: 10px; border: 1px solid #E5E5E5;border-radius: 4px;line-height: 32px;color: #535875;} +.trunk-list .table2 .r input[type=password] {width: 230px;height: 32px;padding-left: 10px; border: 1px solid #E5E5E5;border-radius: 4px;line-height: 32px;color: #535875;} +.trunk-list .table2 .r .radio-item {margin-right: 10px;} +.trunk-list .table2 .r .tj{width: 118px;height: 36px;line-height:36px;background: #26C7DB;color: #fff;border-radius: 4px;border: none;padding: 0;} +.trunk-list .table2 .r .tj:hover{background: #2bd8ed;} +.trunk-list .table2 .r .tj.disabled {background:#CCC;} +.trunk-list .table2 .r .back_btn{width: 118px;height: 36px;line-height:36px;background: #E5E5E5;color: #8B8CA0;border-radius: 4px;display: inline-block;text-align: center;margin-left: 20px;} +.table2 .form-radio label {position:relative;margin-right:20px;cursor:pointer;} +.table2 .form-radio input {cursor:pointer;width:14px;height:14px;display:inline-block;position:absolute;top:0;left:0;margin:0;margin-top:2px;opacity:0;} +.table2 .form-radio i {width:14px;height:14px;display:inline-block;vertical-align:middle;margin-top:-2px;margin-right:5px;background:url(../../images/20180207/icon_normal_weixuanze.png) ;} +.table2 .form-radio i.current {background-image:url(../../images/20180207/icon_xuanze.png);} + + + +.page-list .trunk-search {padding-bottom: 20px;} +.promote-mychlid-list form a.btn {display:inline-block;width:135px;height:36px;line-height: 36px; text-align:center;background: #3A97FF;color: #fff;border-radius: 4px;} +.promote-mychlid-list form a.btn:hover{background: #449DFF;} +.promote-mychlid-list form a .add_qudao{width: 20px;height: 20px;display: inline-block;vertical-align: middle;margin-right: 5px;background: url(../../images/20180207/icon_normal_tianjia.png) no-repeat;} +.promote-mychlid-list .form-group .txt{width: 180px;height: 34px;} +.border_normal{border-top: 1px dashed #E3E3E3;} +.border_normal .desccontent span{color: #6a7082;} +.border_normal .desccontent p{color: #ADAEC2;padding-top: 1.5%;} +.promote-mychlid-list .table .editbtn {color:#4A90F0;} +.promote-mychlid-list .table .editbtn:hover {color:#4ACDDF;} \ No newline at end of file diff --git a/Public/Home/js/index/jquery.fxTab.js b/Public/Home/js/index/jquery.fxTab.js new file mode 100644 index 000000000..80acae560 --- /dev/null +++ b/Public/Home/js/index/jquery.fxTab.js @@ -0,0 +1,27 @@ +/* + Author : guosheng + QQ : 9169775 + Email: cff20@sina.com + Date : 2013-07-25 +*/ +$.fn.extend({ + fxuiTab:function(opt){ + //做插件首先是传进来的对象,也就是this进行each,这样子一个页面上多个区块都可以使用啦! + return this.each(function() { + //说说Var的事,变量之前肯定是用var的,这样子就不会变成全局变量,和别的方法冲突了,然后最只用一个Var,然后用","分开即可。 + var t = $(this),//t就是$(this),因为Jquery里$(this)很多,我们可以把这个t选存起来,后面好多地方可以用。 + o = opt || {}, //如果使用者没有参,给o设一个空的对象。 + tit = o.tit || t.find('.fxui-tab-tit'), //标签点击的对象。 + nav = o.nav || t.find('.fxui-tab-nav'), //内容显示的对象。 + evt = o.evt || 'click',//事件可以为click,hover或是mouseover。 + eq = o.eq || 0; //初始化的时候可以默认显示第几块。不传值显示第一个。 + tit.bind(evt,function(){ //通过bind 传这个evt,事件就可以变动了,不一定只是click事件了。 + $(this).addClass('curr').siblings(tit).removeClass('curr');//处理标签头:加当前的Class,样式通过css改变 + nav.eq(tit.index($(this))).show().siblings('.fxui-tab-nav').hide();//内容块显示。 + }).hover(function(){ + $(this).addClass('fxui-tab-hover').siblings(tit).removeClass('fxui-tab-hover'); //标签的tit移上去的时候加一个样式,这样子这个标签头可以有默认,hover和curr三种状态。 + }); + evt === 'click' ? tit.eq(eq).click() :tit.eq(eq).mouseover(); //初始化,当前是第几个 + }) + } +}); \ No newline at end of file diff --git a/Public/static/flatpickr/flatpickr.min.css b/Public/static/flatpickr/flatpickr.min.css new file mode 100644 index 000000000..46c57b7cc --- /dev/null +++ b/Public/static/flatpickr/flatpickr.min.css @@ -0,0 +1,13 @@ +.flatpickr-calendar{background:transparent;opacity:0;display:none;text-align:center;visibility:hidden;padding:0;-webkit-animation:none;animation:none;direction:ltr;border:0;font-size:14px;line-height:24px;border-radius:5px;position:absolute;width:307.875px;-webkit-box-sizing:border-box;box-sizing:border-box;-ms-touch-action:manipulation;touch-action:manipulation;background:#fff;-webkit-box-shadow:1px 0 0 #e6e6e6,-1px 0 0 #e6e6e6,0 1px 0 #e6e6e6,0 -1px 0 #e6e6e6,0 3px 13px rgba(0,0,0,0.08);box-shadow:1px 0 0 #e6e6e6,-1px 0 0 #e6e6e6,0 1px 0 #e6e6e6,0 -1px 0 #e6e6e6,0 3px 13px rgba(0,0,0,0.08);}.flatpickr-calendar.open,.flatpickr-calendar.inline{opacity:1;max-height:640px;visibility:visible}.flatpickr-calendar.open{display:inline-block;z-index:99999}.flatpickr-calendar.animate.open{-webkit-animation:fpFadeInDown 300ms cubic-bezier(.23,1,.32,1);animation:fpFadeInDown 300ms cubic-bezier(.23,1,.32,1)}.flatpickr-calendar.inline{display:block;position:relative;top:2px}.flatpickr-calendar.static{position:absolute;top:calc(100% + 2px);}.flatpickr-calendar.static.open{z-index:999;display:block}.flatpickr-calendar.multiMonth .flatpickr-days .dayContainer:nth-child(n+1) .flatpickr-day.inRange:nth-child(7n+7){-webkit-box-shadow:none !important;box-shadow:none !important}.flatpickr-calendar.multiMonth .flatpickr-days .dayContainer:nth-child(n+2) .flatpickr-day.inRange:nth-child(7n+1){-webkit-box-shadow:-2px 0 0 #e6e6e6,5px 0 0 #e6e6e6;box-shadow:-2px 0 0 #e6e6e6,5px 0 0 #e6e6e6}.flatpickr-calendar .hasWeeks .dayContainer,.flatpickr-calendar .hasTime .dayContainer{border-bottom:0;border-bottom-right-radius:0;border-bottom-left-radius:0}.flatpickr-calendar .hasWeeks .dayContainer{border-left:0}.flatpickr-calendar.showTimeInput.hasTime .flatpickr-time{height:40px;border-top:1px solid #e6e6e6}.flatpickr-calendar.noCalendar.hasTime .flatpickr-time{height:auto}.flatpickr-calendar:before,.flatpickr-calendar:after{position:absolute;display:block;pointer-events:none;border:solid transparent;content:'';height:0;width:0;left:22px}.flatpickr-calendar.rightMost:before,.flatpickr-calendar.rightMost:after{left:auto;right:22px}.flatpickr-calendar:before{border-width:5px;margin:0 -5px}.flatpickr-calendar:after{border-width:4px;margin:0 -4px}.flatpickr-calendar.arrowTop:before,.flatpickr-calendar.arrowTop:after{bottom:100%}.flatpickr-calendar.arrowTop:before{border-bottom-color:#e6e6e6}.flatpickr-calendar.arrowTop:after{border-bottom-color:#fff}.flatpickr-calendar.arrowBottom:before,.flatpickr-calendar.arrowBottom:after{top:100%}.flatpickr-calendar.arrowBottom:before{border-top-color:#e6e6e6}.flatpickr-calendar.arrowBottom:after{border-top-color:#fff}.flatpickr-calendar:focus{outline:0}.flatpickr-wrapper{position:relative;display:inline-block}.flatpickr-months{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;}.flatpickr-months .flatpickr-month{background:transparent;color:rgba(0,0,0,0.9);fill:rgba(0,0,0,0.9);height:34px;line-height:1;text-align:center;position:relative;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;overflow:hidden;-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1}.flatpickr-months .flatpickr-prev-month,.flatpickr-months .flatpickr-next-month{text-decoration:none;cursor:pointer;position:absolute;top:0;height:34px;padding:10px;z-index:3;color:rgba(0,0,0,0.9);fill:rgba(0,0,0,0.9);}.flatpickr-months .flatpickr-prev-month.flatpickr-disabled,.flatpickr-months .flatpickr-next-month.flatpickr-disabled{display:none}.flatpickr-months .flatpickr-prev-month i,.flatpickr-months .flatpickr-next-month i{position:relative}.flatpickr-months .flatpickr-prev-month.flatpickr-prev-month,.flatpickr-months .flatpickr-next-month.flatpickr-prev-month{/* + /*rtl:begin:ignore*/left:0;/* + /*rtl:end:ignore*/}/* + /*rtl:begin:ignore*/ +/* + /*rtl:end:ignore*/ +.flatpickr-months .flatpickr-prev-month.flatpickr-next-month,.flatpickr-months .flatpickr-next-month.flatpickr-next-month{/* + /*rtl:begin:ignore*/right:0;/* + /*rtl:end:ignore*/}/* + /*rtl:begin:ignore*/ +/* + /*rtl:end:ignore*/ +.flatpickr-months .flatpickr-prev-month:hover,.flatpickr-months .flatpickr-next-month:hover{color:#959ea9;}.flatpickr-months .flatpickr-prev-month:hover svg,.flatpickr-months .flatpickr-next-month:hover svg{fill:#f64747}.flatpickr-months .flatpickr-prev-month svg,.flatpickr-months .flatpickr-next-month svg{width:14px;height:14px;}.flatpickr-months .flatpickr-prev-month svg path,.flatpickr-months .flatpickr-next-month svg path{-webkit-transition:fill .1s;transition:fill .1s;fill:inherit}.numInputWrapper{position:relative;height:auto;}.numInputWrapper input,.numInputWrapper span{display:inline-block}.numInputWrapper input{width:100%;}.numInputWrapper input::-ms-clear{display:none}.numInputWrapper input::-webkit-outer-spin-button,.numInputWrapper input::-webkit-inner-spin-button{margin:0;-webkit-appearance:none}.numInputWrapper span{position:absolute;right:0;width:14px;padding:0 4px 0 2px;height:50%;line-height:50%;opacity:0;cursor:pointer;border:1px solid rgba(57,57,57,0.15);-webkit-box-sizing:border-box;box-sizing:border-box;}.numInputWrapper span:hover{background:rgba(0,0,0,0.1)}.numInputWrapper span:active{background:rgba(0,0,0,0.2)}.numInputWrapper span:after{display:block;content:"";position:absolute}.numInputWrapper span.arrowUp{top:0;border-bottom:0;}.numInputWrapper span.arrowUp:after{border-left:4px solid transparent;border-right:4px solid transparent;border-bottom:4px solid rgba(57,57,57,0.6);top:26%}.numInputWrapper span.arrowDown{top:50%;}.numInputWrapper span.arrowDown:after{border-left:4px solid transparent;border-right:4px solid transparent;border-top:4px solid rgba(57,57,57,0.6);top:40%}.numInputWrapper span svg{width:inherit;height:auto;}.numInputWrapper span svg path{fill:rgba(0,0,0,0.5)}.numInputWrapper:hover{background:rgba(0,0,0,0.05);}.numInputWrapper:hover span{opacity:1}.flatpickr-current-month{font-size:135%;line-height:inherit;font-weight:300;color:inherit;position:absolute;width:75%;left:12.5%;padding:7.48px 0 0 0;line-height:1;height:34px;display:inline-block;text-align:center;-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0);}.flatpickr-current-month span.cur-month{font-family:inherit;font-weight:700;color:inherit;display:inline-block;margin-left:.5ch;padding:0;}.flatpickr-current-month span.cur-month:hover{background:rgba(0,0,0,0.05)}.flatpickr-current-month .numInputWrapper{width:6ch;width:7ch\0;display:inline-block;}.flatpickr-current-month .numInputWrapper span.arrowUp:after{border-bottom-color:rgba(0,0,0,0.9)}.flatpickr-current-month .numInputWrapper span.arrowDown:after{border-top-color:rgba(0,0,0,0.9)}.flatpickr-current-month input.cur-year{background:transparent;-webkit-box-sizing:border-box;box-sizing:border-box;color:inherit;cursor:text;padding:0 0 0 .5ch;margin:0;display:inline-block;font-size:inherit;font-family:inherit;font-weight:300;line-height:inherit;height:auto;border:0;border-radius:0;vertical-align:initial;-webkit-appearance:textfield;-moz-appearance:textfield;appearance:textfield;}.flatpickr-current-month input.cur-year:focus{outline:0}.flatpickr-current-month input.cur-year[disabled],.flatpickr-current-month input.cur-year[disabled]:hover{font-size:100%;color:rgba(0,0,0,0.5);background:transparent;pointer-events:none}.flatpickr-current-month .flatpickr-monthDropdown-months{appearance:menulist;background:transparent;border:none;border-radius:0;box-sizing:border-box;color:inherit;cursor:pointer;font-size:inherit;font-family:inherit;font-weight:300;height:auto;line-height:inherit;margin:-1px 0 0 0;outline:none;padding:0 0 0 .5ch;position:relative;vertical-align:initial;-webkit-box-sizing:border-box;-webkit-appearance:menulist;-moz-appearance:menulist;width:auto;}.flatpickr-current-month .flatpickr-monthDropdown-months:focus,.flatpickr-current-month .flatpickr-monthDropdown-months:active{outline:none}.flatpickr-current-month .flatpickr-monthDropdown-months:hover{background:rgba(0,0,0,0.05)}.flatpickr-current-month .flatpickr-monthDropdown-months .flatpickr-monthDropdown-month{background-color:transparent;outline:none;padding:0}.flatpickr-weekdays{background:transparent;text-align:center;overflow:hidden;width:100%;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center;height:28px;}.flatpickr-weekdays .flatpickr-weekdaycontainer{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1}span.flatpickr-weekday{cursor:default;font-size:90%;background:transparent;color:rgba(0,0,0,0.54);line-height:1;margin:0;text-align:center;display:block;-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1;font-weight:bolder}.dayContainer,.flatpickr-weeks{padding:1px 0 0 0}.flatpickr-days{position:relative;overflow:hidden;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:start;-webkit-align-items:flex-start;-ms-flex-align:start;align-items:flex-start;width:307.875px;}.flatpickr-days:focus{outline:0}.dayContainer{padding:0;outline:0;text-align:left;width:307.875px;min-width:307.875px;max-width:307.875px;-webkit-box-sizing:border-box;box-sizing:border-box;display:inline-block;display:-ms-flexbox;display:-webkit-box;display:-webkit-flex;display:flex;-webkit-flex-wrap:wrap;flex-wrap:wrap;-ms-flex-wrap:wrap;-ms-flex-pack:justify;-webkit-justify-content:space-around;justify-content:space-around;-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0);opacity:1;}.dayContainer + .dayContainer{-webkit-box-shadow:-1px 0 0 #e6e6e6;box-shadow:-1px 0 0 #e6e6e6}.flatpickr-day{background:none;border:1px solid transparent;border-radius:150px;-webkit-box-sizing:border-box;box-sizing:border-box;color:#393939;cursor:pointer;font-weight:400;width:14.2857143%;-webkit-flex-basis:14.2857143%;-ms-flex-preferred-size:14.2857143%;flex-basis:14.2857143%;max-width:39px;height:39px;line-height:39px;margin:0;display:inline-block;position:relative;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;text-align:center;}.flatpickr-day.inRange,.flatpickr-day.prevMonthDay.inRange,.flatpickr-day.nextMonthDay.inRange,.flatpickr-day.today.inRange,.flatpickr-day.prevMonthDay.today.inRange,.flatpickr-day.nextMonthDay.today.inRange,.flatpickr-day:hover,.flatpickr-day.prevMonthDay:hover,.flatpickr-day.nextMonthDay:hover,.flatpickr-day:focus,.flatpickr-day.prevMonthDay:focus,.flatpickr-day.nextMonthDay:focus{cursor:pointer;outline:0;background:#e6e6e6;border-color:#e6e6e6}.flatpickr-day.today{border-color:#959ea9;}.flatpickr-day.today:hover,.flatpickr-day.today:focus{border-color:#959ea9;background:#959ea9;color:#fff}.flatpickr-day.selected,.flatpickr-day.startRange,.flatpickr-day.endRange,.flatpickr-day.selected.inRange,.flatpickr-day.startRange.inRange,.flatpickr-day.endRange.inRange,.flatpickr-day.selected:focus,.flatpickr-day.startRange:focus,.flatpickr-day.endRange:focus,.flatpickr-day.selected:hover,.flatpickr-day.startRange:hover,.flatpickr-day.endRange:hover,.flatpickr-day.selected.prevMonthDay,.flatpickr-day.startRange.prevMonthDay,.flatpickr-day.endRange.prevMonthDay,.flatpickr-day.selected.nextMonthDay,.flatpickr-day.startRange.nextMonthDay,.flatpickr-day.endRange.nextMonthDay{background:#569ff7;-webkit-box-shadow:none;box-shadow:none;color:#fff;border-color:#569ff7}.flatpickr-day.selected.startRange,.flatpickr-day.startRange.startRange,.flatpickr-day.endRange.startRange{border-radius:50px 0 0 50px}.flatpickr-day.selected.endRange,.flatpickr-day.startRange.endRange,.flatpickr-day.endRange.endRange{border-radius:0 50px 50px 0}.flatpickr-day.selected.startRange + .endRange:not(:nth-child(7n+1)),.flatpickr-day.startRange.startRange + .endRange:not(:nth-child(7n+1)),.flatpickr-day.endRange.startRange + .endRange:not(:nth-child(7n+1)){-webkit-box-shadow:-10px 0 0 #569ff7;box-shadow:-10px 0 0 #569ff7}.flatpickr-day.selected.startRange.endRange,.flatpickr-day.startRange.startRange.endRange,.flatpickr-day.endRange.startRange.endRange{border-radius:50px}.flatpickr-day.inRange{border-radius:0;-webkit-box-shadow:-5px 0 0 #e6e6e6,5px 0 0 #e6e6e6;box-shadow:-5px 0 0 #e6e6e6,5px 0 0 #e6e6e6}.flatpickr-day.flatpickr-disabled,.flatpickr-day.flatpickr-disabled:hover,.flatpickr-day.prevMonthDay,.flatpickr-day.nextMonthDay,.flatpickr-day.notAllowed,.flatpickr-day.notAllowed.prevMonthDay,.flatpickr-day.notAllowed.nextMonthDay{color:rgba(57,57,57,0.3);background:transparent;border-color:transparent;cursor:default}.flatpickr-day.flatpickr-disabled,.flatpickr-day.flatpickr-disabled:hover{cursor:not-allowed;color:rgba(57,57,57,0.1)}.flatpickr-day.week.selected{border-radius:0;-webkit-box-shadow:-5px 0 0 #569ff7,5px 0 0 #569ff7;box-shadow:-5px 0 0 #569ff7,5px 0 0 #569ff7}.flatpickr-day.hidden{visibility:hidden}.rangeMode .flatpickr-day{margin-top:1px}.flatpickr-weekwrapper{float:left;}.flatpickr-weekwrapper .flatpickr-weeks{padding:0 12px;-webkit-box-shadow:1px 0 0 #e6e6e6;box-shadow:1px 0 0 #e6e6e6}.flatpickr-weekwrapper .flatpickr-weekday{float:none;width:100%;line-height:28px}.flatpickr-weekwrapper span.flatpickr-day,.flatpickr-weekwrapper span.flatpickr-day:hover{display:block;width:100%;max-width:none;color:rgba(57,57,57,0.3);background:transparent;cursor:default;border:none}.flatpickr-innerContainer{display:block;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-sizing:border-box;box-sizing:border-box;overflow:hidden;}.flatpickr-rContainer{display:inline-block;padding:0;-webkit-box-sizing:border-box;box-sizing:border-box}.flatpickr-time{text-align:center;outline:0;display:block;height:0;line-height:40px;max-height:40px;-webkit-box-sizing:border-box;box-sizing:border-box;overflow:hidden;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;}.flatpickr-time:after{content:"";display:table;clear:both}.flatpickr-time .numInputWrapper{-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1;width:40%;height:40px;float:left;}.flatpickr-time .numInputWrapper span.arrowUp:after{border-bottom-color:#393939}.flatpickr-time .numInputWrapper span.arrowDown:after{border-top-color:#393939}.flatpickr-time.hasSeconds .numInputWrapper{width:26%}.flatpickr-time.time24hr .numInputWrapper{width:49%}.flatpickr-time input{background:transparent;-webkit-box-shadow:none;box-shadow:none;border:0;border-radius:0;text-align:center;margin:0;padding:0;height:inherit;line-height:inherit;color:#393939;font-size:14px;position:relative;-webkit-box-sizing:border-box;box-sizing:border-box;-webkit-appearance:textfield;-moz-appearance:textfield;appearance:textfield;}.flatpickr-time input.flatpickr-hour{font-weight:bold}.flatpickr-time input.flatpickr-minute,.flatpickr-time input.flatpickr-second{font-weight:400}.flatpickr-time input:focus{outline:0;border:0}.flatpickr-time .flatpickr-time-separator,.flatpickr-time .flatpickr-am-pm{height:inherit;float:left;line-height:inherit;color:#393939;font-weight:bold;width:2%;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-align-self:center;-ms-flex-item-align:center;align-self:center}.flatpickr-time .flatpickr-am-pm{outline:0;width:18%;cursor:pointer;text-align:center;font-weight:400}.flatpickr-time input:hover,.flatpickr-time .flatpickr-am-pm:hover,.flatpickr-time input:focus,.flatpickr-time .flatpickr-am-pm:focus{background:#eee}.flatpickr-input[readonly]{cursor:pointer}@-webkit-keyframes fpFadeInDown{from{opacity:0;-webkit-transform:translate3d(0,-20px,0);transform:translate3d(0,-20px,0)}to{opacity:1;-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}}@keyframes fpFadeInDown{from{opacity:0;-webkit-transform:translate3d(0,-20px,0);transform:translate3d(0,-20px,0)}to{opacity:1;-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}} \ No newline at end of file diff --git a/Public/static/flatpickr/flatpickr.min.js b/Public/static/flatpickr/flatpickr.min.js new file mode 100644 index 000000000..941813329 --- /dev/null +++ b/Public/static/flatpickr/flatpickr.min.js @@ -0,0 +1,2 @@ +/* flatpickr v4.6.2,, @license MIT */ +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e=e||self).flatpickr=t()}(this,function(){"use strict";var e=function(){return(e=Object.assign||function(e){for(var t,n=1,a=arguments.length;n",noCalendar:!1,now:new Date,onChange:[],onClose:[],onDayCreate:[],onDestroy:[],onKeyDown:[],onMonthChange:[],onOpen:[],onParseConfig:[],onReady:[],onValueUpdate:[],onYearChange:[],onPreCalendarPosition:[],plugins:[],position:"auto",positionElement:void 0,prevArrow:"",shorthandCurrentMonth:!1,showMonths:1,static:!1,time_24hr:!1,weekNumbers:!1,wrap:!1},a={weekdays:{shorthand:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],longhand:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},months:{shorthand:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],longhand:["January","February","March","April","May","June","July","August","September","October","November","December"]},daysInMonth:[31,28,31,30,31,30,31,31,30,31,30,31],firstDayOfWeek:0,ordinal:function(e){var t=e%100;if(t>3&&t<21)return"th";switch(t%10){case 1:return"st";case 2:return"nd";case 3:return"rd";default:return"th"}},rangeSeparator:" to ",weekAbbreviation:"Wk",scrollTitle:"Scroll to increment",toggleTitle:"Click to toggle",amPM:["AM","PM"],yearAriaLabel:"Year",hourAriaLabel:"Hour",minuteAriaLabel:"Minute",time_24hr:!1},i=function(e){return("0"+e).slice(-2)},o=function(e){return!0===e?1:0};function r(e,t,n){var a;return void 0===n&&(n=!1),function(){var i=this,o=arguments;null!==a&&clearTimeout(a),a=window.setTimeout(function(){a=null,n||e.apply(i,o)},t),n&&!a&&e.apply(i,o)}}var l=function(e){return e instanceof Array?e:[e]};function c(e,t,n){if(!0===n)return e.classList.add(t);e.classList.remove(t)}function d(e,t,n){var a=window.document.createElement(e);return t=t||"",n=n||"",a.className=t,void 0!==n&&(a.textContent=n),a}function s(e){for(;e.firstChild;)e.removeChild(e.firstChild)}function u(e,t){var n=d("div","numInputWrapper"),a=d("input","numInput "+e),i=d("span","arrowUp"),o=d("span","arrowDown");if(-1===navigator.userAgent.indexOf("MSIE 9.0")?a.type="number":(a.type="text",a.pattern="\\d*"),void 0!==t)for(var r in t)a.setAttribute(r,t[r]);return n.appendChild(a),n.appendChild(i),n.appendChild(o),n}var f=function(){},m=function(e,t,n){return n.months[t?"shorthand":"longhand"][e]},g={D:f,F:function(e,t,n){e.setMonth(n.months.longhand.indexOf(t))},G:function(e,t){e.setHours(parseFloat(t))},H:function(e,t){e.setHours(parseFloat(t))},J:function(e,t){e.setDate(parseFloat(t))},K:function(e,t,n){e.setHours(e.getHours()%12+12*o(new RegExp(n.amPM[1],"i").test(t)))},M:function(e,t,n){e.setMonth(n.months.shorthand.indexOf(t))},S:function(e,t){e.setSeconds(parseFloat(t))},U:function(e,t){return new Date(1e3*parseFloat(t))},W:function(e,t,n){var a=parseInt(t),i=new Date(e.getFullYear(),0,2+7*(a-1),0,0,0,0);return i.setDate(i.getDate()-i.getDay()+n.firstDayOfWeek),i},Y:function(e,t){e.setFullYear(parseFloat(t))},Z:function(e,t){return new Date(t)},d:function(e,t){e.setDate(parseFloat(t))},h:function(e,t){e.setHours(parseFloat(t))},i:function(e,t){e.setMinutes(parseFloat(t))},j:function(e,t){e.setDate(parseFloat(t))},l:f,m:function(e,t){e.setMonth(parseFloat(t)-1)},n:function(e,t){e.setMonth(parseFloat(t)-1)},s:function(e,t){e.setSeconds(parseFloat(t))},u:function(e,t){return new Date(parseFloat(t))},w:f,y:function(e,t){e.setFullYear(2e3+parseFloat(t))}},p={D:"(\\w+)",F:"(\\w+)",G:"(\\d\\d|\\d)",H:"(\\d\\d|\\d)",J:"(\\d\\d|\\d)\\w+",K:"",M:"(\\w+)",S:"(\\d\\d|\\d)",U:"(.+)",W:"(\\d\\d|\\d)",Y:"(\\d{4})",Z:"(.+)",d:"(\\d\\d|\\d)",h:"(\\d\\d|\\d)",i:"(\\d\\d|\\d)",j:"(\\d\\d|\\d)",l:"(\\w+)",m:"(\\d\\d|\\d)",n:"(\\d\\d|\\d)",s:"(\\d\\d|\\d)",u:"(.+)",w:"(\\d\\d|\\d)",y:"(\\d{2})"},h={Z:function(e){return e.toISOString()},D:function(e,t,n){return t.weekdays.shorthand[h.w(e,t,n)]},F:function(e,t,n){return m(h.n(e,t,n)-1,!1,t)},G:function(e,t,n){return i(h.h(e,t,n))},H:function(e){return i(e.getHours())},J:function(e,t){return void 0!==t.ordinal?e.getDate()+t.ordinal(e.getDate()):e.getDate()},K:function(e,t){return t.amPM[o(e.getHours()>11)]},M:function(e,t){return m(e.getMonth(),!0,t)},S:function(e){return i(e.getSeconds())},U:function(e){return e.getTime()/1e3},W:function(e,t,n){return n.getWeek(e)},Y:function(e){return e.getFullYear()},d:function(e){return i(e.getDate())},h:function(e){return e.getHours()%12?e.getHours()%12:12},i:function(e){return i(e.getMinutes())},j:function(e){return e.getDate()},l:function(e,t){return t.weekdays.longhand[e.getDay()]},m:function(e){return i(e.getMonth()+1)},n:function(e){return e.getMonth()+1},s:function(e){return e.getSeconds()},u:function(e){return e.getTime()},w:function(e){return e.getDay()},y:function(e){return String(e.getFullYear()).substring(2)}},v=function(e){var t=e.config,i=void 0===t?n:t,o=e.l10n,r=void 0===o?a:o;return function(e,t,n){var a=n||r;return void 0!==i.formatDate?i.formatDate(e,t,a):t.split("").map(function(t,n,o){return h[t]&&"\\"!==o[n-1]?h[t](e,a,i):"\\"!==t?t:""}).join("")}},D=function(e){var t=e.config,i=void 0===t?n:t,o=e.l10n,r=void 0===o?a:o;return function(e,t,a,o){if(0===e||e){var l,c=o||r,d=e;if(e instanceof Date)l=new Date(e.getTime());else if("string"!=typeof e&&void 0!==e.toFixed)l=new Date(e);else if("string"==typeof e){var s=t||(i||n).dateFormat,u=String(e).trim();if("today"===u)l=new Date,a=!0;else if(/Z$/.test(u)||/GMT$/.test(u))l=new Date(e);else if(i&&i.parseDate)l=i.parseDate(e,s);else{l=i&&i.noCalendar?new Date((new Date).setHours(0,0,0,0)):new Date((new Date).getFullYear(),0,1,0,0,0,0);for(var f=void 0,m=[],h=0,v=0,D="";hMath.min(t,n)&&er&&(s=n===h.hourElement?s-r-o(!h.amPM):a,f&&j(void 0,1,h.hourElement)),h.amPM&&u&&(1===l?s+c===23:Math.abs(s-c)>l)&&(h.amPM.textContent=h.l10n.amPM[o(h.amPM.textContent===h.l10n.amPM[0])]),n.value=i(s)}}(e);var t=h._input.value;k(),we(),h._input.value!==t&&h._debouncedChange()}function k(){if(void 0!==h.hourElement&&void 0!==h.minuteElement){var e,t,n=(parseInt(h.hourElement.value.slice(-2),10)||0)%24,a=(parseInt(h.minuteElement.value,10)||0)%60,i=void 0!==h.secondElement?(parseInt(h.secondElement.value,10)||0)%60:0;void 0!==h.amPM&&(e=n,t=h.amPM.textContent,n=e%12+12*o(t===h.l10n.amPM[1]));var r=void 0!==h.config.minTime||h.config.minDate&&h.minDateHasTime&&h.latestSelectedDateObj&&0===w(h.latestSelectedDateObj,h.config.minDate,!0);if(void 0!==h.config.maxTime||h.config.maxDate&&h.maxDateHasTime&&h.latestSelectedDateObj&&0===w(h.latestSelectedDateObj,h.config.maxDate,!0)){var l=void 0!==h.config.maxTime?h.config.maxTime:h.config.maxDate;(n=Math.min(n,l.getHours()))===l.getHours()&&(a=Math.min(a,l.getMinutes())),a===l.getMinutes()&&(i=Math.min(i,l.getSeconds()))}if(r){var c=void 0!==h.config.minTime?h.config.minTime:h.config.minDate;(n=Math.max(n,c.getHours()))===c.getHours()&&(a=Math.max(a,c.getMinutes())),a===c.getMinutes()&&(i=Math.max(i,c.getSeconds()))}O(n,a,i)}}function I(e){var t=e||h.latestSelectedDateObj;t&&O(t.getHours(),t.getMinutes(),t.getSeconds())}function S(){var e=h.config.defaultHour,t=h.config.defaultMinute,n=h.config.defaultSeconds;if(void 0!==h.config.minDate){var a=h.config.minDate.getHours(),i=h.config.minDate.getMinutes();(e=Math.max(e,a))===a&&(t=Math.max(i,t)),e===a&&t===i&&(n=h.config.minDate.getSeconds())}if(void 0!==h.config.maxDate){var o=h.config.maxDate.getHours(),r=h.config.maxDate.getMinutes();(e=Math.min(e,o))===o&&(t=Math.min(r,t)),e===o&&t===r&&(n=h.config.maxDate.getSeconds())}O(e,t,n)}function O(e,t,n){void 0!==h.latestSelectedDateObj&&h.latestSelectedDateObj.setHours(e%24,t,n||0,0),h.hourElement&&h.minuteElement&&!h.isMobile&&(h.hourElement.value=i(h.config.time_24hr?e:(12+e)%12+12*o(e%12==0)),h.minuteElement.value=i(t),void 0!==h.amPM&&(h.amPM.textContent=h.l10n.amPM[o(e>=12)]),void 0!==h.secondElement&&(h.secondElement.value=i(n)))}function _(e){var t=parseInt(e.target.value)+(e.delta||0);(t/1e3>1||"Enter"===e.key&&!/[^\d]/.test(t.toString()))&&Q(t)}function F(e,t,n,a){return t instanceof Array?t.forEach(function(t){return F(e,t,n,a)}):e instanceof Array?e.forEach(function(e){return F(e,t,n,a)}):(e.addEventListener(t,n,a),void h._handlers.push({element:e,event:t,handler:n,options:a}))}function N(e){return function(t){1===t.which&&e(t)}}function Y(){ge("onChange")}function A(e,t){var n=void 0!==e?h.parseDate(e):h.latestSelectedDateObj||(h.config.minDate&&h.config.minDate>h.now?h.config.minDate:h.config.maxDate&&h.config.maxDate=0&&w(e,h.selectedDates[1])<=0}(t)&&!he(t)&&o.classList.add("inRange"),h.weekNumbers&&1===h.config.showMonths&&"prevMonthDay"!==e&&n%7==1&&h.weekNumbers.insertAdjacentHTML("beforeend",""+h.config.getWeek(t)+""),ge("onDayCreate",o),o}function L(e){e.focus(),"range"===h.config.mode&&ne(e)}function W(e){for(var t=e>0?0:h.config.showMonths-1,n=e>0?h.config.showMonths:-1,a=t;a!=n;a+=e)for(var i=h.daysContainer.children[a],o=e>0?0:i.children.length-1,r=e>0?i.children.length:-1,l=o;l!=r;l+=e){var c=i.children[l];if(-1===c.className.indexOf("hidden")&&X(c.dateObj))return c}}function R(e,t){var n=ee(document.activeElement||document.body),a=void 0!==e?e:n?document.activeElement:void 0!==h.selectedDateElem&&ee(h.selectedDateElem)?h.selectedDateElem:void 0!==h.todayDateElem&&ee(h.todayDateElem)?h.todayDateElem:W(t>0?1:-1);return void 0===a?h._input.focus():n?void function(e,t){for(var n=-1===e.className.indexOf("Month")?e.dateObj.getMonth():h.currentMonth,a=t>0?h.config.showMonths:-1,i=t>0?1:-1,o=n-h.currentMonth;o!=a;o+=i)for(var r=h.daysContainer.children[o],l=n-h.currentMonth===o?e.$i+t:t<0?r.children.length-1:0,c=r.children.length,d=l;d>=0&&d0?c:-1);d+=i){var s=r.children[d];if(-1===s.className.indexOf("hidden")&&X(s.dateObj)&&Math.abs(e.$i-d)>=Math.abs(t))return L(s)}h.changeMonth(i),R(W(i),0)}(a,t):L(a)}function B(e,t){for(var n=(new Date(e,t,1).getDay()-h.l10n.firstDayOfWeek+7)%7,a=h.utils.getDaysInMonth((t-1+12)%12),i=h.utils.getDaysInMonth(t),o=window.document.createDocumentFragment(),r=h.config.showMonths>1,l=r?"prevMonthDay hidden":"prevMonthDay",c=r?"nextMonthDay hidden":"nextMonthDay",s=a+1-n,u=0;s<=a;s++,u++)o.appendChild(H(l,new Date(e,t-1,s),s,u));for(s=1;s<=i;s++,u++)o.appendChild(H("",new Date(e,t,s),s,u));for(var f=i+1;f<=42-n&&(1===h.config.showMonths||u%7!=0);f++,u++)o.appendChild(H(c,new Date(e,t+1,f%i),f,u));var m=d("div","dayContainer");return m.appendChild(o),m}function J(){if(void 0!==h.daysContainer){s(h.daysContainer),h.weekNumbers&&s(h.weekNumbers);for(var e=document.createDocumentFragment(),t=0;t1||"dropdown"!==h.config.monthSelectorType)){var e=function(e){return!(void 0!==h.config.minDate&&h.currentYear===h.config.minDate.getFullYear()&&eh.config.maxDate.getMonth())};h.monthsDropdownContainer.tabIndex=-1,h.monthsDropdownContainer.innerHTML="";for(var t=0;t<12;t++)if(e(t)){var n=d("option","flatpickr-monthDropdown-month");n.value=new Date(h.currentYear,t).getMonth().toString(),n.textContent=m(t,h.config.shorthandCurrentMonth,h.l10n),n.tabIndex=-1,h.currentMonth===t&&(n.selected=!0),h.monthsDropdownContainer.appendChild(n)}}}function U(){var e,t=d("div","flatpickr-month"),n=window.document.createDocumentFragment();h.config.showMonths>1||"static"===h.config.monthSelectorType?e=d("span","cur-month"):(h.monthsDropdownContainer=d("select","flatpickr-monthDropdown-months"),F(h.monthsDropdownContainer,"change",function(e){var t=e.target,n=parseInt(t.value,10);h.changeMonth(n-h.currentMonth),ge("onMonthChange")}),K(),e=h.monthsDropdownContainer);var a=u("cur-year",{tabindex:"-1"}),i=a.getElementsByTagName("input")[0];i.setAttribute("aria-label",h.l10n.yearAriaLabel),h.config.minDate&&i.setAttribute("min",h.config.minDate.getFullYear().toString()),h.config.maxDate&&(i.setAttribute("max",h.config.maxDate.getFullYear().toString()),i.disabled=!!h.config.minDate&&h.config.minDate.getFullYear()===h.config.maxDate.getFullYear());var o=d("div","flatpickr-current-month");return o.appendChild(e),o.appendChild(a),n.appendChild(o),t.appendChild(n),{container:t,yearElement:i,monthElement:e}}function q(){s(h.monthNav),h.monthNav.appendChild(h.prevMonthNav),h.config.showMonths&&(h.yearElements=[],h.monthElements=[]);for(var e=h.config.showMonths;e--;){var t=U();h.yearElements.push(t.yearElement),h.monthElements.push(t.monthElement),h.monthNav.appendChild(t.container)}h.monthNav.appendChild(h.nextMonthNav)}function $(){h.weekdayContainer?s(h.weekdayContainer):h.weekdayContainer=d("div","flatpickr-weekdays");for(var e=h.config.showMonths;e--;){var t=d("div","flatpickr-weekdaycontainer");h.weekdayContainer.appendChild(t)}return z(),h.weekdayContainer}function z(){var e=h.l10n.firstDayOfWeek,t=h.l10n.weekdays.shorthand.slice();e>0&&e\n "+t.join("")+"\n \n "}function G(e,t){void 0===t&&(t=!0);var n=t?e:e-h.currentMonth;n<0&&!0===h._hidePrevMonthArrow||n>0&&!0===h._hideNextMonthArrow||(h.currentMonth+=n,(h.currentMonth<0||h.currentMonth>11)&&(h.currentYear+=h.currentMonth>11?1:-1,h.currentMonth=(h.currentMonth+12)%12,ge("onYearChange"),K()),J(),ge("onMonthChange"),ve())}function V(e){return!(!h.config.appendTo||!h.config.appendTo.contains(e))||h.calendarContainer.contains(e)}function Z(e){if(h.isOpen&&!h.config.inline){var t="function"==typeof(r=e).composedPath?r.composedPath()[0]:r.target,n=V(t),a=t===h.input||t===h.altInput||h.element.contains(t)||e.path&&e.path.indexOf&&(~e.path.indexOf(h.input)||~e.path.indexOf(h.altInput)),i="blur"===e.type?a&&e.relatedTarget&&!V(e.relatedTarget):!a&&!n&&!V(e.relatedTarget),o=!h.config.ignoredFocusElements.some(function(e){return e.contains(t)});i&&o&&(h.close(),"range"===h.config.mode&&1===h.selectedDates.length&&(h.clear(!1),h.redraw()))}var r}function Q(e){if(!(!e||h.config.minDate&&eh.config.maxDate.getFullYear())){var t=e,n=h.currentYear!==t;h.currentYear=t||h.currentYear,h.config.maxDate&&h.currentYear===h.config.maxDate.getFullYear()?h.currentMonth=Math.min(h.config.maxDate.getMonth(),h.currentMonth):h.config.minDate&&h.currentYear===h.config.minDate.getFullYear()&&(h.currentMonth=Math.max(h.config.minDate.getMonth(),h.currentMonth)),n&&(h.redraw(),ge("onYearChange"),K())}}function X(e,t){void 0===t&&(t=!0);var n=h.parseDate(e,void 0,t);if(h.config.minDate&&n&&w(n,h.config.minDate,void 0!==t?t:!h.minDateHasTime)<0||h.config.maxDate&&n&&w(n,h.config.maxDate,void 0!==t?t:!h.maxDateHasTime)>0)return!1;if(0===h.config.enable.length&&0===h.config.disable.length)return!0;if(void 0===n)return!1;for(var a=h.config.enable.length>0,i=a?h.config.enable:h.config.disable,o=0,r=void 0;o=r.from.getTime()&&n.getTime()<=r.to.getTime())return a}return!a}function ee(e){return void 0!==h.daysContainer&&(-1===e.className.indexOf("hidden")&&h.daysContainer.contains(e))}function te(e){var t=e.target===h._input,n=h.config.allowInput,a=h.isOpen&&(!n||!t),i=h.config.inline&&t&&!n;if(13===e.keyCode&&t){if(n)return h.setDate(h._input.value,!0,e.target===h.altInput?h.config.altFormat:h.config.dateFormat),e.target.blur();h.open()}else if(V(e.target)||a||i){var o=!!h.timeContainer&&h.timeContainer.contains(e.target);switch(e.keyCode){case 13:o?(e.preventDefault(),T(),de()):se(e);break;case 27:e.preventDefault(),de();break;case 8:case 46:t&&!h.config.allowInput&&(e.preventDefault(),h.clear());break;case 37:case 39:if(o||t)h.hourElement&&h.hourElement.focus();else if(e.preventDefault(),void 0!==h.daysContainer&&(!1===n||document.activeElement&&ee(document.activeElement))){var r=39===e.keyCode?1:-1;e.ctrlKey?(e.stopPropagation(),G(r),R(W(1),0)):R(void 0,r)}break;case 38:case 40:e.preventDefault();var l=40===e.keyCode?1:-1;h.daysContainer&&void 0!==e.target.$i||e.target===h.input?e.ctrlKey?(e.stopPropagation(),Q(h.currentYear-l),R(W(1),0)):o||R(void 0,7*l):e.target===h.currentYearElement?Q(h.currentYear-l):h.config.enableTime&&(!o&&h.hourElement&&h.hourElement.focus(),T(e),h._debouncedChange());break;case 9:if(o){var c=[h.hourElement,h.minuteElement,h.secondElement,h.amPM].concat(h.pluginElements).filter(function(e){return e}),d=c.indexOf(e.target);if(-1!==d){var s=c[d+(e.shiftKey?-1:1)];e.preventDefault(),(s||h._input).focus()}}else!h.config.noCalendar&&h.daysContainer&&h.daysContainer.contains(e.target)&&e.shiftKey&&(e.preventDefault(),h._input.focus())}}if(void 0!==h.amPM&&e.target===h.amPM)switch(e.key){case h.l10n.amPM[0].charAt(0):case h.l10n.amPM[0].charAt(0).toLowerCase():h.amPM.textContent=h.l10n.amPM[0],k(),we();break;case h.l10n.amPM[1].charAt(0):case h.l10n.amPM[1].charAt(0).toLowerCase():h.amPM.textContent=h.l10n.amPM[1],k(),we()}(t||V(e.target))&&ge("onKeyDown",e)}function ne(e){if(1===h.selectedDates.length&&(!e||e.classList.contains("flatpickr-day")&&!e.classList.contains("flatpickr-disabled"))){for(var t=e?e.dateObj.getTime():h.days.firstElementChild.dateObj.getTime(),n=h.parseDate(h.selectedDates[0],void 0,!0).getTime(),a=Math.min(t,h.selectedDates[0].getTime()),i=Math.max(t,h.selectedDates[0].getTime()),o=!1,r=0,l=0,c=a;ca&&cr)?r=c:c>n&&(!l||c0&&d0&&d>l;return u?(c.classList.add("notAllowed"),["inRange","startRange","endRange"].forEach(function(e){c.classList.remove(e)}),"continue"):o&&!u?"continue":(["startRange","inRange","endRange","notAllowed"].forEach(function(e){c.classList.remove(e)}),void(void 0!==e&&(e.classList.add(t<=h.selectedDates[0].getTime()?"startRange":"endRange"),nt&&d===n&&c.classList.add("endRange"),d>=r&&(0===l||d<=l)&&b(d,n,t)&&c.classList.add("inRange"))))},f=0,m=s.children.length;f0||n.getMinutes()>0||n.getSeconds()>0),h.selectedDates&&(h.selectedDates=h.selectedDates.filter(function(e){return X(e)}),h.selectedDates.length||"min"!==e||I(n),we()),h.daysContainer&&(ce(),void 0!==n?h.currentYearElement[e]=n.getFullYear().toString():h.currentYearElement.removeAttribute(e),h.currentYearElement.disabled=!!a&&void 0!==n&&a.getFullYear()===n.getFullYear())}}function re(){"object"!=typeof h.config.locale&&void 0===E.l10ns[h.config.locale]&&h.config.errorHandler(new Error("flatpickr: invalid locale "+h.config.locale)),h.l10n=e({},E.l10ns.default,"object"==typeof h.config.locale?h.config.locale:"default"!==h.config.locale?E.l10ns[h.config.locale]:void 0),p.K="("+h.l10n.amPM[0]+"|"+h.l10n.amPM[1]+"|"+h.l10n.amPM[0].toLowerCase()+"|"+h.l10n.amPM[1].toLowerCase()+")",void 0===e({},g,JSON.parse(JSON.stringify(f.dataset||{}))).time_24hr&&void 0===E.defaultConfig.time_24hr&&(h.config.time_24hr=h.l10n.time_24hr),h.formatDate=v(h),h.parseDate=D({config:h.config,l10n:h.l10n})}function le(e){if(void 0!==h.calendarContainer){ge("onPreCalendarPosition");var t=e||h._positionElement,n=Array.prototype.reduce.call(h.calendarContainer.children,function(e,t){return e+t.offsetHeight},0),a=h.calendarContainer.offsetWidth,i=h.config.position.split(" "),o=i[0],r=i.length>1?i[1]:null,l=t.getBoundingClientRect(),d=window.innerHeight-l.bottom,s="above"===o||"below"!==o&&dn,u=window.pageYOffset+l.top+(s?-n-2:t.offsetHeight+2);if(c(h.calendarContainer,"arrowTop",!s),c(h.calendarContainer,"arrowBottom",s),!h.config.inline){var f=window.pageXOffset+l.left-(null!=r&&"center"===r?(a-l.width)/2:0),m=window.document.body.offsetWidth-l.right,g=f+a>window.document.body.offsetWidth,p=m+a>window.document.body.offsetWidth;if(c(h.calendarContainer,"rightMost",g),!h.config.static)if(h.calendarContainer.style.top=u+"px",g)if(p){var v=document.styleSheets[0];if(void 0===v)return;var D=window.document.body.offsetWidth,w=Math.max(0,D/2-a/2),b=v.cssRules.length,C="{left:"+l.left+"px;right:auto;}";c(h.calendarContainer,"rightMost",!1),c(h.calendarContainer,"centerMost",!0),v.insertRule(".flatpickr-calendar.centerMost:before,.flatpickr-calendar.centerMost:after"+C,b),h.calendarContainer.style.left=w+"px",h.calendarContainer.style.right="auto"}else h.calendarContainer.style.left="auto",h.calendarContainer.style.right=m+"px";else h.calendarContainer.style.left=f+"px",h.calendarContainer.style.right="auto"}}}function ce(){h.config.noCalendar||h.isMobile||(ve(),J())}function de(){h._input.focus(),-1!==window.navigator.userAgent.indexOf("MSIE")||void 0!==navigator.msMaxTouchPoints?setTimeout(h.close,0):h.close()}function se(e){e.preventDefault(),e.stopPropagation();var t=function e(t,n){return n(t)?t:t.parentNode?e(t.parentNode,n):void 0}(e.target,function(e){return e.classList&&e.classList.contains("flatpickr-day")&&!e.classList.contains("flatpickr-disabled")&&!e.classList.contains("notAllowed")});if(void 0!==t){var n=t,a=h.latestSelectedDateObj=new Date(n.dateObj.getTime()),i=(a.getMonth()h.currentMonth+h.config.showMonths-1)&&"range"!==h.config.mode;if(h.selectedDateElem=n,"single"===h.config.mode)h.selectedDates=[a];else if("multiple"===h.config.mode){var o=he(a);o?h.selectedDates.splice(parseInt(o),1):h.selectedDates.push(a)}else"range"===h.config.mode&&(2===h.selectedDates.length&&h.clear(!1,!1),h.latestSelectedDateObj=a,h.selectedDates.push(a),0!==w(a,h.selectedDates[0],!0)&&h.selectedDates.sort(function(e,t){return e.getTime()-t.getTime()}));if(k(),i){var r=h.currentYear!==a.getFullYear();h.currentYear=a.getFullYear(),h.currentMonth=a.getMonth(),r&&(ge("onYearChange"),K()),ge("onMonthChange")}if(ve(),J(),we(),h.config.enableTime&&setTimeout(function(){return h.showTimeInput=!0},50),i||"range"===h.config.mode||1!==h.config.showMonths?void 0!==h.selectedDateElem&&void 0===h.hourElement&&h.selectedDateElem&&h.selectedDateElem.focus():L(n),void 0!==h.hourElement&&void 0!==h.hourElement&&h.hourElement.focus(),h.config.closeOnSelect){var l="single"===h.config.mode&&!h.config.enableTime,c="range"===h.config.mode&&2===h.selectedDates.length&&!h.config.enableTime;(l||c)&&de()}Y()}}h.parseDate=D({config:h.config,l10n:h.l10n}),h._handlers=[],h.pluginElements=[],h.loadedPlugins=[],h._bind=F,h._setHoursFromDate=I,h._positionCalendar=le,h.changeMonth=G,h.changeYear=Q,h.clear=function(e,t){void 0===e&&(e=!0);void 0===t&&(t=!0);h.input.value="",void 0!==h.altInput&&(h.altInput.value="");void 0!==h.mobileInput&&(h.mobileInput.value="");h.selectedDates=[],h.latestSelectedDateObj=void 0,!0===t&&(h.currentYear=h._initialDate.getFullYear(),h.currentMonth=h._initialDate.getMonth());h.showTimeInput=!1,!0===h.config.enableTime&&S();h.redraw(),e&&ge("onChange")},h.close=function(){h.isOpen=!1,h.isMobile||(void 0!==h.calendarContainer&&h.calendarContainer.classList.remove("open"),void 0!==h._input&&h._input.classList.remove("active"));ge("onClose")},h._createElement=d,h.destroy=function(){void 0!==h.config&&ge("onDestroy");for(var e=h._handlers.length;e--;){var t=h._handlers[e];t.element.removeEventListener(t.event,t.handler,t.options)}if(h._handlers=[],h.mobileInput)h.mobileInput.parentNode&&h.mobileInput.parentNode.removeChild(h.mobileInput),h.mobileInput=void 0;else if(h.calendarContainer&&h.calendarContainer.parentNode)if(h.config.static&&h.calendarContainer.parentNode){var n=h.calendarContainer.parentNode;if(n.lastChild&&n.removeChild(n.lastChild),n.parentNode){for(;n.firstChild;)n.parentNode.insertBefore(n.firstChild,n);n.parentNode.removeChild(n)}}else h.calendarContainer.parentNode.removeChild(h.calendarContainer);h.altInput&&(h.input.type="text",h.altInput.parentNode&&h.altInput.parentNode.removeChild(h.altInput),delete h.altInput);h.input&&(h.input.type=h.input._type,h.input.classList.remove("flatpickr-input"),h.input.removeAttribute("readonly"),h.input.value="");["_showTimeInput","latestSelectedDateObj","_hideNextMonthArrow","_hidePrevMonthArrow","__hideNextMonthArrow","__hidePrevMonthArrow","isMobile","isOpen","selectedDateElem","minDateHasTime","maxDateHasTime","days","daysContainer","_input","_positionElement","innerContainer","rContainer","monthNav","todayDateElem","calendarContainer","weekdayContainer","prevMonthNav","nextMonthNav","monthsDropdownContainer","currentMonthElement","currentYearElement","navigationCurrentMonth","selectedDateElem","config"].forEach(function(e){try{delete h[e]}catch(e){}})},h.isEnabled=X,h.jumpToDate=A,h.open=function(e,t){void 0===t&&(t=h._positionElement);if(!0===h.isMobile)return e&&(e.preventDefault(),e.target&&e.target.blur()),void 0!==h.mobileInput&&(h.mobileInput.focus(),h.mobileInput.click()),void ge("onOpen");if(h._input.disabled||h.config.inline)return;var n=h.isOpen;h.isOpen=!0,n||(h.calendarContainer.classList.add("open"),h._input.classList.add("active"),ge("onOpen"),le(t));!0===h.config.enableTime&&!0===h.config.noCalendar&&(0===h.selectedDates.length&&ie(),!1!==h.config.allowInput||void 0!==e&&h.timeContainer.contains(e.relatedTarget)||setTimeout(function(){return h.hourElement.select()},50))},h.redraw=ce,h.set=function(e,n){if(null!==e&&"object"==typeof e)for(var a in Object.assign(h.config,e),e)void 0!==ue[a]&&ue[a].forEach(function(e){return e()});else h.config[e]=n,void 0!==ue[e]?ue[e].forEach(function(e){return e()}):t.indexOf(e)>-1&&(h.config[e]=l(n));h.redraw(),we(!1)},h.setDate=function(e,t,n){void 0===t&&(t=!1);void 0===n&&(n=h.config.dateFormat);if(0!==e&&!e||e instanceof Array&&0===e.length)return h.clear(t);fe(e,n),h.showTimeInput=h.selectedDates.length>0,h.latestSelectedDateObj=h.selectedDates[h.selectedDates.length-1],h.redraw(),A(),I(),0===h.selectedDates.length&&h.clear(!1);we(t),t&&ge("onChange")},h.toggle=function(e){if(!0===h.isOpen)return h.close();h.open(e)};var ue={locale:[re,z],showMonths:[q,x,$],minDate:[A],maxDate:[A]};function fe(e,t){var n=[];if(e instanceof Array)n=e.map(function(e){return h.parseDate(e,t)});else if(e instanceof Date||"number"==typeof e)n=[h.parseDate(e,t)];else if("string"==typeof e)switch(h.config.mode){case"single":case"time":n=[h.parseDate(e,t)];break;case"multiple":n=e.split(h.config.conjunction).map(function(e){return h.parseDate(e,t)});break;case"range":n=e.split(h.l10n.rangeSeparator).map(function(e){return h.parseDate(e,t)})}else h.config.errorHandler(new Error("Invalid date supplied: "+JSON.stringify(e)));h.selectedDates=n.filter(function(e){return e instanceof Date&&X(e,!1)}),"range"===h.config.mode&&h.selectedDates.sort(function(e,t){return e.getTime()-t.getTime()})}function me(e){return e.slice().map(function(e){return"string"==typeof e||"number"==typeof e||e instanceof Date?h.parseDate(e,void 0,!0):e&&"object"==typeof e&&e.from&&e.to?{from:h.parseDate(e.from,void 0),to:h.parseDate(e.to,void 0)}:e}).filter(function(e){return e})}function ge(e,t){if(void 0!==h.config){var n=h.config[e];if(void 0!==n&&n.length>0)for(var a=0;n[a]&&a1||"static"===h.config.monthSelectorType?h.monthElements[t].textContent=m(n.getMonth(),h.config.shorthandCurrentMonth,h.l10n)+" ":h.monthsDropdownContainer.value=n.getMonth().toString(),e.value=n.getFullYear().toString()}),h._hidePrevMonthArrow=void 0!==h.config.minDate&&(h.currentYear===h.config.minDate.getFullYear()?h.currentMonth<=h.config.minDate.getMonth():h.currentYearh.config.maxDate.getMonth():h.currentYear>h.config.maxDate.getFullYear()))}function De(e){return h.selectedDates.map(function(t){return h.formatDate(t,e)}).filter(function(e,t,n){return"range"!==h.config.mode||h.config.enableTime||n.indexOf(e)===t}).join("range"!==h.config.mode?h.config.conjunction:h.l10n.rangeSeparator)}function we(e){void 0===e&&(e=!0),void 0!==h.mobileInput&&h.mobileFormatStr&&(h.mobileInput.value=void 0!==h.latestSelectedDateObj?h.formatDate(h.latestSelectedDateObj,h.mobileFormatStr):""),h.input.value=De(h.config.dateFormat),void 0!==h.altInput&&(h.altInput.value=De(h.config.altFormat)),!1!==e&&ge("onValueUpdate")}function be(e){var t=h.prevMonthNav.contains(e.target),n=h.nextMonthNav.contains(e.target);t||n?G(t?-1:1):h.yearElements.indexOf(e.target)>=0?e.target.select():e.target.classList.contains("arrowUp")?h.changeYear(h.currentYear+1):e.target.classList.contains("arrowDown")&&h.changeYear(h.currentYear-1)}return function(){h.element=h.input=f,h.isOpen=!1,function(){var a=["wrap","weekNumbers","allowInput","clickOpens","time_24hr","enableTime","noCalendar","altInput","shorthandCurrentMonth","inline","static","enableSeconds","disableMobile"],i=e({},g,JSON.parse(JSON.stringify(f.dataset||{}))),o={};h.config.parseDate=i.parseDate,h.config.formatDate=i.formatDate,Object.defineProperty(h.config,"enable",{get:function(){return h.config._enable},set:function(e){h.config._enable=me(e)}}),Object.defineProperty(h.config,"disable",{get:function(){return h.config._disable},set:function(e){h.config._disable=me(e)}});var r="time"===i.mode;if(!i.dateFormat&&(i.enableTime||r)){var c=E.defaultConfig.dateFormat||n.dateFormat;o.dateFormat=i.noCalendar||r?"H:i"+(i.enableSeconds?":S":""):c+" H:i"+(i.enableSeconds?":S":"")}if(i.altInput&&(i.enableTime||r)&&!i.altFormat){var d=E.defaultConfig.altFormat||n.altFormat;o.altFormat=i.noCalendar||r?"h:i"+(i.enableSeconds?":S K":" K"):d+" h:i"+(i.enableSeconds?":S":"")+" K"}i.altInputClass||(h.config.altInputClass=h.input.className+" "+h.config.altInputClass),Object.defineProperty(h.config,"minDate",{get:function(){return h.config._minDate},set:oe("min")}),Object.defineProperty(h.config,"maxDate",{get:function(){return h.config._maxDate},set:oe("max")});var s=function(e){return function(t){h.config["min"===e?"_minTime":"_maxTime"]=h.parseDate(t,"H:i")}};Object.defineProperty(h.config,"minTime",{get:function(){return h.config._minTime},set:s("min")}),Object.defineProperty(h.config,"maxTime",{get:function(){return h.config._maxTime},set:s("max")}),"time"===i.mode&&(h.config.noCalendar=!0,h.config.enableTime=!0),Object.assign(h.config,o,i);for(var u=0;u-1?h.config[p]=l(m[p]).map(y).concat(h.config[p]):void 0===i[p]&&(h.config[p]=m[p])}ge("onParseConfig")}(),re(),h.input=h.config.wrap?f.querySelector("[data-input]"):f,h.input?(h.input._type=h.input.type,h.input.type="text",h.input.classList.add("flatpickr-input"),h._input=h.input,h.config.altInput&&(h.altInput=d(h.input.nodeName,h.config.altInputClass),h._input=h.altInput,h.altInput.placeholder=h.input.placeholder,h.altInput.disabled=h.input.disabled,h.altInput.required=h.input.required,h.altInput.tabIndex=h.input.tabIndex,h.altInput.type="text",h.input.setAttribute("type","hidden"),!h.config.static&&h.input.parentNode&&h.input.parentNode.insertBefore(h.altInput,h.input.nextSibling)),h.config.allowInput||h._input.setAttribute("readonly","readonly"),h._positionElement=h.config.positionElement||h._input):h.config.errorHandler(new Error("Invalid input element specified")),function(){h.selectedDates=[],h.now=h.parseDate(h.config.now)||new Date;var e=h.config.defaultDate||("INPUT"!==h.input.nodeName&&"TEXTAREA"!==h.input.nodeName||!h.input.placeholder||h.input.value!==h.input.placeholder?h.input.value:null);e&&fe(e,h.config.dateFormat),h._initialDate=h.selectedDates.length>0?h.selectedDates[0]:h.config.minDate&&h.config.minDate.getTime()>h.now.getTime()?h.config.minDate:h.config.maxDate&&h.config.maxDate.getTime()0&&(h.latestSelectedDateObj=h.selectedDates[0]),void 0!==h.config.minTime&&(h.config.minTime=h.parseDate(h.config.minTime,"H:i")),void 0!==h.config.maxTime&&(h.config.maxTime=h.parseDate(h.config.maxTime,"H:i")),h.minDateHasTime=!!h.config.minDate&&(h.config.minDate.getHours()>0||h.config.minDate.getMinutes()>0||h.config.minDate.getSeconds()>0),h.maxDateHasTime=!!h.config.maxDate&&(h.config.maxDate.getHours()>0||h.config.maxDate.getMinutes()>0||h.config.maxDate.getSeconds()>0),Object.defineProperty(h,"showTimeInput",{get:function(){return h._showTimeInput},set:function(e){h._showTimeInput=e,h.calendarContainer&&c(h.calendarContainer,"showTimeInput",e),h.isOpen&&le()}})}(),h.utils={getDaysInMonth:function(e,t){return void 0===e&&(e=h.currentMonth),void 0===t&&(t=h.currentYear),1===e&&(t%4==0&&t%100!=0||t%400==0)?29:h.l10n.daysInMonth[e]}},h.isMobile||function(){var e=window.document.createDocumentFragment();if(h.calendarContainer=d("div","flatpickr-calendar"),h.calendarContainer.tabIndex=-1,!h.config.noCalendar){if(e.appendChild((h.monthNav=d("div","flatpickr-months"),h.yearElements=[],h.monthElements=[],h.prevMonthNav=d("span","flatpickr-prev-month"),h.prevMonthNav.innerHTML=h.config.prevArrow,h.nextMonthNav=d("span","flatpickr-next-month"),h.nextMonthNav.innerHTML=h.config.nextArrow,q(),Object.defineProperty(h,"_hidePrevMonthArrow",{get:function(){return h.__hidePrevMonthArrow},set:function(e){h.__hidePrevMonthArrow!==e&&(c(h.prevMonthNav,"flatpickr-disabled",e),h.__hidePrevMonthArrow=e)}}),Object.defineProperty(h,"_hideNextMonthArrow",{get:function(){return h.__hideNextMonthArrow},set:function(e){h.__hideNextMonthArrow!==e&&(c(h.nextMonthNav,"flatpickr-disabled",e),h.__hideNextMonthArrow=e)}}),h.currentYearElement=h.yearElements[0],ve(),h.monthNav)),h.innerContainer=d("div","flatpickr-innerContainer"),h.config.weekNumbers){var t=function(){h.calendarContainer.classList.add("hasWeeks");var e=d("div","flatpickr-weekwrapper");e.appendChild(d("span","flatpickr-weekday",h.l10n.weekAbbreviation));var t=d("div","flatpickr-weeks");return e.appendChild(t),{weekWrapper:e,weekNumbers:t}}(),n=t.weekWrapper,a=t.weekNumbers;h.innerContainer.appendChild(n),h.weekNumbers=a,h.weekWrapper=n}h.rContainer=d("div","flatpickr-rContainer"),h.rContainer.appendChild($()),h.daysContainer||(h.daysContainer=d("div","flatpickr-days"),h.daysContainer.tabIndex=-1),J(),h.rContainer.appendChild(h.daysContainer),h.innerContainer.appendChild(h.rContainer),e.appendChild(h.innerContainer)}h.config.enableTime&&e.appendChild(function(){h.calendarContainer.classList.add("hasTime"),h.config.noCalendar&&h.calendarContainer.classList.add("noCalendar"),h.timeContainer=d("div","flatpickr-time"),h.timeContainer.tabIndex=-1;var e=d("span","flatpickr-time-separator",":"),t=u("flatpickr-hour",{"aria-label":h.l10n.hourAriaLabel});h.hourElement=t.getElementsByTagName("input")[0];var n=u("flatpickr-minute",{"aria-label":h.l10n.minuteAriaLabel});if(h.minuteElement=n.getElementsByTagName("input")[0],h.hourElement.tabIndex=h.minuteElement.tabIndex=-1,h.hourElement.value=i(h.latestSelectedDateObj?h.latestSelectedDateObj.getHours():h.config.time_24hr?h.config.defaultHour:function(e){switch(e%24){case 0:case 12:return 12;default:return e%12}}(h.config.defaultHour)),h.minuteElement.value=i(h.latestSelectedDateObj?h.latestSelectedDateObj.getMinutes():h.config.defaultMinute),h.hourElement.setAttribute("step",h.config.hourIncrement.toString()),h.minuteElement.setAttribute("step",h.config.minuteIncrement.toString()),h.hourElement.setAttribute("min",h.config.time_24hr?"0":"1"),h.hourElement.setAttribute("max",h.config.time_24hr?"23":"12"),h.minuteElement.setAttribute("min","0"),h.minuteElement.setAttribute("max","59"),h.timeContainer.appendChild(t),h.timeContainer.appendChild(e),h.timeContainer.appendChild(n),h.config.time_24hr&&h.timeContainer.classList.add("time24hr"),h.config.enableSeconds){h.timeContainer.classList.add("hasSeconds");var a=u("flatpickr-second");h.secondElement=a.getElementsByTagName("input")[0],h.secondElement.value=i(h.latestSelectedDateObj?h.latestSelectedDateObj.getSeconds():h.config.defaultSeconds),h.secondElement.setAttribute("step",h.minuteElement.getAttribute("step")),h.secondElement.setAttribute("min","0"),h.secondElement.setAttribute("max","59"),h.timeContainer.appendChild(d("span","flatpickr-time-separator",":")),h.timeContainer.appendChild(a)}return h.config.time_24hr||(h.amPM=d("span","flatpickr-am-pm",h.l10n.amPM[o((h.latestSelectedDateObj?h.hourElement.value:h.config.defaultHour)>11)]),h.amPM.title=h.l10n.toggleTitle,h.amPM.tabIndex=-1,h.timeContainer.appendChild(h.amPM)),h.timeContainer}()),c(h.calendarContainer,"rangeMode","range"===h.config.mode),c(h.calendarContainer,"animate",!0===h.config.animate),c(h.calendarContainer,"multiMonth",h.config.showMonths>1),h.calendarContainer.appendChild(e);var r=void 0!==h.config.appendTo&&void 0!==h.config.appendTo.nodeType;if((h.config.inline||h.config.static)&&(h.calendarContainer.classList.add(h.config.inline?"inline":"static"),h.config.inline&&(!r&&h.element.parentNode?h.element.parentNode.insertBefore(h.calendarContainer,h._input.nextSibling):void 0!==h.config.appendTo&&h.config.appendTo.appendChild(h.calendarContainer)),h.config.static)){var l=d("div","flatpickr-wrapper");h.element.parentNode&&h.element.parentNode.insertBefore(l,h.element),l.appendChild(h.element),h.altInput&&l.appendChild(h.altInput),l.appendChild(h.calendarContainer)}h.config.static||h.config.inline||(void 0!==h.config.appendTo?h.config.appendTo:window.document.body).appendChild(h.calendarContainer)}(),function(){if(h.config.wrap&&["open","close","toggle","clear"].forEach(function(e){Array.prototype.forEach.call(h.element.querySelectorAll("[data-"+e+"]"),function(t){return F(t,"click",h[e])})}),h.isMobile)!function(){var e=h.config.enableTime?h.config.noCalendar?"time":"datetime-local":"date";h.mobileInput=d("input",h.input.className+" flatpickr-mobile"),h.mobileInput.step=h.input.getAttribute("step")||"any",h.mobileInput.tabIndex=1,h.mobileInput.type=e,h.mobileInput.disabled=h.input.disabled,h.mobileInput.required=h.input.required,h.mobileInput.placeholder=h.input.placeholder,h.mobileFormatStr="datetime-local"===e?"Y-m-d\\TH:i:S":"date"===e?"Y-m-d":"H:i:S",h.selectedDates.length>0&&(h.mobileInput.defaultValue=h.mobileInput.value=h.formatDate(h.selectedDates[0],h.mobileFormatStr)),h.config.minDate&&(h.mobileInput.min=h.formatDate(h.config.minDate,"Y-m-d")),h.config.maxDate&&(h.mobileInput.max=h.formatDate(h.config.maxDate,"Y-m-d")),h.input.type="hidden",void 0!==h.altInput&&(h.altInput.type="hidden");try{h.input.parentNode&&h.input.parentNode.insertBefore(h.mobileInput,h.input.nextSibling)}catch(e){}F(h.mobileInput,"change",function(e){h.setDate(e.target.value,!1,h.mobileFormatStr),ge("onChange"),ge("onClose")})}();else{var e=r(ae,50);h._debouncedChange=r(Y,M),h.daysContainer&&!/iPhone|iPad|iPod/i.test(navigator.userAgent)&&F(h.daysContainer,"mouseover",function(e){"range"===h.config.mode&&ne(e.target)}),F(window.document.body,"keydown",te),h.config.inline||h.config.static||F(window,"resize",e),void 0!==window.ontouchstart?F(window.document,"touchstart",Z):F(window.document,"mousedown",N(Z)),F(window.document,"focus",Z,{capture:!0}),!0===h.config.clickOpens&&(F(h._input,"focus",h.open),F(h._input,"mousedown",N(h.open))),void 0!==h.daysContainer&&(F(h.monthNav,"mousedown",N(be)),F(h.monthNav,["keyup","increment"],_),F(h.daysContainer,"mousedown",N(se))),void 0!==h.timeContainer&&void 0!==h.minuteElement&&void 0!==h.hourElement&&(F(h.timeContainer,["increment"],T),F(h.timeContainer,"blur",T,{capture:!0}),F(h.timeContainer,"mousedown",N(P)),F([h.hourElement,h.minuteElement],["focus","click"],function(e){return e.target.select()}),void 0!==h.secondElement&&F(h.secondElement,"focus",function(){return h.secondElement&&h.secondElement.select()}),void 0!==h.amPM&&F(h.amPM,"mousedown",N(function(e){T(e),Y()})))}}(),(h.selectedDates.length||h.config.noCalendar)&&(h.config.enableTime&&I(h.config.noCalendar?h.latestSelectedDateObj||h.config.minDate:void 0),we(!1)),x(),h.showTimeInput=h.selectedDates.length>0||h.config.noCalendar;var a=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);!h.isMobile&&a&&le(),ge("onReady")}(),h}function x(e,t){for(var n=Array.prototype.slice.call(e).filter(function(e){return e instanceof HTMLElement}),a=[],i=0;i