field("add_time")->select(); foreach ($zhuce_list as $key => $value) { # code... $user_zhuce_time = $value['add_time']; if ($jinri_end_time > $user_zhuce_time and $user_zhuce_time > $jinri_start_time) { $zc_jilei++; $zc_jinri++; $zc_sanri++; $zc_yizhou++; $zc_yiyue++; } elseif ($zuo_end_time > $user_zhuce_time and $user_zhuce_time > $zuo_start_time) { $zc_jilei++; $zc_zuori++; $zc_yiyue++; } elseif ($san_end_time > $user_zhuce_time and $user_zhuce_time > $san_start_time) { $zc_jilei++; $zc_sanri++; $zc_yiyue++; } elseif ($zhou_end_time > $user_zhuce_time and $user_zhuce_time > $zhou_start_time) { $zc_jilei++; $zc_yizhou++; $zc_yiyue++; } elseif ($yue_end_time > $user_zhuce_time and $user_zhuce_time > $yue_start_time) { $zc_jilei++; $zc_yiyue++; } elseif ($user_zhuce_time < $yue_start_time) { $zc_jilei++; } } //付费人数 和钱数 $user_list = M("pay_test")->field("uid,pay_time,amount")->where("order_type='已支付'")->select(); foreach ($user_list as $key1 => $value1) { $user_ff_time = $value1['pay_time']; $fufei_jine = $value1['amount']; if ($jinri_end_time > $user_ff_time and $user_ff_time > $jinri_start_time) { $ffm_jilei += $fufei_jine; $ffm_jinri += $fufei_jine; $ffm_sanri += $fufei_jine; $ffm_yizhou += $fufei_jine; $ffm_yiyue += $fufei_jine; } elseif ($zuo_end_time > $user_ff_time and $user_ff_time > $zuo_start_time) { $ffm_yiyue += $fufei_jine; $ffm_jilei += $fufei_jine; $ffm_zuori += $fufei_jine; $ffm_yizhou += $fufei_jine; } elseif ($san_end_time > $user_ff_time and $user_ff_time > $san_start_time) { $ffm_yiyue += $fufei_jine; $ffm_jilei += $fufei_jine; $ffm_sanri += $fufei_jine; $ffm_yizhou += $fufei_jine; } elseif ($zhou_end_time > $user_ff_time and $user_ff_time > $zhou_start_time) { $ffm_yiyue += $fufei_jine; $ffm_jilei += $fufei_jine; $ffm_yizhou += $fufei_jine; } elseif ($yue_end_time > $user_ff_time and $user_ff_time > $yue_start_time) { $ffm_jilei += $fufei_jine; $ffm_yiyue += $fufei_jine; } else { //} else ($user_zhuce_time < $yue_start_time) { $ffm_jilei += $fufei_jine; } } //今日 $todaytime = strtotime(date("Y-m-d", time()) . "00:00:00"); //三日 $threedaytime = strtotime(date("Y-m-d", strtotime("-3 day")) . "00:00:00"); //周 $weekdaytime = strtotime(date("Y-m-d", strtotime("-1 week")) . "00:00:00"); //14日 $fourteendaytime = strtotime(date("Y-m-d", strtotime("-14 day")) . "00:00:00"); $yueday_time = strtotime(date("Y-m-d", strtotime("-30 day")) . "00:00:00"); $renshu_jin = M("pay_test")->where("pay_time>='$todaytime'")->field("uid")->group("uid")->select(); $renshu_zuo = M("pay_test")->where("pay_time>='$zuo_start_time' and pay_time<='$zuo_end_time'")->field("uid")->group("uid")->select(); $renshu_san = M("pay_test")->where("pay_time>='$threedaytime'")->field("uid")->group("uid")->select();; $renshu_zhou = M("pay_test")->where("pay_time>='$weekdaytime'")->field("uid")->group("uid")->select(); $renshu_yue = M("pay_test")->where("pay_time>='$yueday_time'")->field("uid")->group("uid")->select(); $renshu_jilei = M("pay_test")->field("uid")->group("uid")->select(); $huoyue_jin = M("huoyue_list")->where("time>='$jinri_start_time' and time<='$jinri_end_time'")->field("uid")->group("uid")->select(); $huoyue_zuo = M("huoyue_list")->where("time>='$zuo_start_time' and time<='$zuo_end_time'")->field("uid")->group("uid")->select(); $huoyue_san = M("huoyue_list")->where("time>='$san_start_time' and time<='$san_end_time' ")->field("uid")->group("uid")->select();; $huoyue_zhou = M("huoyue_list")->where("time>='$zhou_start_time' and time<='$zhou_end_time'")->field("uid")->group("uid")->select(); $huoyue_yue = M("huoyue_list")->where("time>='$yue_start_time' and time<='$yue_end_time'")->field("uid")->group("uid")->select(); $huoyue_jilei = M("huoyue_list")->field("uid")->group("uid")->select(); $yizhoulist['jinri'] = $zc_jinri; $yizhoulist['zuori'] = $zc_zuori; $yizhoulist['sanri'] = $zc_sanri; $yizhoulist['zhou'] = $zc_yizhou; $yizhoulist['yue'] = $zc_yiyue; $yizhoulist['jilei'] = $zc_jilei; $fufei_num['jinri_num'] = count($renshu_jin); $fufei_num['zuori_num'] = count($renshu_zuo); $fufei_num['sanri_num'] = count($renshu_san); $fufei_num['zhou_num'] = count($renshu_zhou); $fufei_num['yue_num'] = count($renshu_yue); $fufei_num['jilei_num'] = count($renshu_jilei); $fufei_number['jinri_people'] = $ffm_jinri; $fufei_number['zuori_people'] = $ffm_zuori; $fufei_number['sanri_people'] = $ffm_sanri; $fufei_number['zhou_people'] = $ffm_yizhou; $fufei_number['yue_people'] = $ffm_yiyue; $fufei_number['jilei_people'] = $ffm_jilei; $huoyue_num['jinriAAA_num'] = count($huoyue_jin); $huoyue_num['zuoriAAA_num'] = count($huoyue_zuo); $huoyue_num['sanriAAA_num'] = count($huoyue_san); $huoyue_num['zhouAAA_num'] = count($huoyue_zhou); $huoyue_num['yueAAA_num'] = count($huoyue_yue); $huoyue_num['jileiAAA_num'] = count($huoyue_jilei); $shuzu_list = array($yizhoulist, $fufei_number, $fufei_num, $huoyue_num); $data['code'] = '200'; $data['status'] = '1'; $data['message'] = ''; $data['data'] = $shuzu_list; echo json_encode($data); } public function slUserStatistics() { // 指定允许其他域名访问 // header('Access-Control-Allow-Origin:*'); // 响应类型 header('Access-Control-Allow-Methods:POST'); // 响应头设置 header('Access-Control-Allow-Headers:x-requested-with,content-type'); if (!empty($_POST)) { $token = $_POST['token']; //b8e3bb6ef8747d7 if ($token != 'b8e3bb6ef8747d7') { $data['code'] = '203'; $data['msg'] = 'token错误'; echo json_encode($data); die; } //今日 $todaytime = strtotime(date("Y-m-d", time()) . "00:00:00"); //三日 $threedaytime = strtotime(date("Y-m-d", strtotime("-3 day")) . "00:00:00"); //周 $weekdaytime = strtotime(date("Y-m-d", strtotime("-1 week")) . "00:00:00"); //14日 $fourteendaytime = strtotime(date("Y-m-d", strtotime("-14 day")) . "00:00:00"); /** * 注册人数统计 */ //累计新增注册 $arr['totaluser'] = M("slgj_user")->count(); //今日新增注册 $arr['todayuser'] = M("slgj_user")->where("registertime>='$todaytime'")->count(); //3日新增注册 $arr['threedayuser'] = M("slgj_user")->where("registertime>='$threedaytime'")->count(); //周新增注册 $arr['weekuser'] = M("slgj_user")->where("registertime>='$weekdaytime'")->count(); //14日新增注册 $arr['fourteenuser'] = M("slgj_user")->where("registertime>='$fourteendaytime'")->count(); /** * 登录人数统计 */ //今日登录人数 $arr['todayloginuser'] = count(M("slgj_user_sessid")->where("time>='$todaytime' and uid!=0")->group("uid")->getField("uid", true)); //3日登录人数 $arr['threedayloginuser'] = count(M("slgj_user_sessid")->where("time>='$threedaytime' and uid!=0")->group("uid")->getField("uid", true)); //周登录人数 $arr['weekloginuser'] = count(M("slgj_user_sessid")->where("time>='$weekdaytime' and uid!=0")->group("uid")->getField("uid", true)); //14日登录人数 $arr['fourteenloginuser'] = count(M("slgj_user_sessid")->where("time>='$fourteendaytime' and uid!=0")->group("uid")->getField("uid", true)); /** * 留存人数统计 */ //3日留存 $arr['threedaykeep'] = "0"; //7日留存 $arr['weekdaykeep'] = "0"; //14日留存 $arr['fourteenkeep'] = "0"; $data['code'] = '200'; $data['msg'] = '请求成功'; $data['data'] = $arr; echo json_encode($data); } else { $data['code'] = '202'; $data['msg'] = '参数不正确'; echo json_encode($data); die; } } //sl后台用户统计 public function slUserInfo() { // 指定允许其他域名访问 // header('Access-Control-Allow-Origin:*'); // 响应类型 header('Access-Control-Allow-Methods:POST'); // 响应头设置 header('Access-Control-Allow-Headers:x-requested-with,content-type'); if (!empty($_POST)) { $token = $_POST['token']; //b8e3bb6ef8747d7 if ($token != 'b8e3bb6ef8747d7') { $data['code'] = '203'; $data['msg'] = 'token错误'; echo json_encode($data); die; } $page = $_POST['page']; $size = $_POST['size']; $arr = M("slgj_user")->field("id,account,registertime,lastlogintime")->page($page, $size)->order("id desc")->select(); if ($arr) { $total = M("slgj_user")->count(); foreach ($arr as $k => $v) { $arr[$k]['registertime'] = date("m.d H:i", $v['registertime']); $lastlogintime = M("slgj_user_sessid")->where(array("uid" => $v['id']))->order("id desc")->find(); if ($lastlogintime) { $arr[$k]['lastlogintime'] = date("m.d H:i", $lastlogintime['time']); } else { $arr[$k]['lastlogintime'] = date("m.d H:i", $v['lastlogintime']); } } $data['code'] = '200'; $data['msg'] = '请求成功'; $data['data'] = $arr; $data['total'] = $total; echo json_encode($data); } else { $data['code'] = '201'; $data['msg'] = '暂无数据'; $data['data'] = array(); $data['total'] = "0"; echo json_encode($data); } } else { $data['code'] = '202'; $data['msg'] = '参数不正确'; echo json_encode($data); die; } } //sl后台用户信息 public function slUserFeedback() { // 指定允许其他域名访问 // header('Access-Control-Allow-Origin:*'); // 响应类型 header('Access-Control-Allow-Methods:POST'); // 响应头设置 header('Access-Control-Allow-Headers:x-requested-with,content-type'); if (!empty($_POST)) { $token = $_POST['token']; //b8e3bb6ef8747d7 if ($token != 'b8e3bb6ef8747d7') { $data['code'] = '203'; $data['msg'] = 'token错误'; echo json_encode($data); die; } $page = $_POST['page']; $size = $_POST['size']; $arr = M("slgj_user_feedback")->page($page, $size)->order("id desc")->select(); if ($arr) { $total = M("slgj_user_feedback")->count(); foreach ($arr as $k => $v) { $arr[$k]['account'] = M("slgj_user")->where(array("uid" => $v['uid']))->find()['account']; $arr[$k]['time'] = date("m.d H:i", $v['time']); if ($v['reply_time'] == "") { $arr[$k]['is_reply'] = "回复"; } else { $arr[$k]['is_reply'] = "已回复"; } } $data['code'] = '200'; $data['msg'] = '请求成功'; $data['data'] = $arr; $data['total'] = $total; echo json_encode($data); } else { $data['code'] = '201'; $data['msg'] = '暂无数据'; $data['data'] = array(); $data['total'] = "0"; echo json_encode($data); } } else { $data['code'] = '202'; $data['msg'] = '参数不正确'; echo json_encode($data); die; } } //视频列表和视频详情广告展示 public function advertShowStart() { // 指定允许其他域名访问 header('Access-Control-Allow-Origin:*'); // 响应类型 header('Access-Control-Allow-Methods:POST'); // 响应头设置 header('Access-Control-Allow-Headers:x-requested-with,content-type'); if (!empty($_POST)) { $token = $_POST['token']; //b8e3bb6ef8747d7 if ($token != 'b8e3bb6ef8747d7') { $data['code'] = '203'; $data['msg'] = 'token错误'; echo json_encode($data); die; } $page = $_POST['page']; $size = $_POST['size']; $arr = M("slgj_advert_list")->page($page, $size)->where("type='片头广告'")->select(); if ($arr) { $total = M("slgj_advert_list")->where("type='片头广告'")->count(); $data['code'] = '200'; $data['msg'] = '请求成功'; $data['data'] = $arr; $data['total'] = $total; echo json_encode($data); } else { $data['code'] = '201'; $data['msg'] = '暂无数据'; $data['data'] = array(); $data['total'] = "0"; echo json_encode($data); } } else { $data['code'] = '202'; $data['msg'] = '参数不正确'; echo json_encode($data); die; } } //视频开头广告展示 public function videoAdvertAdd() { // 指定允许其他域名访问 // header('Access-Control-Allow-Origin:*'); // 响应类型 header('Access-Control-Allow-Methods:POST'); // 响应头设置 header('Access-Control-Allow-Headers:x-requested-with,content-type'); // echo PHP_EOL.'22'; if (!empty($_POST)) { $token = $_POST['token']; //b8e3bb6ef8747d7 if ($token != 'b8e3bb6ef8747d7') { $data['code'] = '203'; $data['msg'] = 'token错误'; echo json_encode($data); die; } $arr['type'] = $type = $_POST['type']; //广告类型 视频列表和视频详情/视频开头 $count = M("slgj_advert_list")->where("type='$type'")->count(); if ($count == "0") { $arr['number'] = "00" . ($count + 1); } else { $numbers = M("slgj_advert_list")->where("type='$type'")->order("number desc")->find()['number']; $numb = $numbers + 1; if ($numb > 0 and $numb <= 9) { $arr['number'] = "00" . $numb; } elseif ($numb > 9 and $numb <= 99) { $arr['number'] = "0" . $numb; } else { $arr['number'] = $numb; } } $arr['jump_link'] = $_POST['jump_link']; //跳转链接 $arr['content'] = $_POST['content']; //备注 $img = $_FILES['img']; $upload = new \Think\Upload(); // 实例化上传类 $upload->maxSize = 0; //设置附件上传大小 $upload->exts = array('jpg', 'gif', 'png', 'jpeg');// 设置附件上传类型 $upload->rootPath = './Public/'; // 设置附件上传根目录 $upload->savePath = 'backroundiMg/'; // 设置附件上传附目录 $path = "https://www.aa9169.com/Public/"; $info = $upload->uploadOne($img); // 上传单个文件 if (!$info) { // 上传错误提示错误信息 $this->error($upload->getError()); } else { $imgs = $path . $info['savepath'] . $info['savename']; $arr['img'] = $imgs; } $ret = M("slgj_advert_list")->add($arr); if ($ret) { $data['code'] = '200'; $data['msg'] = '请求成功'; echo json_encode($data); } else { $data['code'] = '201'; $data['msg'] = '请求失败'; echo json_encode($data); } } else { $data['code'] = '202'; $data['msg'] = '参数不正确'; echo json_encode($data); die; } } /** * 版本: * 新增/更新: * 简述: * @param $templateid [] * @return $type 消息类型 */ public function save_adv_yn_browse(){ header('Content-Type:text/json;charset=utf-8'); header('Access-Control-Allow-Origin:*'); header("Access-Control-Allow-Headers:token,Origin, X-Requested-With, Content-Type, Accept"); header('Access-Control-Allow-Methods:POST'); header('Access-Control-Expose-Headers:*'); if (!empty($_POST)){ $id = $_POST['adv_id']; $yn = $_POST['yn']; switch ($yn) { case 'y': $arr['yn_browse'] = 1; break; case 'n': $arr['yn_browse'] = 0; break; default: $arr['yn_browse'] = 1; } $ret = M("slgj_advert_list")->where("id='$id'")->save($arr); if ($ret){ $data['message'] = 'ok'; echo json_encode($data); }else{ $data['message'] = 'error'; echo json_encode($data); } }else{ echo $this->returnData(); } } /** * 版本: * 新增/更新: * 简述: * @param $templateid [] * @return $type 消息类型 */ public function error_video_list_show(){ header('Content-Type:text/json;charset=utf-8'); header('Access-Control-Allow-Origin:*'); header("Access-Control-Allow-Headers:token,Origin, X-Requested-With, Content-Type, Accept"); header('Access-Control-Allow-Methods:POST'); header('Access-Control-Expose-Headers:*'); if (!empty($_POST)){ $token = $_POST['token']; //b8e3bb6ef8747d7 if ($token != 'b8e3bb6ef8747d7') { $data['code'] = '203'; $data['msg'] = 'token错误'; echo json_encode($data); die; } $page = $_POST['page']; $page_one = ($page - 1) * 50; $error_list_video = M("error_videos_list")->order("id desc")->LIMIT($page_one, 50)->select(); if (!empty($error_list_video)){ $data['code'] = '200'; $data['status'] = '1'; $data['message'] = 'ok'; $data['all_count'] = M("error_videos_list")->where("id>0")->count(); $data['error_count'] = M("error_videos_list")->where("type=0")->count(); $data['data'] = $error_list_video; echo json_encode($data); }else{ $data['message'] = 'error'; echo json_encode($data); } }else{ echo $this->returnData(); } } /** * 版本: * 新增/更新: * 简述: * @param $templateid [] * @return $type 消息类型 */ public function save_error_video_type(){ header('Content-Type:text/json;charset=utf-8'); header('Access-Control-Allow-Origin:*'); header("Access-Control-Allow-Headers:token,Origin, X-Requested-With, Content-Type, Accept"); header('Access-Control-Allow-Methods:POST'); header('Access-Control-Expose-Headers:*'); if (!empty($_POST)){ $eid = $_POST['id']; $vid = $_POST['v_id']; $error_type['type'] =1; $yn_save = M("error_videos_list")->where("v_id=$vid")->save($error_type); if ($yn_save){ $data['message'] = 'ok'; echo json_encode($data); }else{ $data['message'] = 'error'; echo json_encode($data); } }else{ echo $this->returnData(); } } /** * 版本: * 新增/更新: * 简述:广告数量 * @param $templateid [] * @return $type 消息类型 */ public function adv_count_show(){ header('Content-Type:text/json;charset=utf-8'); header('Access-Control-Allow-Origin:*'); header("Access-Control-Allow-Headers:token,Origin, X-Requested-With, Content-Type, Accept"); header('Access-Control-Allow-Methods:POST'); header('Access-Control-Expose-Headers:*'); if (!empty($_POST)){ $token = $_POST['token']; //b8e3bb6ef8747d7 if ($token != 'b8e3bb6ef8747d7') { $data['code'] = '203'; $data['msg'] = 'token错误'; echo json_encode($data); die; } $start_adv = M("slgj_advert_list")->where("type='片头广告'")->field('id')->count(); $videolist_adv = M("slgj_advert_list")->where("type='视频列表广告'")->field('id')->count(); $adv_list = array( 'start_adv' =>$start_adv, 'videolist_adv' =>$videolist_adv ); $data['code'] = '200'; $data['status'] = '1'; $data['message'] = 'ok'; $data['data'] = $adv_list; echo json_encode($data); }else{ echo $this->returnData(); } } //广告添加 public function advertShowDetailOne() { // 指定允许其他域名访问 header('Access-Control-Allow-Origin:*'); // 响应类型 header('Access-Control-Allow-Methods:POST'); // 响应头设置 header('Access-Control-Allow-Headers:x-requested-with,content-type'); if (!empty($_POST)) { $token = $_POST['token']; //b8e3bb6ef8747d7 if ($token != 'b8e3bb6ef8747d7') { $data['code'] = '203'; $data['msg'] = 'token错误'; echo json_encode($data); die; } $id = $_POST['advert_id']; $arr = M("slgj_advert_list")->where("id='$id'")->find(); if ($arr) { $data['code'] = '200'; $data['msg'] = '请求成功'; $data['data'] = $arr; echo json_encode($data); } else { $data['code'] = '201'; $data['msg'] = '暂无数据'; $data['data'] = array(); echo json_encode($data); } } else { $data['code'] = '202'; $data['msg'] = '参数不正确'; echo json_encode($data); die; } } //编辑广告时展示单条数据 //修改广告 public function videoAdvertDetail() { // 指定允许其他域名访问 // header('Access-Control-Allow-Origin:*'); // 响应类型 header('Access-Control-Allow-Methods:POST'); // 响应头设置 header('Access-Control-Allow-Headers:x-requested-with,content-type'); if (!empty($_POST)) { $token = $_POST['token']; //b8e3bb6ef8747d7 if ($token != 'b8e3bb6ef8747d7') { $data['code'] = '203'; $data['msg'] = 'token错误'; echo json_encode($data); die; } $id = $_POST['advert_id']; $arr['jump_link'] = $_POST['jump_link']; //跳转链接 $arr['content'] = $_POST['content']; //备注 $oldimg = M("slgj_advert_list")->where("id='$id'")->find()['img']; $img = $_FILES['img']; if ($img == '' || $img == "undefined") { $arr['img'] = $oldimg; } else { $upload = new \Think\Upload(); // 实例化上传类 $upload->maxSize = 0; //设置附件上传大小 $upload->exts = array('jpg', 'gif', 'png', 'jpeg');// 设置附件上传类型 $upload->rootPath = './Public/'; // 设置附件上传根目录 $upload->savePath = 'backroundiMg/'; // 设置附件上传附目录 $path = "https://www.aa9169.com/Public/"; $info = $upload->uploadOne($img); // 上传单个文件 if (!$info) { // 上传错误提示错误信息 $this->error($upload->getError()); } else { $imgs = $path . $info['savepath'] . $info['savename']; $arr['img'] = $imgs; } } $ret = M("slgj_advert_list")->where("id='$id'")->save($arr); if ($ret) { // $this->unlink($oldimg); $data['code'] = '200'; $data['msg'] = '请求成功'; echo json_encode($data); } else { $data['code'] = '201'; $data['msg'] = '请求失败'; echo json_encode($data); } } else { $data['code'] = '202'; $data['msg'] = '参数不正确'; echo json_encode($data); die; } } //视频广告编辑 public function videoAdvertDelete() { // 指定允许其他域名访问 // header('Access-Control-Allow-Origin:*'); // 响应类型 header('Access-Control-Allow-Methods:POST'); // 响应头设置 header('Access-Control-Allow-Headers:x-requested-with,content-type'); if (!empty($_POST)) { $token = $_POST['token']; //b8e3bb6ef8747d7 if ($token != 'b8e3bb6ef8747d7') { $data['code'] = '203'; $data['msg'] = 'token错误'; echo json_encode($data); die; } $id = $_POST['advert_id']; $oldimg = M("slgj_advert_list")->where("id='$id'")->find()['img']; $ret = M("slgj_advert_list")->where("id='$id'")->delete(); if ($ret) { $this->unlink($oldimg); $data['code'] = '200'; $data['msg'] = '请求成功'; echo json_encode($data); } else { $data['code'] = '201'; $data['msg'] = '请求失败'; echo json_encode($data); } } else { $data['code'] = '202'; $data['msg'] = '参数不正确'; echo json_encode($data); die; } } //删除服务器上的图片 public function unlink($img) { $str = substr($img, 23); $filename = "./" . $str; @unlink($filename); } //视频广告删除 public function backSetDetailOne() { // 指定允许其他域名访问 // header('Access-Control-Allow-Origin:*'); // 响应类型 header('Access-Control-Allow-Methods:POST'); // 响应头设置 header('Access-Control-Allow-Headers:x-requested-with,content-type'); if (!empty($_POST)) { $token = $_POST['token']; //b8e3bb6ef8747d7 if ($token != 'b8e3bb6ef8747d7') { $data['code'] = '203'; $data['msg'] = 'token错误'; echo json_encode($data); die; } $id = $_POST['back_id']; $arr = M("slgj_backgroud_setting")->where("id='$id'")->find(); if ($arr) { $data['code'] = '200'; $data['msg'] = '请求成功'; $data['data'] = $arr; echo json_encode($data); } else { $data['code'] = '201'; $data['msg'] = '暂无数据'; $data['data'] = array(); echo json_encode($data); } } else { $data['code'] = '202'; $data['msg'] = '参数不正确'; echo json_encode($data); die; } } //后台设置展示单条数据 public function backSetShowAll() { // 指定允许其他域名访问 // header('Access-Control-Allow-Origin:*'); // 响应类型 header('Access-Control-Allow-Methods:POST'); // 响应头设置 header('Access-Control-Allow-Headers:x-requested-with,content-type'); if (!empty($_POST)) { $token = $_POST['token']; //b8e3bb6ef8747d7 if ($token != 'b8e3bb6ef8747d7') { $data['code'] = '203'; $data['msg'] = 'token错误'; echo json_encode($data); die; } $arr = M("slgj_backgroud_setting")->select(); if ($arr) { $data['code'] = '200'; $data['msg'] = '请求成功'; $data['data'] = $arr; echo json_encode($data); } else { $data['code'] = '201'; $data['msg'] = '暂无数据'; $data['data'] = array(); echo json_encode($data); } } else { $data['code'] = '202'; $data['msg'] = '参数不正确'; echo json_encode($data); die; } } //后台设置展示所有数据 public function backgroundSettingDetail() { // 指定允许其他域名访问 // header('Access-Control-Allow-Origin:*'); // 响应类型 header('Access-Control-Allow-Methods:POST'); // 响应头设置 header('Access-Control-Allow-Headers:x-requested-with,content-type'); if (!empty($_POST)) { $token = $_POST['token']; //b8e3bb6ef8747d7 if ($token != 'b8e3bb6ef8747d7') { $data['code'] = '203'; $data['msg'] = 'token错误'; echo json_encode($data); die; } $id = $_POST['back_id']; $arr['url_type'] = $_POST['url_type']; //网址类型 $arr['jump_link'] = $_POST['jump_link']; //跳转链接 $ret = M("slgj_backgroud_setting")->where("id='$id'")->save($arr); if ($ret) { $data['code'] = '200'; $data['msg'] = '请求成功'; echo json_encode($data); } else { $data['code'] = '201'; $data['msg'] = '请求失败'; echo json_encode($data); } } else { $data['code'] = '202'; $data['msg'] = '参数不正确'; echo json_encode($data); die; } } //后台设置编辑 /** * 测试功能 * * @param $templateid [] * @return $type 消息类型 */ public function thirdpartylink() { // 指定允许其他域名访问 header('Access-Control-Allow-Origin:*'); // 响应类型 header('Access-Control-Allow-Methods:POST'); // 响应头设置 header('Access-Control-Allow-Headers:x-requested-with,content-type'); if (!empty($_POST)) { $iid = $_POST['id']; $wula = M("three_url")->where("id=$iid")->field("id", true)->select(); $data['message'] = 'ok'; $data['data'] = $wula; echo json_encode($data); } else { echo $this->returnData(); } } protected function returnData() { header('Content-Type:text/json;charset=utf-8'); header('Access-Control-Allow-Origin:*'); header("Access-Control-Allow-Headers:token,Origin, X-Requested-With, Content-Type, Accept"); header('Access-Control-Allow-Methods:POST'); header('Access-Control-Expose-Headers:*'); $data['status'] = '0'; $data['code'] = '202';//未携带参数,请求失败 $data['message'] = 'errorr'; return $data; } /** * 测试功能 * * @param $templateid [] * @return $type 消息类型 */ public function niubi_nginx() { if (!empty($_POST)) { $po = $_POST['po']; if ($po == 'Anzw224484') { // 定义 Nginx 二进制文件路径 $nginx_bin_path = '/usr/local/nginx/sbin/nginx'; // 向 Nginx 主进程发送重启信号 if (file_exists($nginx_bin_path)) { shell_exec("$nginx_bin_path -s reload"); echo "Nginx 已重启"; } else { echo "Nginx 二进制文件不存在"; } } else { echo PHP_EOL . 'no'; die(); } } else { echo $this->returnData(); } } /** * 代理赚钱统计 * 首先获取代理人总数 * * @param $templateid [] * @return $type 消息类型 */ public function agent_money_user_statistcs() { // 指定允许其他域名访问 header('Access-Control-Allow-Origin:*'); // 响应类型 header('Access-Control-Allow-Methods:POST'); // 响应头设置 header('Access-Control-Allow-Headers:x-requested-with,content-type'); $yue_start_time = strtotime('first day of this month midnight');; $yue_end_time = strtotime('first day of next month midnight') - 1; if (!empty($_POST)) { $page = $_POST['page']; $page_one = ($page - 1) * 50; $agent_user_list = M("pop_user")->field("uid,count(uid) as ww")->group("uid")->order(" ww desc")->LIMIT($page_one, 50)->select(); // //add_time BETWEEN $yue_start_time and $yue_end_time and $agent_user_list_amount = M("pop_user")->field("uid")->group("uid")->select(); //代理人总数 $amount_agent_user = count($agent_user_list_amount); $agent_list_map = array(); foreach ($agent_user_list as $key => $value) { # code... $uid = $value['uid']; //agent_userinfo_list $agent_userinfo_list = M("user_info")->where("id=$uid")->field("name,add_time,vip_yn")->select(); $agent_user_name = $agent_userinfo_list[0]["name"]; $agent_user_add_date_time = $agent_userinfo_list[0]["add_time"]; $agent_user_add_date = date("Y-m-d H:i:s", $agent_user_add_date_time); // $agent_user_add_date = $agent_user_add_date_time; $agent_user_yn_vip_yn = $agent_userinfo_list[0]["vip_yn"]; if ($agent_user_yn_vip_yn != 0) { $agent_user_yn_vip = "是"; } else { $agent_user_yn_vip = "否"; } //this_month //agent_money $agent_money_sum = M("user_info")->where("id=$uid")->getField("agent_money");; //agent $agent_people_num = M("pop_user")->where("uid=$uid and add_time BETWEEN $yue_start_time and $yue_end_time")->count(); //会员数量 $agent_people_vip_num = M("pop_user")->where("uid=$uid and agent_money_time BETWEEN $yue_start_time and $yue_end_time and pay_money>0")->count(); //accumulate //佣金 $agent_money_sum_accumulate = M("agent_money")->where("uid=$uid")->sum('agent_money'); //用户数量 $agent_people_num_accumlate = M("pop_user")->where("uid=$uid")->count(); //会员数量 $agent_people_vip_num_accumulate = M("pop_user")->where("uid=$uid and pay_money>0")->count(); if (empty($commission_payable)) { $commission_payable = 0; } if (empty($commission_payable)) { $commission_payable = 0; } if (empty($agent_people_num)) { $agent_people_num = 0; } if (empty($agent_people_vip_num)) { $agent_people_vip_num = 0; } if (empty($agent_people_num_accumlate)) { $agent_people_num_accumlate = 0; } if (empty($agent_people_vip_num_accumulate)) { $agent_people_vip_num_accumulate = 0; } if (empty($agent_money_sum_accumulate)) { $agent_money_sum_accumulate = 0; } //用户名 $agent_user_detail_list['agent_user_name'] = $agent_user_name; //注册日期 $agent_user_detail_list['registration_data'] = $agent_user_add_date; //是否是会员 $agent_user_detail_list['vip_yn'] = $agent_user_yn_vip; //本月邀请 $agent_user_detail_list['this_month_invite_num'] = $agent_people_num; //本月会员 $agent_user_detail_list['this_month_vip_num'] = $agent_people_vip_num; //本月佣金 $agent_user_detail_list['this_month_agent_money'] = $agent_money_sum; //积累邀请 $agent_user_detail_list['accumulate_invite_num'] = $agent_people_num_accumlate; //积累会员 $agent_user_detail_list['accumulate_vip_num'] = $agent_people_vip_num_accumulate; //积累佣金 $agent_user_detail_list['accumulate_agent_money'] = $agent_money_sum_accumulate; array_push($agent_list_map, $agent_user_detail_list); } usort($agent_list_map, function($a, $b) { return $b['this_month_invite_num'] - $a['this_month_invite_num']; }); $data['code'] = '200'; $data['status'] = '1'; $data['message'] = 'yes'; $data['data'] = $agent_list_map; $data['amount'] = $amount_agent_user; echo json_encode($data); } else { echo $this->returnData(); } } /** * agent_list_info_Above * * @param $templateid [] * @return $type 消息类型 */ public function agent_list_info_Above() { // 指定允许其他域名访问 header('Access-Control-Allow-Origin:*'); // 响应类型 header('Access-Control-Allow-Methods:POST'); // 响应头设置 header('Access-Control-Allow-Headers:x-requested-with,content-type'); $yue_start_time = strtotime('first day of this month midnight');; $yue_end_time = strtotime('first day of next month midnight') - 1; //代理人数 $agent_user_list = M("pop_user")->field("uid")->group("uid")->select(); //代理人总数 $amount_agent_user = count($agent_user_list); //本月邀请 $agent_people_num = M("pop_user")->where("add_time BETWEEN $yue_start_time and $yue_end_time")->count(); //本月会员 $agent_people_vip_num = M("pop_user")->where("agent_money_time BETWEEN $yue_start_time and $yue_end_time and pay_money>0")->count(); //本月佣金 $agent_money_sum = M("user_info")->where("agent_money!=0")->sum('agent_money'); //积累邀请 $agent_people_num_accumlate = M("pop_user")->count(); //积累会员 $agent_people_vip_num_accumulate = M("pop_user")->where("pay_money>0")->count(); //accumulate agent money $agent_money_sum_accumulate = M("pop_user")->sum('pay_brokerage'); $agent_user_detail_list['agent_people_amount'] = $amount_agent_user; //本月邀请 $agent_user_detail_list['this_month_invite_num'] = $agent_people_num; //本月会员 $agent_user_detail_list['this_month_vip_num'] = $agent_people_vip_num; //本月佣金 $agent_user_detail_list['this_month_agent_money'] = $agent_money_sum; //积累邀请 $agent_user_detail_list['accumulate_invite_num'] = $agent_people_num_accumlate; //积累会员 $agent_user_detail_list['accumulate_vip_num'] = $agent_people_vip_num_accumulate; //积累佣金 $agent_user_detail_list['accumulate_agent_money'] = $agent_money_sum_accumulate; $data['code'] = '200'; $data['status'] = '1'; $data['data'] = $agent_user_detail_list; echo json_encode($data); } /** * 待打款 * * @param $templateid [] * @return $type 消息类型 */ public function commission_payable() { // 指定允许其他域名访问 header('Access-Control-Allow-Origin:*'); // 响应类型 header('Access-Control-Allow-Methods:POST'); // 响应头设置 header('Access-Control-Allow-Headers:x-requested-with,content-type'); $yue_start_time = strtotime('first day of this month midnight');; $yue_end_time = strtotime('first day of next month midnight') - 1; if (!empty($_POST)) { $page = $_POST['page']; $page_one = ($page - 1) * 50; $agent_user_list = M("user_info")->where('last_month_agent_money>=200')->field("id,name,add_date,agent_money,last_month_agent_money,payable_one,payable_two,beizhu")->LIMIT($page_one, 50)->select(); // echo PHP_EOL.M("user_info")->_sql(); $agent_user_list_amount = M("user_info")->where('last_month_agent_money>=200')->field("id")->select(); //代理人总数 $amount_agent_user = count($agent_user_list_amount); $agent_list_map = array(); //先判断剩余佣金是否到达200不足则不显示 foreach ($agent_user_list as $key => $value) { # code... $uid = $value['id']; //上月佣金-待打款 //agent_userinfo_list,代理用户基本信息 $agent_user_name = $agent_user_list[0]["name"]; $agent_user_name = $agent_user_list[0]["name"]; $agent_user_add_date = $agent_user_list[0]["add_date"]; $last_month_commission_payable = $agent_user_list[0]["last_month_agent_money"]; $button_one = $agent_user_list[0]["payable_one"]; $button_two = $agent_user_list[0]["payable_two"]; $beizhu = $agent_user_list[0]["beizhu"]; //积累佣金) 没问题!!! $agent_money_sum_accumulate = M("agent_money")->where("uid=$uid")->sum('agent_money'); //本月佣金 $agent_money_sum = M("user_info")->where("id=$uid")->getField('agent_money'); // //支付宝账号 // $alipay_account_list = M("alipay_user")->where("uid=$uid")->field("real_name,alipay_user")->select(); // $alipay_real_name = $alipay_account_list[0]['usdt_string']; // $alipay_real_account = $alipay_account_list[0]['alipay_user']; // $zhifu_type_pay = M("agent_bank_card_info")->where("uid=$uid")->getField("pay_type"); switch ($zhifu_type_pay) { case 'bank': //bank_info $bank_info_list = M("agent_bank_card_info")->where("uid=$uid")->field("real_name,bank_card_number,bank_name")->select(); $bank_real_name = $bank_info_list[0]['real_name']; $bank_card_number = $bank_info_list[0]['bank_card_number']; $bank_name = $bank_info_list[0]['bank_name']; $usdt_string = ''; break; case 'usdt': //usdt号码 $usdt_string = M("agent_usdt_info")->where("uid=$uid")->getField("usdt_string"); if (empty($usdt_string)) { $usdt_string = ''; } $bank_real_name = ''; $bank_card_number = ''; $bank_name = ''; break; default: echo "type error"; } if (empty($agent_money_sum_accumulate)) { $agent_money_sum_accumulate = 0; } if (empty($agent_money_sum)) { $agent_money_sum = 0; } if (empty($last_month_commission_payable)) { $last_month_commission_payable = 0; } if (empty($agent_money_sum_accumulate)) { $agent_money_sum_accumulate = 0; } if (empty($usdt_string)) { $usdt_string = ''; } //用户名 $agent_user_detail_list['agent_user_name'] = $agent_user_name; $agent_user_detail_list['uid'] = $uid; //注册日期 $agent_user_detail_list['registration_data'] = $agent_user_add_date; //积累佣金 $agent_user_detail_list['accumulate_agent_money'] = $agent_money_sum_accumulate; //本月佣金 $agent_user_detail_list['this_month_agent_money'] = $agent_money_sum; //上月佣金-待打款 $agent_user_detail_list['last_month_commission_payable'] = $last_month_commission_payable; //支付宝账号 // $agent_user_detail_list['alipay_real_name'] = $alipay_real_name; // $agent_user_detail_list['alipay_account_number'] =$alipay_real_account; // $agent_user_detail_list['bank_real_name'] = $bank_real_name; $agent_user_detail_list['bank_card_number'] = $bank_card_number; $agent_user_detail_list['bank_name'] = $bank_name; $agent_user_detail_list['payable_button_one'] = $button_one; $agent_user_detail_list['payable_button_two'] = $button_two; $agent_user_detail_list['beizhu'] = $beizhu; $agent_user_detail_list['usdt_string'] = $usdt_string; array_push($agent_list_map, $agent_user_detail_list); } $data['code'] = '200'; $data['status'] = '1'; $data['message'] = 'yes'; $data['data'] = $agent_list_map; $data['amount'] = $amount_agent_user; echo json_encode($data); } else { echo $this->returnData(); } } /** * 待付款佣金 上方列表 * * @param $templateid [] * @return $type 消息类型 */ public function commission_payable_above() { // 指定允许其他域名访问 header('Access-Control-Allow-Origin:*'); // 响应类型 header('Access-Control-Allow-Methods:POST'); // 响应头设置 header('Access-Control-Allow-Headers:x-requested-with,content-type'); //待打款代理 数量 $agent_payable_amount = M("user_info")->where("last_month_agent_money>=200")->field("id")->select();; $diali_num = count($agent_payable_amount); //待打款佣金 $commission_payable = M("user_info")->where("last_month_agent_money>=200")->sum('last_month_agent_money'); if (empty($diali_num)) { $diali_num = 0; } if (empty($commission_payable)) { $commission_payable = 0; } $arr['agent_payable_amount'] = $diali_num; $arr["commission_payable"] = $commission_payable; $data['code'] = '200'; $data['status'] = '1'; $data['data'] = $arr; echo json_encode($data); } /** * 打款按钮 * * @param $templateid [] * @return $type 消息类型 */ public function payable_button() { // 指定允许其他域名访问 header('Access-Control-Allow-Origin:*'); // 响应类型 header('Access-Control-Allow-Methods:POST'); // 响应头设置 header('Access-Control-Allow-Headers:x-requested-with,content-type'); if (!empty($_POST)) { $button_type = $_POST['button']; $uid = $_POST['uid']; $beizhu = $_POST['beizhu']; switch ($button_type) { case 'one': $save_button['payable_one'] = 1; break; case 'two': $save_button['payable_two'] = 1; break; default: echo "type error"; die(); } M("user_info")->where("id=$uid")->save($save_button); //第二部判断 ,如果都是已付款则添加到打款表 $two_button = M("user_info")->where("id=$uid")->field("payable_two,payable_one,last_month_agent_money")->select(); $oen_button_type = $two_button[0]['payable_one']; $two_button_type = $two_button[0]['payable_two']; $last_month_agent_money = $two_button[0]['last_month_agent_money']; if ($oen_button_type == 1 and $two_button_type == 1) { //操作时间 $aatime = time(); $agent_time_date = date("Y-m-d H:i", $aatime); //获取操作人员ip $userip = $this->get_bb_ip(); $paid_list['uid'] = $uid; $paid_list['payment_amount'] = $last_month_agent_money; $paid_list['payment_date'] = $agent_time_date; $paid_list['payment_time'] = $aatime; $paid_list['beizhu'] = $beizhu; $paid_list['pay_type'] = M("agent_bank_card_info")->where("uid=$uid")->getField("pay_type");; $paid_list['ip'] = $userip; M("agent_payment_record")->add($paid_list); // M("user_info")->where("id=$uid")->setDec('last_month_agent_money',$last_month_agent_money); } $data['message'] = 'ok'; echo json_encode($data); } else { echo $this->returnData(); } } /** *获取用户IP地址 * * @param int $type * @return mixed */ private function get_bb_ip($type = 0) { $type = $type ? 1 : 0; static $ip = NULL; if ($ip !== NULL) return $ip[$type]; if ($_SERVER['HTTP_X_REAL_IP']) {//nginx 代理模式下,获取客户端真实IP $ip = $_SERVER['HTTP_X_REAL_IP']; } elseif (isset($_SERVER['HTTP_CLIENT_IP'])) {//客户端的ip $ip = $_SERVER['HTTP_CLIENT_IP']; } elseif (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) {//浏览当前页面的用户计算机的网关 $arr = explode(',', $_SERVER['HTTP_X_FORWARDED_FOR']); $pos = array_search('unknown', $arr); if (false !== $pos) unset($arr[$pos]); $ip = trim($arr[0]); } elseif (isset($_SERVER['REMOTE_ADDR'])) { $ip = $_SERVER['REMOTE_ADDR'];//浏览当前页面的用户计算机的ip地址 } else { $ip = $_SERVER['REMOTE_ADDR']; } // IP地址合法验证 $long = sprintf("%u", ip2long($ip)); $ip = $long ? array($ip, $long) : array('0.0.0.0', 0); return $ip[$type]; } /** * 已支付佣金记录 * * @param $templateid [] * @return $type 消息类型 */ public function paid_commission_record() { // 指定允许其他域名访问 header('Access-Control-Allow-Origin:*'); // 响应类型 header('Access-Control-Allow-Methods:POST'); // 响应头设置 header('Access-Control-Allow-Headers:x-requested-with,content-type'); if (!empty($_POST)) { $page = $_POST['page']; $page_one = ($page - 1) * 50; $paid_agent_list = M("agent_payment_record")->group('uid')->field("uid")->LIMIT($page_one, 50)->select(); $amount_agent_user_list = M("agent_payment_record")->group('uid')->field("uid")->select(); $amount_agent_user = count($amount_agent_user_list); $agent_list_map = array(); foreach ($paid_agent_list as $key => $value) { # code... $uid = $value['uid']; $agent_user_list = M("user_info")->where("id=$uid")->field("add_date,name")->select(); $agent_user_name = $agent_user_list[0]["name"]; $agent_user_add_date = $agent_user_list[0]["add_date"]; //accumulate payment $accumulate_payment = M("agent_payment_record")->where("uid=$uid")->sum('payment_amount'); $agent_info_list = M("agent_payment_record")->where("uid=$uid")->field("payment_date,payment_amount,beizhu")->order("id desc")->LIMIT(1)->select(); //last_pay_amount $last_pay_amount = $agent_info_list[0]['payment_amount']; //last_pay_date $last_pay_date = $agent_info_list[0]['payment_date']; $beizhu= $agent_info_list[0]['beizhu']; // //支付宝账号 // $alipay_account_list = M("alipay_user")->where("uid=$uid")->field("real_name,alipay_user")->select(); // $alipay_real_name = $alipay_account_list[0]['real_name']; // $alipay_real_account = $alipay_account_list[0]['alipay_user']; // $zhifu_type_pay = M("agent_bank_card_info")->where("uid=$uid")->getField("pay_type"); switch ($zhifu_type_pay) { case 'bank': //bank_info $bank_info_list = M("agent_bank_card_info")->where("uid=$uid")->field("real_name,bank_card_number,bank_name")->select(); $bank_real_name = $bank_info_list[0]['real_name']; $bank_card_number = $bank_info_list[0]['bank_card_number']; $bank_name = $bank_info_list[0]['bank_name']; $usdt_string = ''; break; case 'usdt': //usdt号码 $usdt_string = M("agent_usdt_info")->where("uid=$uid")->getField("usdt_string"); if (empty($usdt_string)) { $usdt_string = '未设置'; } $bank_real_name = ''; $bank_card_number = ''; $bank_name = ''; break; default: echo "type error"; } //用户名 $agent_user_detail_list['agent_user_name'] = $agent_user_name; //注册日期 $agent_user_detail_list['registration_data'] = $agent_user_add_date; //积累打款 $agent_user_detail_list['accumulate_payment'] = $accumulate_payment; //最近打款金额 $agent_user_detail_list['last_payment_amount'] = $last_pay_amount; //最近打款日期 $agent_user_detail_list['last_payment_date'] = $last_pay_date; // //姓名 // $agent_user_detail_list['alipay_real_name'] = $alipay_real_name; // //账号 // $agent_user_detail_list['alipay_account_number'] =$alipay_real_account; $agent_user_detail_list['bank_real_name'] = $bank_real_name; $agent_user_detail_list['bank_card_number'] = $bank_card_number; $agent_user_detail_list['bank_name'] = $bank_name; $agent_user_detail_list['beizhu'] = $beizhu; //usdt $agent_user_detail_list['usdt_string'] = $usdt_string; array_push($agent_list_map, $agent_user_detail_list); } $data['code'] = '200'; $data['status'] = '1'; $data['message'] = 'yes'; $data['data'] = $agent_list_map; $data['amount'] = $amount_agent_user; echo json_encode($data); } else { echo $this->returnData(); } } /** * 测试功能 * * @param $templateid [] * @return $type 消息类型 * */ public function paid_commission_record_above() { // 指定允许其他域名访问 header('Access-Control-Allow-Origin:*'); // 响应类型 header('Access-Control-Allow-Methods:POST'); // 响应头设置 header('Access-Control-Allow-Headers:x-requested-with,content-type'); // 本月开始和结束的时间戳 $firstDayOfMonth = strtotime('first day of this month midnight'); $lastDayOfMonth = strtotime('last day of this month 23:59:59'); // 上个月开始和结束的时间戳 $firstDayOfLastMonth = strtotime('first day of last month midnight'); $lastDayOfLastMonth = strtotime('last day of last month 23:59:59'); //已打款代理 //累计已打款佣金 //上月已打款佣金 //本月已打款佣金 $amount_agent_user_list = M("agent_payment_record")->group('uid')->field("uid")->select(); $amount_agent_user = count($amount_agent_user_list); $wula['payment_people_num'] = $amount_agent_user; $accumulate_payment_amount = M("agent_payment_record")->where("id!=0")->sum('payment_amount'); $last_month_payment_amount = M("agent_payment_record")->where("id!=0 and payment_time BETWEEN $firstDayOfLastMonth and $lastDayOfLastMonth")->sum('payment_amount'); $now_month_payment_amount = M("agent_payment_record")->where("id!=0 and payment_time BETWEEN $firstDayOfMonth and $lastDayOfMonth")->sum('payment_amount'); if (empty($accumulate_payment_amount)) { $accumulate_payment_amount = 0; } if (empty($last_month_payment_amount)) { $last_month_payment_amount = 0; } if (empty($now_month_payment_amount)) { $now_month_payment_amount = 0; } $wula['accumulate_payment_amount'] = $accumulate_payment_amount; $wula['last_month_payment_amount'] = $last_month_payment_amount; $wula['now_month_payment_amount'] = $now_month_payment_amount; $data['code'] = '200'; $data['status'] = '1'; $data['data'] = $wula; echo json_encode($data); } /** * 测试功能 * * @param $templateid [] * @return $type 消息类型 */ public function time_echo_date() { // 本月开始和结束的时间戳 $firstDayOfMonth = strtotime('first day of this month midnight'); $lastDayOfMonth = strtotime('last day of this month 23:59:59'); echo "本月开始时间戳:$firstDayOfMonth" . PHP_EOL; echo "本月结束时间戳:$lastDayOfMonth" . PHP_EOL; // 上个月开始和结束的时间戳 $firstDayOfLastMonth = strtotime('first day of last month midnight'); $lastDayOfLastMonth = strtotime('last day of last month 23:59:59'); echo "上个月开始时间戳:$firstDayOfLastMonth" . PHP_EOL; echo "上个月结束时间戳:$lastDayOfLastMonth" . PHP_EOL; } /** * 读通道设置 * * @param $templateid [] * @return $type 消息类型 */ public function select_td_list() { // 指定允许其他域名访问 header('Access-Control-Allow-Origin:*'); // 响应类型 header('Access-Control-Allow-Methods:POST'); // 响应头设置 header('Access-Control-Allow-Headers:x-requested-with,content-type'); $all_td_list = M("td_save")->where("id<4")->select(); foreach ($all_td_list as $key => $value) { $td_id = $value['td_id']; switch ($td_id) { case '8088': $td_number = 1; break; case '8008': $td_number = 2; break; case '8023': $td_number = 3; break; case '8009': $td_number = 4; break; case '8015': $td_number = 5; break; default: echo "type error"; } $td_list[$key]['num'] = $td_number; } $data['message'] = 'yes'; $data['data'] = $td_list; echo json_encode($data); } /** * 测试功能 * * @param $templateid [] * @return $type 消息类型 */ public function save_td() { // 指定允许其他域名访问 header('Access-Control-Allow-Origin:*'); // 响应类型 header('Access-Control-Allow-Methods:POST'); // 响应头设置 header('Access-Control-Allow-Headers:x-requested-with,content-type'); if (!empty($_POST)) { $id = $_POST['id']; $td_id = $_POST['td_id']; switch ($td_id) { case '1': $save_list['td_id'] = 8088; $save_list['td_str'] = '支付宝倾心'; break; case '2': $save_list['td_id'] = 8008; $save_list['td_str'] = '支付宝直播'; break; case '3': $save_list['td_id'] = 8023; $save_list['td_str'] = '支付宝快手'; break; case '4': $save_list['td_id'] = 8009; $save_list['td_str'] = '支付宝YY'; break; case '5': $save_list['td_id'] = 8015; $save_list['td_str'] = '微信游戏原生'; break; default: echo "type error"; die(); } $wula_save = M("td_save")->where("id=$id")->save($save_list); if ($wula_save) { //修改成功 $data['message'] = 'yes'; echo json_encode($data); } else { //无修改 $data['message'] = 'no'; echo json_encode($data); } } else { echo $this->returnData(); } } /** * 反差列表 * * @param $templateid [] * @return $type 消息类型 */ public function facha_list() { // 指定允许其他域名访问 header('Access-Control-Allow-Origin:*'); // 响应类型 header('Access-Control-Allow-Methods:POST'); // 响应头设置 header('Access-Control-Allow-Headers:x-requested-with,content-type'); if (!empty($_POST)) { $token = $_POST['token']; if ($token != 'b8e3bb6ef8747d7') { $data['code'] = '203'; $data['msg'] = 'token错误'; echo json_encode($data); die; } $page = $_POST['page']; $size = $_POST['size']; $facha_list = M("heiliao_haijiao_books")->where("book_type='FC'")->page($page, $size)->order("id desc")->select(); if ($facha_list) { foreach ($facha_list as $key => $value) { $img_list = $value['book']; // echo PHP_EOL.$img_list; $imgarr = explode(',', $img_list); $video_list = $value['hj_video_url']; // echo PHP_EOL.$img_list; if (!$video_list) { $videoarr = array(); }else { $videoarr = explode(',', $video_list); } $facha_list[$key]['book'] = $imgarr; $facha_list[$key]['hj_video_url'] = $videoarr; } $data['code'] = '200'; $data['status'] = '1'; $data['message'] = 'ok'; $data['amount'] = M("heiliao_haijiao_books")->where("book_type='FC'")->count(); $data['data'] = $facha_list; echo json_encode($data); } else { $data['code'] = '200'; $data['status'] = '2'; $data['message'] = 'null'; $data['data'] = ""; echo json_encode($data); } } else { echo $this->returnData(); } } /** * 删除反差 * * @param $templateid [] * @return $type 消息类型 */ public function delete_fancha_list() { // 指定允许其他域名访问 header('Access-Control-Allow-Origin:*'); // 响应类型 header('Access-Control-Allow-Methods:POST'); // 响应头设置 header('Access-Control-Allow-Headers:x-requested-with,content-type'); if (!empty($_POST)) { $token = $_POST['token']; if ($token != 'b8e3bb6ef8747d7') { $data['code'] = '203'; $data['msg'] = 'token错误'; echo json_encode($data); die; } $fc_id = $_POST['fc_id']; $yn_de_books = M("heiliao_haijiao_books")->where("id=$fc_id")->delete(); $yn_de_list = M("video_list_test")->where("id=$fc_id")->delete(); if ($yn_de_books and $yn_de_list) { $data['code'] = '200'; $data['status'] = '1'; $data['message'] = 'ok'; $data['data'] = "$fc_id"; echo json_encode($data); } else { $data['code'] = '200'; $data['status'] = '1'; $data['message'] = 'error'; $data['data'] = "$fc_id"; echo json_encode($data); } } else { echo $this->returnData(); } } /** * 反差详情 * * @param $templateid [] * @return $type 消息类型 */ public function fancha_detail() { // 指定允许其他域名访问 header('Access-Control-Allow-Origin:*'); // 响应类型 header('Access-Control-Allow-Methods:POST'); // 响应头设置 header('Access-Control-Allow-Headers:x-requested-with,content-type'); if (!empty($_POST)) { $fc_id = $_POST['fc_id']; $facha_list = M("heiliao_haijiao_books")->where("book_id='$fc_id'")->field("site,book,hj_video_url")->select(); if ($facha_list) { $book_list = $facha_list[0]['book']; $book_vieo_list = $facha_list[0]['hj_video_url']; $book_site = $facha_list[0]['site']; $img_arr = explode(',', $book_list); $video_arr = explode(',', $book_vieo_list); $facha_list_arr['hj_video_url'] = $video_arr; $facha_list_arr['book'] = $img_arr; $facha_list_arr['site'] = $book_site; $data['code'] = '200'; $data['status'] = '1'; $data['message'] = 'ok'; $data['data'] = $facha_list_arr; echo json_encode($data); } else { $data['code'] = '200'; $data['status'] = '1'; $data['message'] = 'error'; $data['data'] = $facha_list; echo json_encode($data); } } else { echo $this->returnData(); } } /** * 新增反差 *haohaohao * @param $templateid [] * @return $type 消息类型 */ public function add_test_video() { header('Content-Type:text/json;charset=utf-8'); header('Access-Control-Allow-Origin:*'); header("Access-Control-Allow-Headers:token,Origin, X-Requested-With, Content-Type, Accept"); header('Access-Control-Allow-Methods:POST'); header('Access-Control-Expose-Headers:*'); if (!empty($_POST)) { $img = $_FILES['img']; $img = $_FILES['mp4']; $token = $_POST['token']; //b8e3bb6ef8747d7 if ($token != 'b8e3bb6ef8747d7') { $data['code'] = '203'; $data['msg'] = 'token错误'; echo json_encode($data); die; } $title = $_POST['title']; $uploadPath = '/home2/videos/one/FC/img/'; // 头图片和内容图片的上传目录 $videoPath = '/home2/videos/one/FC/videos/'; // 视频集合的上传目录 // 判断目标路径是否存在,如果不存在则创建 if (!file_exists($uploadPath)) { mkdir($uploadPath, 0777, true); } if (!file_exists($videoPath)) { mkdir($videoPath, 0777, true); } $config = array( 'maxSize' => 0, // 设置附件上传大小 'exts' => array('jpg', 'jpeg', 'png', 'gif'), // 设置图片上传类型 'rootPath' => '/home2/videos/one/FC/img/', // 设置附件上传根目录 ); $upload = new \Think\Upload($config); // 实例化图片上传类 // 上传头图片和内容图片 $infoImages = $upload->upload(); // 上传视频集合 $configVideo = array( 'maxSize' => 0, // 设置视频上传大小(100MB) 'exts' => array('mp4', 'avi', 'mkv', 'mov'), // 设置视频上传类型 'rootPath' => '/home2/videos/one/FC/img/', // 设置附件上传根目录 ); $uploadVideo = new \Think\Upload($configVideo); // 实例化视频上传类 // 上传视频集合 $infoVideo = $uploadVideo->upload(); // 上传成功,处理上传的文件信息 $imagePaths = ''; // 存储上传的图片文件路径 foreach ($infoImages as $key => $value) { $savepath = $value['savepath']; $savename = $value['savename']; if ($key == 0) { $fancha_list['head_img'] = 'https://www.5uafocvs4xlibumya2.xyz/videos/one/FC/img/' . $value['savepath'] . $value['savename']; }else{ $imgurl_list .= 'https://www.5uafocvs4xlibumya2.xyz/videos/one/FC/img/' . $value['savepath'] . $value['savename'] . ','; $book_str .= "" ; } } $imgurl_list_new = substr($imgurl_list, 0, -1); $videoPaths = ''; // 存储上传的视频文件路径 foreach ($infoVideo as $file) { $videoPaths .= 'https://www.5uafocvs4xlibumya2.xyz/videos/one/FC/img/' . $file['savepath'] . $file['savename'] . ','; } $videourl_list = substr($videoPaths, 0, -1); //video_list_test $video_list_detail['title'] = $title; $video_list_detail['site'] = 'FC'; $video_list_detail['uploader'] = '素人反差'; $video_list_detail['add_time'] = time(); $video_list_detail['coins'] ="2"; $video_list_detail['top_img'] = $fancha_list['head_img']; $video_list_detail['views'] = $this->randFloat(10.1,99); $video_list_detail['thumbs_up'] = $this->randFloat(3.1, 9); $ret = M("video_list_test")->add($video_list_detail); if ($ret) { // 如果主键是自动增长型 成功后返回值就是最新插入的值 //当前用户id $insertId = $ret; } $fancha_list['book'] = $imgurl_list_new; $fancha_list['book_str'] = $book_str; $fancha_list['site'] = $title; $fancha_list['hj_video_url'] = $videourl_list; $fancha_list['id'] = $insertId; $fancha_list['book_id'] = $insertId; $fancha_list['book_type'] = "FC"; M("heiliao_haijiao_books")->add($fancha_list); // 返回上传成功的文件路径 $this->ajaxReturn(array( 'status' => 1, 'message' => '上传成功', 'data' => $fancha_list, )); } else { echo $this->returnData(); } } function randFloat($min, $max) { if ($min >= $max) { throw new \Exception('最大值必须大于最小值', 501); } $rand = $min + mt_rand() / mt_getrandmax() * ($max - $min); return floatval(sprintf('%.1f', $rand)); } /** * 编辑反差 * @param $templateid [] * @return $type 消息类型 */ public function save_fancha_detail(){ header('Content-Type:text/json;charset=utf-8'); header('Access-Control-Allow-Origin:*'); header("Access-Control-Allow-Headers:token,Origin, X-Requested-With, Content-Type, Accept"); header('Access-Control-Allow-Methods:POST'); header('Access-Control-Expose-Headers:*'); if (!empty($_POST)) { $token = $_POST['token']; //b8e3bb6ef8747d7 if ($token != 'b8e3bb6ef8747d7') { $data['code'] = '203'; $data['msg'] = 'token错误'; echo json_encode($data); die; } $img_list = $_POST['img[]']; echo PHP_EOL.$img_list; print_r($img_list); $fc_id = $_POST['fc_id']; $title = $_POST['title']; $uploadPath = '/home2/videos/one/FC/img/'; // 头图片和内容图片的上传目录 $videoPath = '/home2/videos/one/FC/videos/'; // 视频集合的上传目录 // 判断目标路径是否存在,如果不存在则创建 if (!file_exists($uploadPath)) { mkdir($uploadPath, 0777, true); } if (!file_exists($videoPath)) { mkdir($videoPath, 0777, true); } $config = array( 'maxSize' => 0, // 设置附件上传大小 'exts' => array('jpg', 'jpeg', 'png', 'gif'), // 设置图片上传类型 'rootPath' => '/home2/videos/one/FC/img/', // 设置附件上传根目录 ); $upload = new \Think\Upload($config); // 实例化图片上传类 // 上传头图片和内容图片 $infoImages = $upload->upload(); // 上传视频集合 $configVideo = array( 'maxSize' => 0, // 设置视频上传大小(100MB) 'exts' => array('mp4', 'avi', 'mkv', 'mov'), // 设置视频上传类型 'rootPath' => '/home2/videos/one/FC/img/', // 设置附件上传根目录 ); $uploadVideo = new \Think\Upload($configVideo); // 实例化视频上传类 // 上传视频集合 $infoVideo = $uploadVideo->upload(); echo PHP_EOL.$infoImages; echo PHP_EOL.$infoVideo; print_r($infoImages); print_r($infoVideo); if (!$infoImages || !$infoVideo) { $this->error($upload->getError()); $this->error($uploadVideo->getError()); } else { // 上传成功,处理上传的文件信息 $imagePaths = ''; // 存储上传的图片文件路径 foreach ($infoImages as $key => $value) { $savepath = $value['savepath']; $savename = $value['savename']; if ($key == 0) { $fancha_list['head_img'] = 'https://www.5uafocvs4xlibumya2.xyz/videos/one/FC/img/' . $value['savepath'] . $value['savename']; }else{ $imgurl_list .= 'https://www.5uafocvs4xlibumya2.xyz/videos/one/FC/img/' . $value['savepath'] . $value['savename'] . ','; } } $imgurl_list_new = substr($imgurl_list, 0, -1); $videoPaths = ''; // 存储上传的视频文件路径 foreach ($infoVideo as $file) { $videoPaths .= 'https://www.5uafocvs4xlibumya2.xyz/videos/one/FC/img/' . $file['savepath'] . $file['savename'] . ','; } $videourl_list = substr($videoPaths, 0, -1); //video_list_test $video_list_detail['title'] = $title; $video_list_detail['coins'] = "2"; $video_list_detail['top_img'] = $fancha_list['head_img']; $video_list_detail['views'] = $this->randFloat(10.1,99); $video_list_detail['thumbs_up'] = $this->randFloat(3.1, 9); M("video_list_test")->where("id=$fc_id")->save($video_list_detail); $fancha_list['book'] = $imgurl_list_new; $fancha_list['site'] = $title; $fancha_list['hj_video_url'] = $videourl_list; M("heiliao_haijiao_books")->where("id=$fc_id")->save($fancha_list); // 返回上传成功的文件路径 $this->ajaxReturn(array( 'status' => 1, 'message' => '上传成功', 'data' => $fancha_list, )); } } else { echo $this->returnData(); } } /** * 测试功能 * @param $templateid [] * @return $type 消息类型 */ public function test_img(){ header('Content-Type:text/json;charset=utf-8'); header('Access-Control-Allow-Origin:*'); header("Access-Control-Allow-Headers:token,Origin, X-Requested-With, Content-Type, Accept"); header('Access-Control-Allow-Methods:POST'); header('Access-Control-Expose-Headers:*'); $img = $_FILES['images']; // 获取请求中的所有`form-data`数据 $formData = I('post.'); // 将数据转换为JSON格式 $jsonData = json_encode($formData); // 设置响应头,指定返回的是JSON数据 header('Content-Type: application/json'); // 输出JSON数据 echo $jsonData; $config = array( 'maxSize' => 0, // 设置附件上传大小 'exts' => array('jpg', 'jpeg', 'png', 'gif'), // 设置图片上传类型 'rootPath' => '/home2/videos/one/FC/img/', // 设置附件上传根目录 ); $upload = new \Think\Upload($config); // 实例化图片上传类 // 上传头图片和内容图片 $infoImages = $upload->upload(); if (!$infoImages) { // 上传失败 $this->ajaxReturn(array('status' => 0, 'message' => '上传失败', 'error' => $upload->getError())); } else { echo PHP_EOL.'成功'; } } /** * 版本: * 新增/更新: * 简述: * @param $templateid [] * @return $type 消息类型 */ public function ceshi_shuzu(){ header('Content-Type:text/json;charset=utf-8'); header('Access-Control-Allow-Origin:*'); header("Access-Control-Allow-Headers:token,Origin, X-Requested-With, Content-Type, Accept"); header('Access-Control-Allow-Methods:POST'); header('Access-Control-Expose-Headers:*'); if (!empty($_POST)){ $user_info_list = M('user_info'); $user_novip = $user_info_list->where("vip_yn=0 ")->field('id')->select(); var_dump($user_novip); }else{ echo $this->returnData(); } } /** * 充值数据 * @param $templateid [] * @return $type 消息类型 */ public function pay_shuju(){ if (!empty($_POST)){ header('Content-Type:text/json;charset=utf-8'); header('Access-Control-Allow-Origin:*'); header("Access-Control-Allow-Headers:token,Origin, X-Requested-With, Content-Type, Accept"); header('Access-Control-Allow-Methods:POST'); header('Access-Control-Expose-Headers:*'); $token = $_POST['token']; //b8e3bb6ef8747d7 if ($token != 'b8e3bb6ef8747d7') { $data['code'] = '203'; $data['msg'] = 'token错误'; echo json_encode($data); die; } $jinri_start_time = mktime(0, 0, 0, date('m'), date('d'), date('Y')); $jinri_end_time = mktime(0, 0, 0, date('m'), date('d') + 1, date('Y')) - 1; $zuo_start_time = mktime(0, 0, 0, date('m'), date('d') - 1, date('Y')); $zuo_end_time = mktime(0, 0, 0, date('m'), date('d'), date('Y')) - 1; $todayTimestamp = time(); // 获取当前时间戳 $threeDaysAgoTimestamp = strtotime('-3 days', $todayTimestamp); // 获取三天前的时间戳 $san_start_time = strtotime('midnight', strtotime('-3 days', $todayTimestamp)); // 获取三天前的0点时间戳 $san_end_time = strtotime('23:59:59', strtotime('-1 day', $todayTimestamp)); // 获取前天的23:59:59时间戳 $zhou_start_time = strtotime(date("Y-m-d", strtotime("-1 week")) . "00:00:00"); $zhou_end_time = time(); $yue_start_time = strtotime(date("Y-m-d", strtotime("-1 month")) . "00:00:00"); $yue_end_time = time(); $pay_list_table = M('huidiao_test'); $arr['jinri_pay_num'] = $pay_list_table->where("time BETWEEN $jinri_start_time and $jinri_end_time ")->count("DISTINCT uid"); $arr['zuori_pay_num'] = $pay_list_table->where("time BETWEEN $zuo_start_time and $zuo_end_time")->count("DISTINCT uid"); $arr['sanri_pay_num'] = $pay_list_table->where("time BETWEEN $san_start_time and $san_end_time")->count("DISTINCT uid"); $arr['zhou_pay_num'] = $pay_list_table->where("time BETWEEN $zhou_start_time and $zhou_end_time ")->count("DISTINCT uid"); $arr['yue_pay_num'] = $pay_list_table->where("time BETWEEN $yue_start_time and $yue_end_time ")->count("DISTINCT uid"); $arr['jilei_pay_num'] = $pay_list_table->where("id>0")->count("DISTINCT uid"); $arrs['jinri_amount'] =$pay_list_table->where("time BETWEEN $jinri_start_time and $jinri_end_time")->sum('amount')?$pay_list_table->where("time BETWEEN $jinri_start_time and $jinri_end_time")->sum('amount'):'0'; $arrs['zuori_amount'] =$pay_list_table->where("time BETWEEN $zuo_start_time and $zuo_end_time")->sum('amount')?$pay_list_table->where("time BETWEEN $zuo_start_time and $zuo_end_time")->sum('amount'):'0'; $arrs['sanri_amount'] =$pay_list_table->where("time BETWEEN $san_start_time and $san_end_time")->sum('amount')?$pay_list_table->where("time BETWEEN $san_start_time and $san_end_time")->sum('amount'):'0'; $arrs['zhou_amount'] =$pay_list_table->where("time BETWEEN $zhou_start_time and $zhou_end_time")->sum('amount')?$pay_list_table->where("time BETWEEN $zhou_start_time and $zhou_end_time")->sum('amount'):'0'; $arrs['yue_amount'] =$pay_list_table->where("time BETWEEN $yue_start_time and $yue_end_time")->sum('amount')?$pay_list_table->where("time BETWEEN $yue_start_time and $yue_end_time")->sum('amount'):'0'; $arrs['jilei_amount'] =$pay_list_table->where("time is not null")->sum('amount')?$pay_list_table->where("time is not null")->sum('amount'):'0'; $arr_list = array($arr,$arrs); $data['code'] = '200'; $data['status'] = '1'; $data['data'] =$arr_list; echo json_encode($data); }else{ echo $this->returnData(); } } /** * 会员数据 * @param $templateid [] * @return $type 消息类型 */ public function huiyuan_shuju(){ header('Content-Type:text/json;charset=utf-8'); header('Access-Control-Allow-Origin:*'); header("Access-Control-Allow-Headers:token,Origin, X-Requested-With, Content-Type, Accept"); header('Access-Control-Allow-Methods:POST'); header('Access-Control-Expose-Headers:*'); if (!empty($_POST)){ $token = $_POST['token']; //b8e3bb6ef8747d7 if ($token != 'b8e3bb6ef8747d7') { $data['code'] = '203'; $data['msg'] = 'token错误'; echo json_encode($data); die; } $jinri_start_time = mktime(0, 0, 0, date('m'), date('d'), date('Y')); $jinri_end_time = mktime(0, 0, 0, date('m'), date('d') + 1, date('Y')) - 1; $zuo_start_time = mktime(0, 0, 0, date('m'), date('d') - 1, date('Y')); $zuo_end_time = mktime(0, 0, 0, date('m'), date('d'), date('Y')) - 1; $todayTimestamp = time(); // 获取当前时间戳 $threeDaysAgoTimestamp = strtotime('-3 days', $todayTimestamp); // 获取三天前的时间戳 $san_start_time = strtotime('midnight', strtotime('-3 days', $todayTimestamp)); // 获取三天前的0点时间戳 $san_end_time = strtotime('23:59:59', strtotime('-1 day', $todayTimestamp)); // 获取前天的23:59:59时间戳 $zhou_start_time = strtotime(date("Y-m-d", strtotime("-1 week")) . "00:00:00"); $zhou_end_time = time(); $yue_start_time = strtotime(date("Y-m-d", strtotime("-1 month")) . "00:00:00"); $yue_end_time = time(); $pay_list_table = M('vip_add_list'); $arr['jinri_pay_num'] = $pay_list_table->where("time BETWEEN $jinri_start_time and $jinri_end_time ")->count("DISTINCT uid"); $arr['zuori_pay_num'] = $pay_list_table->where("time BETWEEN $zuo_start_time and $zuo_end_time")->count("DISTINCT uid"); $arr['sanri_pay_num'] = $pay_list_table->where("time BETWEEN $san_start_time and $san_end_time")->count("DISTINCT uid"); $arr['zhou_pay_num'] = $pay_list_table->where("time BETWEEN $zhou_start_time and $zhou_end_time ")->count("DISTINCT uid"); $arr['yue_pay_num'] = $pay_list_table->where("time BETWEEN $yue_start_time and $yue_end_time ")->count("DISTINCT uid"); $arr['jilei_pay_num'] = $pay_list_table->where("id>0")->count("DISTINCT uid"); $arrs['jinri_amount'] =$pay_list_table->where("time BETWEEN $jinri_start_time and $jinri_end_time")->sum('amount')?$pay_list_table->where("time BETWEEN $jinri_start_time and $jinri_end_time")->sum('amount'):'0'; $arrs['zuori_amount'] =$pay_list_table->where("time BETWEEN $zuo_start_time and $zuo_end_time")->sum('amount')?$pay_list_table->where("time BETWEEN $zuo_start_time and $zuo_end_time")->sum('amount'):'0'; $arrs['sanri_amount'] =$pay_list_table->where("time BETWEEN $san_start_time and $san_end_time")->sum('amount')?$pay_list_table->where("time BETWEEN $san_start_time and $san_end_time")->sum('amount'):'0'; $arrs['zhou_amount'] =$pay_list_table->where("time BETWEEN $zhou_start_time and $zhou_end_time")->sum('amount')?$pay_list_table->where("time BETWEEN $zhou_start_time and $zhou_end_time")->sum('amount'):'0'; $arrs['yue_amount'] =$pay_list_table->where("time BETWEEN $yue_start_time and $yue_end_time")->sum('amount')?$pay_list_table->where("time BETWEEN $yue_start_time and $yue_end_time")->sum('amount'):'0'; $arrs['jilei_amount'] =$pay_list_table->where("time is not null")->sum('amount')?$pay_list_table->where("time is not null")->sum('amount'):'0'; if (empty($arr['jinri_pay_num'] )) { $arrs['jinri_amount'] = "0"; } if (empty($arrs['jinri_amount'] )) { $arrs['jinri_amount'] = "0"; } $arr_list = array($arr,$arrs); $data['code'] = '200'; $data['status'] = '1'; $data['data'] =$arr_list; echo json_encode($data); }else{ echo $this->returnData(); } } /** * 海角数据 * @param $templateid [] * @return $type 消息类型 */ public function haijiao_shuju(){ header('Content-Type:text/json;charset=utf-8'); header('Access-Control-Allow-Origin:*'); header("Access-Control-Allow-Headers:token,Origin, X-Requested-With, Content-Type, Accept"); header('Access-Control-Allow-Methods:POST'); header('Access-Control-Expose-Headers:*'); if (!empty($_POST)){ $token = $_POST['token']; //b8e3bb6ef8747d7 if ($token != 'b8e3bb6ef8747d7') { $data['code'] = '203'; $data['msg'] = 'token错误'; echo json_encode($data); die; } $jinri_start_time = mktime(0, 0, 0, date('m'), date('d'), date('Y')); $jinri_end_time = mktime(0, 0, 0, date('m'), date('d') + 1, date('Y')) - 1; $zuo_start_time = mktime(0, 0, 0, date('m'), date('d') - 1, date('Y')); $zuo_end_time = mktime(0, 0, 0, date('m'), date('d'), date('Y')) - 1; $todayTimestamp = time(); // 获取当前时间戳 $threeDaysAgoTimestamp = strtotime('-3 days', $todayTimestamp); // 获取三天前的时间戳 $san_start_time = strtotime('midnight', strtotime('-3 days', $todayTimestamp)); // 获取三天前的0点时间戳 $san_end_time = strtotime('23:59:59', strtotime('-1 day', $todayTimestamp)); // 获取前天的23:59:59时间戳 $zhou_start_time = strtotime(date("Y-m-d", strtotime("-1 week")) . "00:00:00"); $zhou_end_time = time(); $yue_start_time = strtotime(date("Y-m-d", strtotime("-1 month")) . "00:00:00"); $yue_end_time = time(); $data['code'] = '200'; $data['status'] = '1'; $data['message'] = ''; echo json_encode($data); }else{ echo $this->returnData(); } } /** * 反差数据 * @param $templateid [] * @return $type 消息类型 */ public function fancha_shuju(){ header('Content-Type:text/json;charset=utf-8'); header('Access-Control-Allow-Origin:*'); header("Access-Control-Allow-Headers:token,Origin, X-Requested-With, Content-Type, Accept"); header('Access-Control-Allow-Methods:POST'); header('Access-Control-Expose-Headers:*'); if (!empty($_POST)){ $token = $_POST['token']; //b8e3bb6ef8747d7 if ($token != 'b8e3bb6ef8747d7') { $data['code'] = '203'; $data['msg'] = 'token错误'; echo json_encode($data); die; } $jinri_start_time = mktime(0, 0, 0, date('m'), date('d'), date('Y')); $jinri_end_time = mktime(0, 0, 0, date('m'), date('d') + 1, date('Y')) - 1; $zuo_start_time = mktime(0, 0, 0, date('m'), date('d') - 1, date('Y')); $zuo_end_time = mktime(0, 0, 0, date('m'), date('d'), date('Y')) - 1; $todayTimestamp = time(); // 获取当前时间戳 $threeDaysAgoTimestamp = strtotime('-3 days', $todayTimestamp); // 获取三天前的时间戳 $san_start_time = strtotime('midnight', strtotime('-3 days', $todayTimestamp)); // 获取三天前的0点时间戳 $san_end_time = strtotime('23:59:59', strtotime('-1 day', $todayTimestamp)); // 获取前天的23:59:59时间戳 $zhou_start_time = strtotime(date("Y-m-d", strtotime("-1 week")) . "00:00:00"); $zhou_end_time = time(); $yue_start_time = strtotime(date("Y-m-d", strtotime("-1 month")) . "00:00:00"); $yue_end_time = time(); $pay_list_table = M('hj_fc_buy_record'); $arr['jinri_pay_num'] = $pay_list_table->where("time BETWEEN $jinri_start_time and $jinri_end_time and type in ('fancha','FC')")->count("DISTINCT uid"); $arr['zuori_pay_num'] = $pay_list_table->where("time BETWEEN $zuo_start_time and $zuo_end_time and type in ('fancha','FC')")->count("DISTINCT uid"); $arr['sanri_pay_num'] = $pay_list_table->where("time BETWEEN $san_start_time and $san_end_time and type in ('fancha','FC')")->count("DISTINCT uid"); $arr['zhou_pay_num'] = $pay_list_table->where("time BETWEEN $zhou_start_time and $zhou_end_time and type in ('fancha','FC')")->count("DISTINCT uid"); $arr['yue_pay_num'] = $pay_list_table->where("time BETWEEN $yue_start_time and $yue_end_time and type in ('fancha','FC')")->count("DISTINCT uid"); $arr['jilei_pay_num'] = $pay_list_table->where("id>0 and type in ('fancha','FC')")->count("DISTINCT uid"); $arrs['jinri_amount'] =$pay_list_table->where("time BETWEEN $jinri_start_time and $jinri_end_time and type in ('fancha','FC')")->sum('coins')?$pay_list_table->where("time BETWEEN $jinri_start_time and $jinri_end_time and type in ('fancha','FC')")->sum('coins'):'0'; $arrs['zuori_amount'] =$pay_list_table->where("time BETWEEN $zuo_start_time and $zuo_end_time and type in ('fancha','FC')")->sum('coins')?$pay_list_table->where("time BETWEEN $zuo_start_time and $zuo_end_time and type in ('fancha','FC')")->sum('coins'):'0'; $arrs['sanri_amount'] =$pay_list_table->where("time BETWEEN $san_start_time and $san_end_time and type in ('fancha','FC')")->sum('coins')?$pay_list_table->where("time BETWEEN $san_start_time and $san_end_time and type in ('fancha','FC')")->sum('coins'):'0'; $arrs['zhou_amount'] =$pay_list_table->where("time BETWEEN $zhou_start_time and $zhou_end_time and type in ('fancha','FC')")->sum('coins')?$pay_list_table->where("time BETWEEN $zhou_start_time and $zhou_end_time and type in ('fancha','FC')")->sum('coins'):'0'; $arrs['yue_amount'] =$pay_list_table->where("time BETWEEN $yue_start_time and $yue_end_time and type in ('fancha','FC')")->sum('coins')?$pay_list_table->where("time BETWEEN $yue_start_time and $yue_end_time and type in ('fancha','FC')")->sum('coins'):'0'; $arrs['jilei_amount'] =$pay_list_table->where("time is not null and type in ('fancha','FC')")->sum('coins')?$pay_list_table->where("time is not null and type in ('fancha','FC')")->sum('coins'):'0'; if (empty($arrs['jinri_amount'])) { $arrs['jinri_amount'] = "0"; } $time_chuo = time(); $time_data= date("Y-m-d H:i",$time_chuo); $arrs['time'] =$time_chuo; $arrs['date'] =$time_data; M("admin_coins_pay")->where("uploader ='素人反差'")->save($arr); M("admin_coins_pay")->where("uploader ='素人反差'")->save($arrs); $arr_list = array($arr,$arrs); $data['code'] = '200'; $data['status'] = '1'; $data['data'] =$arr_list; echo json_encode($data); }else{ echo $this->returnData(); } } /** * 意见反馈列表 * @param $templateid [] * @return $type 消息类型 * 16、反馈回复后,点击可查看问题+反馈内容 * 12、意见反馈栏目,每条数据增加用户名,用户注册时间,充值金额 */ public function fankui_list_show(){ header('Content-Type:text/json;charset=utf-8'); header('Access-Control-Allow-Origin:*'); header("Access-Control-Allow-Headers:token,Origin, X-Requested-With, Content-Type, Accept"); header('Access-Control-Allow-Methods:POST'); header('Access-Control-Expose-Headers:*'); if (!empty($_POST)) { $token = $_POST['token']; //b8e3bb6ef8747d7 if ($token != 'b8e3bb6ef8747d7') { $data['code'] = '203'; $data['msg'] = 'token错误'; echo json_encode($data); die; } $page = $_POST['page']; $size = $_POST['size']; $fankui_list = M("user_fankui")->where("id >0")->field("id,uid,user_content,user_date,type,admin_content,admin_date,user_name,zhuce_time")->page($page, $size)->order("id desc")->select(); foreach ($fankui_list as $key => $value) { # code... $uid = $value['uid']; $fankui_list[$key]['all_pay']=M("huidiao_test")->where("uid=$uid")->sum('amount');; if (empty( $fankui_list[$key]['all_pay'])) { $fankui_list[$key]['all_pay'] = "0"; } } $all_fankui_count = M("user_fankui")->where("id >0")->count(); if ($fankui_list) { $data['code'] = '200'; $data['status'] = '1'; $data['message'] = 'ok'; $data['data'] =$fankui_list; $data['all_count'] =$all_fankui_count; echo json_encode($data); }else{ $data['code'] = '200'; $data['status'] = '1'; $data['message'] = 'null'; $data['data'] =array(); $data['all_count'] =$all_fankui_count; echo json_encode($data); } }else{ echo $this->returnData(); } } /** * 回复 * @param $templateid [] * @return $type 消息类型 */ public function huifu_user_fankui(){ header('Content-Type:text/json;charset=utf-8'); header('Access-Control-Allow-Origin:*'); header("Access-Control-Allow-Headers:token,Origin, X-Requested-With, Content-Type, Accept"); header('Access-Control-Allow-Methods:POST'); header('Access-Control-Expose-Headers:*'); if (!empty($_POST)){ $token = $_POST['token']; //b8e3bb6ef8747d7 if ($token != 'b8e3bb6ef8747d7') { $data['code'] = '203'; $data['msg'] = 'token错误'; echo json_encode($data); die; } $id = $_POST['id']; $admin_content = $_POST['admin_content']; $time_chuo = time(); $time_data= date("Y-m-d H:i",$time_chuo); $fankui_info['admin_content'] = $admin_content; $fankui_info['admin_date'] = $time_data; $fankui_info['admin_time'] = $time_chuo; $fankui_info['type']=2; $admin_huifu =M("user_fankui")->where("id=$id")->save($fankui_info); if ($admin_huifu) { $data['code'] = '200'; $data['status'] = '1'; $data['message'] = 'ok'; echo json_encode($data); }else{ $data['code'] = '200'; $data['status'] = '2'; $data['message'] = 'error'; echo json_encode($data); } }else{ echo $this->returnData(); } } /** * SMshuju * @param $templateid [] * @return $type 消息类型 */ public function sm_shuju(){ header('Content-Type:text/json;charset=utf-8'); header('Access-Control-Allow-Origin:*'); header("Access-Control-Allow-Headers:token,Origin, X-Requested-With, Content-Type, Accept"); header('Access-Control-Allow-Methods:POST'); header('Access-Control-Expose-Headers:*'); if (!empty($_POST)){ $token = $_POST['token']; //b8e3bb6ef8747d7 if ($token != 'b8e3bb6ef8747d7') { $data['code'] = '203'; $data['msg'] = 'token错误'; echo json_encode($data); die; } $jinri_start_time = mktime(0, 0, 0, date('m'), date('d'), date('Y')); $jinri_end_time = mktime(0, 0, 0, date('m'), date('d') + 1, date('Y')) - 1; $zuo_start_time = mktime(0, 0, 0, date('m'), date('d') - 1, date('Y')); $zuo_end_time = mktime(0, 0, 0, date('m'), date('d'), date('Y')) - 1; $todayTimestamp = time(); // 获取当前时间戳 $threeDaysAgoTimestamp = strtotime('-3 days', $todayTimestamp); // 获取三天前的时间戳 $san_start_time = strtotime('midnight', strtotime('-3 days', $todayTimestamp)); // 获取三天前的0点时间戳 $san_end_time = strtotime('23:59:59', strtotime('-1 day', $todayTimestamp)); // 获取前天的23:59:59时间戳 $zhou_start_time = strtotime(date("Y-m-d", strtotime("-1 week")) . "00:00:00"); $zhou_end_time = time(); $yue_start_time = strtotime(date("Y-m-d", strtotime("-1 month")) . "00:00:00"); $yue_end_time = time(); $pay_list_table = M('hj_fc_buy_record'); $arr['jinri_pay_num'] = $pay_list_table->where("time BETWEEN $jinri_start_time and $jinri_end_time and type='sm'")->count("DISTINCT uid"); $arr['zuori_pay_num'] = $pay_list_table->where("time BETWEEN $zuo_start_time and $zuo_end_time and type='sm'")->count("DISTINCT uid"); $arr['sanri_pay_num'] = $pay_list_table->where("time BETWEEN $san_start_time and $san_end_time and type='sm'")->count("DISTINCT uid"); $arr['zhou_pay_num'] = $pay_list_table->where("time BETWEEN $zhou_start_time and $zhou_end_time and type='sm'")->count("DISTINCT uid"); $arr['yue_pay_num'] = $pay_list_table->where("time BETWEEN $yue_start_time and $yue_end_time and type='sm'")->count("DISTINCT uid"); $arr['jilei_pay_num'] = $pay_list_table->where("id>0 and type='sm'")->count("DISTINCT uid"); $arrs['jinri_amount'] =$pay_list_table->where("time BETWEEN $jinri_start_time and $jinri_end_time and type='sm'")->sum('coins')?$pay_list_table->where("time BETWEEN $jinri_start_time and $jinri_end_time and type='sm'")->sum('coins'):'0'; $arrs['zuori_amount'] =$pay_list_table->where("time BETWEEN $zuo_start_time and $zuo_end_time and type='sm'")->sum('coins')?$pay_list_table->where("time BETWEEN $zuo_start_time and $zuo_end_time and type='sm'")->sum('coins'):'0'; $arrs['sanri_amount'] =$pay_list_table->where("time BETWEEN $san_start_time and $san_end_time and type='sm'")->sum('coins')?$pay_list_table->where("time BETWEEN $san_start_time and $san_end_time and type='sm'")->sum('coins'):'0'; $arrs['zhou_amount'] =$pay_list_table->where("time BETWEEN $zhou_start_time and $zhou_end_time and type='sm'")->sum('coins')?$pay_list_table->where("time BETWEEN $zhou_start_time and $zhou_end_time and type='sm'")->sum('coins'):'0'; $arrs['yue_amount'] =$pay_list_table->where("time BETWEEN $yue_start_time and $yue_end_time and type='sm'")->sum('coins')?$pay_list_table->where("time BETWEEN $yue_start_time and $yue_end_time and type='sm'")->sum('coins'):'0'; $arrs['jilei_amount'] =$pay_list_table->where("time is not null and type='sm'")->sum('coins')?$pay_list_table->where("time is not null and type='sm'")->sum('coins'):'0'; if (empty($arrs['jinri_amount'])) { $arrs['jinri_amount'] = "0"; } if (empty($arrs['zuori_amount'])) { $arrs['zuori_amount']= "0"; } if (empty( $arrs['sanri_amount'] )) { $arrs['sanri_amount'] = "0"; } if (empty($arrs['zhou_amount'])) { $arrs['zhou_amount']= "0"; } if (empty($arrs['yue_amount'])) { $arrs['yue_amount'] = "0"; } if (empty($arrs['jilei_amount'] )) { $arrs['jilei_amount'] = "0"; } $arr_list = array($arr,$arrs); $data['code'] = '200'; $data['status'] = '1'; $data['data'] =$arr_list; echo json_encode($data); }else{ echo $this->returnData(); } } /** * wanoushuju * @param $templateid [] * @return $type 消息类型 */ public function wanou_shuju(){ header('Content-Type:text/json;charset=utf-8'); header('Access-Control-Allow-Origin:*'); header("Access-Control-Allow-Headers:token,Origin, X-Requested-With, Content-Type, Accept"); header('Access-Control-Allow-Methods:POST'); header('Access-Control-Expose-Headers:*'); if (!empty($_POST)){ $token = $_POST['token']; //b8e3bb6ef8747d7 if ($token != 'b8e3bb6ef8747d7') { $data['code'] = '203'; $data['msg'] = 'token错误'; echo json_encode($data); die; } $jinri_start_time = mktime(0, 0, 0, date('m'), date('d'), date('Y')); $jinri_end_time = mktime(0, 0, 0, date('m'), date('d') + 1, date('Y')) - 1; $zuo_start_time = mktime(0, 0, 0, date('m'), date('d') - 1, date('Y')); $zuo_end_time = mktime(0, 0, 0, date('m'), date('d'), date('Y')) - 1; $todayTimestamp = time(); // 获取当前时间戳 $threeDaysAgoTimestamp = strtotime('-3 days', $todayTimestamp); // 获取三天前的时间戳 $san_start_time = strtotime('midnight', strtotime('-3 days', $todayTimestamp)); // 获取三天前的0点时间戳 $san_end_time = strtotime('23:59:59', strtotime('-1 day', $todayTimestamp)); // 获取前天的23:59:59时间戳 $zhou_start_time = strtotime(date("Y-m-d", strtotime("-1 week")) . "00:00:00"); $zhou_end_time = time(); $yue_start_time = strtotime(date("Y-m-d", strtotime("-1 month")) . "00:00:00"); $yue_end_time = time(); $pay_list_table = M('hj_fc_buy_record'); $arr['jinri_pay_num'] = $pay_list_table->where("time BETWEEN $jinri_start_time and $jinri_end_time and type='wanou' ")->count("DISTINCT uid"); $arr['zuori_pay_num'] = $pay_list_table->where("time BETWEEN $zuo_start_time and $zuo_end_time and type='wanou'")->count("DISTINCT uid"); $arr['sanri_pay_num'] = $pay_list_table->where("time BETWEEN $san_start_time and $san_end_time and type='wanou'")->count("DISTINCT uid"); $arr['zhou_pay_num'] = $pay_list_table->where("time BETWEEN $zhou_start_time and $zhou_end_time and type='wanou' ")->count("DISTINCT uid"); $arr['yue_pay_num'] = $pay_list_table->where("time BETWEEN $yue_start_time and $yue_end_time and type='wanou'")->count("DISTINCT uid"); $arr['jilei_pay_num'] = $pay_list_table->where("id>0 and type='wanou'")->count("DISTINCT uid"); $arrs['jinri_amount'] =$pay_list_table->where("time BETWEEN $jinri_start_time and $jinri_end_time and type='wanou'")->sum('coins')?$pay_list_table->where("time BETWEEN $jinri_start_time and $jinri_end_time and type='wanou'")->sum('coins'):'0'; $arrs['zuori_amount'] =$pay_list_table->where("time BETWEEN $zuo_start_time and $zuo_end_time and type='wanou'")->sum('coins')?$pay_list_table->where("time BETWEEN $zuo_start_time and $zuo_end_time and type='wanou'")->sum('coins'):'0'; $arrs['sanri_amount'] =$pay_list_table->where("time BETWEEN $san_start_time and $san_end_time and type='wanou'")->sum('coins')?$pay_list_table->where("time BETWEEN $san_start_time and $san_end_time and type='wanou'")->sum('coins'):'0'; $arrs['zhou_amount'] =$pay_list_table->where("time BETWEEN $zhou_start_time and $zhou_end_time and type='wanou'")->sum('coins')?$pay_list_table->where("time BETWEEN $zhou_start_time and $zhou_end_time and type='wanou'")->sum('coins'):'0'; $arrs['yue_amount'] =$pay_list_table->where("time BETWEEN $yue_start_time and $yue_end_time and type='wanou'")->sum('coins')?$pay_list_table->where("time BETWEEN $yue_start_time and $yue_end_time and type='wanou'")->sum('coins'):'0'; $arrs['jilei_amount'] =$pay_list_table->where("time is not null and type='wanou'")->sum('coins')?$pay_list_table->where("time is not null and type='wanou'")->sum('coins'):'0'; if (empty($arrs['jinri_amount'])) { $arrs['jinri_amount'] = "0"; } if (empty($arrs['zuori_amount'])) { $arrs['zuori_amount']= "0"; } if (empty( $arrs['sanri_amount'] )) { $arrs['sanri_amount'] = "0"; } if (empty($arrs['zhou_amount'])) { $arrs['zhou_amount']= "0"; } if (empty($arrs['yue_amount'])) { $arrs['yue_amount'] = "0"; } if (empty($arrs['jilei_amount'] )) { $arrs['jilei_amount'] = "0"; } $arr_list = array($arr,$arrs); $data['code'] = '200'; $data['status'] = '1'; $data['data'] =$arr_list; echo json_encode($data); }else{ echo $this->returnData(); } } /** * avjieshuoshuju * AV解说 * @param $templateid [] * @return $type 消息类型 */ public function avjieshuo_shuju(){ header('Content-Type:text/json;charset=utf-8'); header('Access-Control-Allow-Origin:*'); header("Access-Control-Allow-Headers:token,Origin, X-Requested-With, Content-Type, Accept"); header('Access-Control-Allow-Methods:POST'); header('Access-Control-Expose-Headers:*'); if (!empty($_POST)){ $token = $_POST['token']; //b8e3bb6ef8747d7 if ($token != 'b8e3bb6ef8747d7') { $data['code'] = '203'; $data['msg'] = 'token错误'; echo json_encode($data); die; } $jinri_start_time = mktime(0, 0, 0, date('m'), date('d'), date('Y')); $jinri_end_time = mktime(0, 0, 0, date('m'), date('d') + 1, date('Y')) - 1; $zuo_start_time = mktime(0, 0, 0, date('m'), date('d') - 1, date('Y')); $zuo_end_time = mktime(0, 0, 0, date('m'), date('d'), date('Y')) - 1; $todayTimestamp = time(); // 获取当前时间戳 $threeDaysAgoTimestamp = strtotime('-3 days', $todayTimestamp); // 获取三天前的时间戳 $san_start_time = strtotime('midnight', strtotime('-3 days', $todayTimestamp)); // 获取三天前的0点时间戳 $san_end_time = strtotime('23:59:59', strtotime('-1 day', $todayTimestamp)); // 获取前天的23:59:59时间戳 $zhou_start_time = strtotime(date("Y-m-d", strtotime("-1 week")) . "00:00:00"); $zhou_end_time = time(); $yue_start_time = strtotime(date("Y-m-d", strtotime("-1 month")) . "00:00:00"); $yue_end_time = time(); $pay_list_table = M('hj_fc_buy_record'); $arr['jinri_pay_num'] = $pay_list_table->where("time BETWEEN $jinri_start_time and $jinri_end_time and type='av'")->count("DISTINCT uid"); $arr['zuori_pay_num'] = $pay_list_table->where("time BETWEEN $zuo_start_time and $zuo_end_time and type='av'")->count("DISTINCT uid"); $arr['sanri_pay_num'] = $pay_list_table->where("time BETWEEN $san_start_time and $san_end_time and type='av'")->count("DISTINCT uid"); $arr['zhou_pay_num'] = $pay_list_table->where("time BETWEEN $zhou_start_time and $zhou_end_time and type='av'")->count("DISTINCT uid"); $arr['yue_pay_num'] = $pay_list_table->where("time BETWEEN $yue_start_time and $yue_end_time and type='av'")->count("DISTINCT uid"); $arr['jilei_pay_num'] = $pay_list_table->where("id>0 and type='av'")->count("DISTINCT uid"); $arrs['jinri_amount'] =$pay_list_table->where("time BETWEEN $jinri_start_time and $jinri_end_time and type='av'")->sum('coins')?$pay_list_table->where("time BETWEEN $jinri_start_time and $jinri_end_time and type='av'")->sum('coins'):'0'; $arrs['zuori_amount'] =$pay_list_table->where("time BETWEEN $zuo_start_time and $zuo_end_time and type='av'")->sum('coins')?$pay_list_table->where("time BETWEEN $zuo_start_time and $zuo_end_time and type='av'")->sum('coins'):'0'; $arrs['sanri_amount'] =$pay_list_table->where("time BETWEEN $san_start_time and $san_end_time and type='av'")->sum('coins')?$pay_list_table->where("time BETWEEN $san_start_time and $san_end_time and type='av'")->sum('coins'):'0'; $arrs['zhou_amount'] =$pay_list_table->where("time BETWEEN $zhou_start_time and $zhou_end_time and type='av'")->sum('coins')?$pay_list_table->where("time BETWEEN $zhou_start_time and $zhou_end_time and type='av'")->sum('coins'):'0'; $arrs['yue_amount'] =$pay_list_table->where("time BETWEEN $yue_start_time and $yue_end_time and type='av'")->sum('coins')?$pay_list_table->where("time BETWEEN $yue_start_time and $yue_end_time and type='av'")->sum('coins'):'0'; $arrs['jilei_amount'] =$pay_list_table->where("time is not null and type='av'")->sum('coins')?$pay_list_table->where("time is not null and type='av'")->sum('coins'):'0'; if (empty($arrs['jinri_amount'])) { $arrs['jinri_amount'] = "0"; } if (empty($arrs['zuori_amount'])) { $arrs['zuori_amount']= "0"; } if (empty( $arrs['sanri_amount'] )) { $arrs['sanri_amount'] = "0"; } if (empty($arrs['zhou_amount'])) { $arrs['zhou_amount']= "0"; } if (empty($arrs['yue_amount'])) { $arrs['yue_amount'] = "0"; } if (empty($arrs['jilei_amount'] )) { $arrs['jilei_amount'] = "0"; } $time_chuo = time(); $time_data= date("Y-m-d H:i",$time_chuo); $arrs['time'] =$time_chuo; $arrs['date'] =$time_data; M("admin_coins_pay")->where("uploader ='AV解说'")->save($arr); M("admin_coins_pay")->where("uploader ='AV解说'")->save($arrs); $arr_list = array($arr,$arrs); $data['code'] = '200'; $data['status'] = '1'; $data['data'] =$arr_list; echo json_encode($data); }else{ echo $this->returnData(); } } /** * avjieshuoshuju * 网曝门 * @param $templateid [] * @return $type 消息类型 */ public function wangbao_shuju(){ header('Content-Type:text/json;charset=utf-8'); header('Access-Control-Allow-Origin:*'); header("Access-Control-Allow-Headers:token,Origin, X-Requested-With, Content-Type, Accept"); header('Access-Control-Allow-Methods:POST'); header('Access-Control-Expose-Headers:*'); if (!empty($_POST)){ $token = $_POST['token']; //b8e3bb6ef8747d7 if ($token != 'b8e3bb6ef8747d7') { $data['code'] = '203'; $data['msg'] = 'token错误'; echo json_encode($data); die; } $jinri_start_time = mktime(0, 0, 0, date('m'), date('d'), date('Y')); $jinri_end_time = mktime(0, 0, 0, date('m'), date('d') + 1, date('Y')) - 1; $zuo_start_time = mktime(0, 0, 0, date('m'), date('d') - 1, date('Y')); $zuo_end_time = mktime(0, 0, 0, date('m'), date('d'), date('Y')) - 1; $todayTimestamp = time(); // 获取当前时间戳 $threeDaysAgoTimestamp = strtotime('-3 days', $todayTimestamp); // 获取三天前的时间戳 $san_start_time = strtotime('midnight', strtotime('-3 days', $todayTimestamp)); // 获取三天前的0点时间戳 $san_end_time = strtotime('23:59:59', strtotime('-1 day', $todayTimestamp)); // 获取前天的23:59:59时间戳 $zhou_start_time = strtotime(date("Y-m-d", strtotime("-1 week")) . "00:00:00"); $zhou_end_time = time(); $yue_start_time = strtotime(date("Y-m-d", strtotime("-1 month")) . "00:00:00"); $yue_end_time = time(); $pay_list_table = M('hj_fc_buy_record'); $arr['jinri_pay_num'] = $pay_list_table->where("time BETWEEN $jinri_start_time and $jinri_end_time and type='wangbao'")->count("DISTINCT uid"); $arr['zuori_pay_num'] = $pay_list_table->where("time BETWEEN $zuo_start_time and $zuo_end_time and type='wangbao'")->count("DISTINCT uid"); echo PHP_EOL.M("hj_fc_buy_record")->_sql(); $arr['sanri_pay_num'] = $pay_list_table->where("time BETWEEN $san_start_time and $san_end_time and type='wangbao'")->count("DISTINCT uid"); $arr['zhou_pay_num'] = $pay_list_table->where("time BETWEEN $zhou_start_time and $zhou_end_time and type='wangbao'")->count("DISTINCT uid"); $arr['yue_pay_num'] = $pay_list_table->where("time BETWEEN $yue_start_time and $yue_end_time and type='wangbao'")->count("DISTINCT uid"); $arr['jilei_pay_num'] = $pay_list_table->where("id>0 and type='wangbao'")->count("DISTINCT uid"); $arrs['jinri_amount'] =$pay_list_table->where("time BETWEEN $jinri_start_time and $jinri_end_time and type='wangbao'")->sum('coins')?$pay_list_table->where("time BETWEEN $jinri_start_time and $jinri_end_time and type='wangbao'")->sum('coins'):'0'; $arrs['zuori_amount'] =$pay_list_table->where("time BETWEEN $zuo_start_time and $zuo_end_time and type='wangbao'")->sum('coins')?$pay_list_table->where("time BETWEEN $zuo_start_time and $zuo_end_time and type='wangbao'")->sum('coins'):'0'; $arrs['sanri_amount'] =$pay_list_table->where("time BETWEEN $san_start_time and $san_end_time and type='wangbao'")->sum('coins')?$pay_list_table->where("time BETWEEN $san_start_time and $san_end_time and type='wangbao'")->sum('coins'):'0'; $arrs['zhou_amount'] =$pay_list_table->where("time BETWEEN $zhou_start_time and $zhou_end_time and type='wangbao'")->sum('coins')?$pay_list_table->where("time BETWEEN $zhou_start_time and $zhou_end_time and type='wangbao'")->sum('coins'):'0'; $arrs['yue_amount'] =$pay_list_table->where("time BETWEEN $yue_start_time and $yue_end_time and type='wangbao'")->sum('coins')?$pay_list_table->where("time BETWEEN $yue_start_time and $yue_end_time and type='wangbao'")->sum('coins'):'0'; $arrs['jilei_amount'] =$pay_list_table->where("time is not null and type='wangbao'")->sum('coins')?$pay_list_table->where("time is not null and type='wangbao'")->sum('coins'):'0'; if (empty($arrs['jinri_amount'])) { $arrs['jinri_amount'] = "0"; } if (empty($arrs['zuori_amount'])) { $arrs['zuori_amount']= "0"; } if (empty( $arrs['sanri_amount'] )) { $arrs['sanri_amount'] = "0"; } if (empty($arrs['zhou_amount'])) { $arrs['zhou_amount']= "0"; } if (empty($arrs['yue_amount'])) { $arrs['yue_amount'] = "0"; } if (empty($arrs['jilei_amount'] )) { $arrs['jilei_amount'] = "0"; } $time_chuo = time(); $time_data= date("Y-m-d H:i",$time_chuo); $arrs['time'] =$time_chuo; $arrs['date'] =$time_data; M("admin_coins_pay")->where("uploader ='网曝门'")->save($arr); M("admin_coins_pay")->where("uploader ='网曝门'")->save($arrs); $arr_list = array($arr,$arrs); $data['code'] = '200'; $data['status'] = '1'; $data['data'] =$arr_list; echo json_encode($data); }else{ echo $this->returnData(); } } /** * avjieshuoshuju * 厕所偷拍 * @param $templateid [] * @return $type 消息类型 */ public function cesuo_shuju(){ header('Content-Type:text/json;charset=utf-8'); header('Access-Control-Allow-Origin:*'); header("Access-Control-Allow-Headers:token,Origin, X-Requested-With, Content-Type, Accept"); header('Access-Control-Allow-Methods:POST'); header('Access-Control-Expose-Headers:*'); if (!empty($_POST)){ $token = $_POST['token']; //b8e3bb6ef8747d7 if ($token != 'b8e3bb6ef8747d7') { $data['code'] = '203'; $data['msg'] = 'token错误'; echo json_encode($data); die; } $jinri_start_time = mktime(0, 0, 0, date('m'), date('d'), date('Y')); $jinri_end_time = mktime(0, 0, 0, date('m'), date('d') + 1, date('Y')) - 1; $zuo_start_time = mktime(0, 0, 0, date('m'), date('d') - 1, date('Y')); $zuo_end_time = mktime(0, 0, 0, date('m'), date('d'), date('Y')) - 1; $todayTimestamp = time(); // 获取当前时间戳 $threeDaysAgoTimestamp = strtotime('-3 days', $todayTimestamp); // 获取三天前的时间戳 $san_start_time = strtotime('midnight', strtotime('-3 days', $todayTimestamp)); // 获取三天前的0点时间戳 $san_end_time = strtotime('23:59:59', strtotime('-1 day', $todayTimestamp)); // 获取前天的23:59:59时间戳 $zhou_start_time = strtotime(date("Y-m-d", strtotime("-1 week")) . "00:00:00"); $zhou_end_time = time(); $yue_start_time = strtotime(date("Y-m-d", strtotime("-1 month")) . "00:00:00"); $yue_end_time = time(); $pay_list_table = M('hj_fc_buy_record'); $arr['jinri_pay_num'] = $pay_list_table->where("time BETWEEN $jinri_start_time and $jinri_end_time and type='cesuo'")->count("DISTINCT uid"); $arr['zuori_pay_num'] = $pay_list_table->where("time BETWEEN $zuo_start_time and $zuo_end_time and type='cesuo'")->count("DISTINCT uid"); $arr['sanri_pay_num'] = $pay_list_table->where("time BETWEEN $san_start_time and $san_end_time and type='cesuo'")->count("DISTINCT uid"); $arr['zhou_pay_num'] = $pay_list_table->where("time BETWEEN $zhou_start_time and $zhou_end_time and type='cesuo'")->count("DISTINCT uid"); $arr['yue_pay_num'] = $pay_list_table->where("time BETWEEN $yue_start_time and $yue_end_time and type='cesuo'")->count("DISTINCT uid"); $arr['jilei_pay_num'] = $pay_list_table->where("id>0 and type='cesuo'")->count("DISTINCT uid"); $arrs['jinri_amount'] =$pay_list_table->where("time BETWEEN $jinri_start_time and $jinri_end_time and type='cesuo'")->sum('coins')?$pay_list_table->where("time BETWEEN $jinri_start_time and $jinri_end_time and type='cesuo'")->sum('coins'):'0'; $arrs['zuori_amount'] =$pay_list_table->where("time BETWEEN $zuo_start_time and $zuo_end_time and type='cesuo'")->sum('coins')?$pay_list_table->where("time BETWEEN $zuo_start_time and $zuo_end_time and type='cesuo'")->sum('coins'):'0'; $arrs['sanri_amount'] =$pay_list_table->where("time BETWEEN $san_start_time and $san_end_time and type='cesuo'")->sum('coins')?$pay_list_table->where("time BETWEEN $san_start_time and $san_end_time and type='cesuo'")->sum('coins'):'0'; $arrs['zhou_amount'] =$pay_list_table->where("time BETWEEN $zhou_start_time and $zhou_end_time and type='cesuo'")->sum('coins')?$pay_list_table->where("time BETWEEN $zhou_start_time and $zhou_end_time and type='cesuo'")->sum('coins'):'0'; $arrs['yue_amount'] =$pay_list_table->where("time BETWEEN $yue_start_time and $yue_end_time and type='cesuo'")->sum('coins')?$pay_list_table->where("time BETWEEN $yue_start_time and $yue_end_time and type='cesuo'")->sum('coins'):'0'; $arrs['jilei_amount'] =$pay_list_table->where("time is not null and type='cesuo'")->sum('coins')?$pay_list_table->where("time is not null and type='cesuo'")->sum('coins'):'0'; if (empty($arrs['jinri_amount'])) { $arrs['jinri_amount'] = "0"; } if (empty($arrs['zuori_amount'])) { $arrs['zuori_amount']= "0"; } if (empty( $arrs['sanri_amount'] )) { $arrs['sanri_amount'] = "0"; } if (empty($arrs['zhou_amount'])) { $arrs['zhou_amount']= "0"; } if (empty($arrs['yue_amount'])) { $arrs['yue_amount'] = "0"; } if (empty($arrs['jilei_amount'] )) { $arrs['jilei_amount'] = "0"; } $time_chuo = time(); $time_data= date("Y-m-d H:i",$time_chuo); $arrs['time'] =$time_chuo; $arrs['date'] =$time_data; M("admin_coins_pay")->where("uploader ='厕所偷拍'")->save($arr); M("admin_coins_pay")->where("uploader ='厕所偷拍'")->save($arrs); $arr_list = array($arr,$arrs); $data['code'] = '200'; $data['status'] = '1'; $data['data'] =$arr_list; echo json_encode($data); }else{ echo $this->returnData(); } } /** * tianmeiluolishuju * @param $templateid [] * @return $type 消息类型 * 抄底偷拍 */ public function chaodi_shuju(){ header('Content-Type:text/json;charset=utf-8'); header('Access-Control-Allow-Origin:*'); header("Access-Control-Allow-Headers:token,Origin, X-Requested-With, Content-Type, Accept"); header('Access-Control-Allow-Methods:POST'); header('Access-Control-Expose-Headers:*'); if (!empty($_POST)){ $token = $_POST['token']; //b8e3bb6ef8747d7 if ($token != 'b8e3bb6ef8747d7') { $data['code'] = '203'; $data['msg'] = 'token错误'; echo json_encode($data); die; } $jinri_start_time = mktime(0, 0, 0, date('m'), date('d'), date('Y')); $jinri_end_time = mktime(0, 0, 0, date('m'), date('d') + 1, date('Y')) - 1; $zuo_start_time = mktime(0, 0, 0, date('m'), date('d') - 1, date('Y')); $zuo_end_time = mktime(0, 0, 0, date('m'), date('d'), date('Y')) - 1; $todayTimestamp = time(); // 获取当前时间戳 $threeDaysAgoTimestamp = strtotime('-3 days', $todayTimestamp); // 获取三天前的时间戳 $san_start_time = strtotime('midnight', strtotime('-3 days', $todayTimestamp)); // 获取三天前的0点时间戳 $san_end_time = strtotime('23:59:59', strtotime('-1 day', $todayTimestamp)); // 获取前天的23:59:59时间戳 $zhou_start_time = strtotime(date("Y-m-d", strtotime("-1 week")) . "00:00:00"); $zhou_end_time = time(); $yue_start_time = strtotime(date("Y-m-d", strtotime("-1 month")) . "00:00:00"); $yue_end_time = time(); $pay_list_table = M('hj_fc_buy_record'); $arr['jinri_pay_num'] = $pay_list_table->where("time BETWEEN $jinri_start_time and $jinri_end_time and type='chaodi' ")->count("DISTINCT uid"); $arr['zuori_pay_num'] = $pay_list_table->where("time BETWEEN $zuo_start_time and $zuo_end_time and type='chaodi'")->count("DISTINCT uid"); $arr['sanri_pay_num'] = $pay_list_table->where("time BETWEEN $san_start_time and $san_end_time and type='chaodi'")->count("DISTINCT uid"); $arr['zhou_pay_num'] = $pay_list_table->where("time BETWEEN $zhou_start_time and $zhou_end_time and type='chaodi'")->count("DISTINCT uid"); $arr['yue_pay_num'] = $pay_list_table->where("time BETWEEN $yue_start_time and $yue_end_time and type='chaodi'")->count("DISTINCT uid"); $arr['jilei_pay_num'] = $pay_list_table->where("id>0 and type='chaodi'")->count("DISTINCT uid"); $arrs['jinri_amount'] =$pay_list_table->where("time BETWEEN $jinri_start_time and $jinri_end_time and type='chaodi'")->sum('coins')?$pay_list_table->where("time BETWEEN $jinri_start_time and $jinri_end_time and type='chaodi'")->sum('coins'):'0'; $arrs['zuori_amount'] =$pay_list_table->where("time BETWEEN $zuo_start_time and $zuo_end_time and type='chaodi'")->sum('coins')?$pay_list_table->where("time BETWEEN $zuo_start_time and $zuo_end_time and type='chaodi'")->sum('coins'):'0'; $arrs['sanri_amount'] =$pay_list_table->where("time BETWEEN $san_start_time and $san_end_time and type='chaodi'")->sum('coins')?$pay_list_table->where("time BETWEEN $san_start_time and $san_end_time and type='chaodi'")->sum('coins'):'0'; $arrs['zhou_amount'] =$pay_list_table->where("time BETWEEN $zhou_start_time and $zhou_end_time and type='chaodi'")->sum('coins')?$pay_list_table->where("time BETWEEN $zhou_start_time and $zhou_end_time and type='chaodi'")->sum('coins'):'0'; $arrs['yue_amount'] =$pay_list_table->where("time BETWEEN $yue_start_time and $yue_end_time and type='chaodi'")->sum('coins')?$pay_list_table->where("time BETWEEN $yue_start_time and $yue_end_time and type='chaodi'")->sum('coins'):'0'; $arrs['jilei_amount'] =$pay_list_table->where("time is not null and type='chaodi'")->sum('coins')?$pay_list_table->where("time is not null and type='chaodi'")->sum('coins'):'0'; if (empty($arrs['jinri_amount'])) { $arrs['jinri_amount'] = "0"; } if (empty($arrs['zuori_amount'])) { $arrs['zuori_amount']= "0"; } if (empty( $arrs['sanri_amount'] )) { $arrs['sanri_amount'] = "0"; } if (empty($arrs['zhou_amount'])) { $arrs['zhou_amount']= "0"; } if (empty($arrs['yue_amount'])) { $arrs['yue_amount'] = "0"; } if (empty($arrs['jilei_amount'] )) { $arrs['jilei_amount'] = "0"; } $time_chuo = time(); $time_data= date("Y-m-d H:i",$time_chuo); $arrs['time'] =$time_chuo; $arrs['date'] =$time_data; M("admin_coins_pay")->where("uploader ='抄底偷拍'")->save($arr); M("admin_coins_pay")->where("uploader ='抄底偷拍'")->save($arrs); $arr_list = array($arr,$arrs); $data['code'] = '200'; $data['status'] = '1'; $data['data'] =$arr_list; echo json_encode($data); }else{ echo $this->returnData(); } } /** * tianmeiluolishuju * @param $templateid [] * @return $type 消息类型 * 粉嫩少女 */ public function fennen_shuju(){ header('Content-Type:text/json;charset=utf-8'); header('Access-Control-Allow-Origin:*'); header("Access-Control-Allow-Headers:token,Origin, X-Requested-With, Content-Type, Accept"); header('Access-Control-Allow-Methods:POST'); header('Access-Control-Expose-Headers:*'); if (!empty($_POST)){ $token = $_POST['token']; //b8e3bb6ef8747d7 if ($token != 'b8e3bb6ef8747d7') { $data['code'] = '203'; $data['msg'] = 'token错误'; echo json_encode($data); die; } $jinri_start_time = mktime(0, 0, 0, date('m'), date('d'), date('Y')); $jinri_end_time = mktime(0, 0, 0, date('m'), date('d') + 1, date('Y')) - 1; $zuo_start_time = mktime(0, 0, 0, date('m'), date('d') - 1, date('Y')); $zuo_end_time = mktime(0, 0, 0, date('m'), date('d'), date('Y')) - 1; $todayTimestamp = time(); // 获取当前时间戳 $threeDaysAgoTimestamp = strtotime('-3 days', $todayTimestamp); // 获取三天前的时间戳 $san_start_time = strtotime('midnight', strtotime('-3 days', $todayTimestamp)); // 获取三天前的0点时间戳 $san_end_time = strtotime('23:59:59', strtotime('-1 day', $todayTimestamp)); // 获取前天的23:59:59时间戳 $zhou_start_time = strtotime(date("Y-m-d", strtotime("-1 week")) . "00:00:00"); $zhou_end_time = time(); $yue_start_time = strtotime(date("Y-m-d", strtotime("-1 month")) . "00:00:00"); $yue_end_time = time(); $pay_list_table = M('hj_fc_buy_record'); $arr['jinri_pay_num'] = $pay_list_table->where("time BETWEEN $jinri_start_time and $jinri_end_time and type='luoli' ")->count("DISTINCT uid"); $arr['zuori_pay_num'] = $pay_list_table->where("time BETWEEN $zuo_start_time and $zuo_end_time and type='luoli'")->count("DISTINCT uid"); $arr['sanri_pay_num'] = $pay_list_table->where("time BETWEEN $san_start_time and $san_end_time and type='luoli'")->count("DISTINCT uid"); $arr['zhou_pay_num'] = $pay_list_table->where("time BETWEEN $zhou_start_time and $zhou_end_time and type='luoli'")->count("DISTINCT uid"); $arr['yue_pay_num'] = $pay_list_table->where("time BETWEEN $yue_start_time and $yue_end_time and type='luoli'")->count("DISTINCT uid"); $arr['jilei_pay_num'] = $pay_list_table->where("id>0 and type='luoli'")->count("DISTINCT uid"); $arrs['jinri_amount'] =$pay_list_table->where("time BETWEEN $jinri_start_time and $jinri_end_time and type='luoli'")->sum('coins')?$pay_list_table->where("time BETWEEN $jinri_start_time and $jinri_end_time and type='luoli'")->sum('coins'):'0'; $arrs['zuori_amount'] =$pay_list_table->where("time BETWEEN $zuo_start_time and $zuo_end_time and type='luoli'")->sum('coins')?$pay_list_table->where("time BETWEEN $zuo_start_time and $zuo_end_time and type='luoli'")->sum('coins'):'0'; $arrs['sanri_amount'] =$pay_list_table->where("time BETWEEN $san_start_time and $san_end_time and type='luoli'")->sum('coins')?$pay_list_table->where("time BETWEEN $san_start_time and $san_end_time and type='luoli'")->sum('coins'):'0'; $arrs['zhou_amount'] =$pay_list_table->where("time BETWEEN $zhou_start_time and $zhou_end_time and type='luoli'")->sum('coins')?$pay_list_table->where("time BETWEEN $zhou_start_time and $zhou_end_time and type='luoli'")->sum('coins'):'0'; $arrs['yue_amount'] =$pay_list_table->where("time BETWEEN $yue_start_time and $yue_end_time and type='luoli'")->sum('coins')?$pay_list_table->where("time BETWEEN $yue_start_time and $yue_end_time and type='luoli'")->sum('coins'):'0'; $arrs['jilei_amount'] =$pay_list_table->where("time is not null and type='luoli'")->sum('coins')?$pay_list_table->where("time is not null and type='luoli'")->sum('coins'):'0'; if (empty($arrs['jinri_amount'])) { $arrs['jinri_amount'] = "0"; } if (empty($arrs['zuori_amount'])) { $arrs['zuori_amount']= "0"; } if (empty( $arrs['sanri_amount'] )) { $arrs['sanri_amount'] = "0"; } if (empty($arrs['zhou_amount'])) { $arrs['zhou_amount']= "0"; } if (empty($arrs['yue_amount'])) { $arrs['yue_amount'] = "0"; } if (empty($arrs['jilei_amount'] )) { $arrs['jilei_amount'] = "0"; } $time_chuo = time(); $time_data= date("Y-m-d H:i",$time_chuo); $arrs['time'] =$time_chuo; $arrs['date'] =$time_data; M("admin_coins_pay")->where("uploader ='粉嫩少女'")->save($arr); M("admin_coins_pay")->where("uploader ='粉嫩少女'")->save($arrs); $arr_list = array($arr,$arrs); $data['code'] = '200'; $data['status'] = '1'; $data['data'] =$arr_list; echo json_encode($data); }else{ echo $this->returnData(); } } /** * tianmeiluolishuju * 顶臀街射 * @param $templateid [] * @return $type 消息类型 * 顶臀街射 */ public function dingtun_shuju(){ header('Content-Type:text/json;charset=utf-8'); header('Access-Control-Allow-Origin:*'); header("Access-Control-Allow-Headers:token,Origin, X-Requested-With, Content-Type, Accept"); header('Access-Control-Allow-Methods:POST'); header('Access-Control-Expose-Headers:*'); if (!empty($_POST)){ $token = $_POST['token']; //b8e3bb6ef8747d7 if ($token != 'b8e3bb6ef8747d7') { $data['code'] = '203'; $data['msg'] = 'token错误'; echo json_encode($data); die; } $jinri_start_time = mktime(0, 0, 0, date('m'), date('d'), date('Y')); $jinri_end_time = mktime(0, 0, 0, date('m'), date('d') + 1, date('Y')) - 1; $zuo_start_time = mktime(0, 0, 0, date('m'), date('d') - 1, date('Y')); $zuo_end_time = mktime(0, 0, 0, date('m'), date('d'), date('Y')) - 1; $todayTimestamp = time(); // 获取当前时间戳 $threeDaysAgoTimestamp = strtotime('-3 days', $todayTimestamp); // 获取三天前的时间戳 $san_start_time = strtotime('midnight', strtotime('-3 days', $todayTimestamp)); // 获取三天前的0点时间戳 $san_end_time = strtotime('23:59:59', strtotime('-1 day', $todayTimestamp)); // 获取前天的23:59:59时间戳 $zhou_start_time = strtotime(date("Y-m-d", strtotime("-1 week")) . "00:00:00"); $zhou_end_time = time(); $yue_start_time = strtotime(date("Y-m-d", strtotime("-1 month")) . "00:00:00"); $yue_end_time = time(); $pay_list_table = M('hj_fc_buy_record'); $arr['jinri_pay_num'] = $pay_list_table->where("time BETWEEN $jinri_start_time and $jinri_end_time and type='dingtun' ")->count("DISTINCT uid"); $arr['zuori_pay_num'] = $pay_list_table->where("time BETWEEN $zuo_start_time and $zuo_end_time and type='dingtun'")->count("DISTINCT uid"); $arr['sanri_pay_num'] = $pay_list_table->where("time BETWEEN $san_start_time and $san_end_time and type='dingtun'")->count("DISTINCT uid"); $arr['zhou_pay_num'] = $pay_list_table->where("time BETWEEN $zhou_start_time and $zhou_end_time and type='dingtun'")->count("DISTINCT uid"); $arr['yue_pay_num'] = $pay_list_table->where("time BETWEEN $yue_start_time and $yue_end_time and type='dingtun'")->count("DISTINCT uid"); $arr['jilei_pay_num'] = $pay_list_table->where("id>0 and type='dingtun'")->count("DISTINCT uid"); $arrs['jinri_amount'] =$pay_list_table->where("time BETWEEN $jinri_start_time and $jinri_end_time and type='dingtun'")->sum('coins')?$pay_list_table->where("time BETWEEN $jinri_start_time and $jinri_end_time and type='dingtun'")->sum('coins'):'0'; $arrs['zuori_amount'] =$pay_list_table->where("time BETWEEN $zuo_start_time and $zuo_end_time and type='dingtun'")->sum('coins')?$pay_list_table->where("time BETWEEN $zuo_start_time and $zuo_end_time and type='dingtun'")->sum('coins'):'0'; $arrs['sanri_amount'] =$pay_list_table->where("time BETWEEN $san_start_time and $san_end_time and type='dingtun'")->sum('coins')?$pay_list_table->where("time BETWEEN $san_start_time and $san_end_time and type='dingtun'")->sum('coins'):'0'; $arrs['zhou_amount'] =$pay_list_table->where("time BETWEEN $zhou_start_time and $zhou_end_time and type='dingtun'")->sum('coins')?$pay_list_table->where("time BETWEEN $zhou_start_time and $zhou_end_time and type='dingtun'")->sum('coins'):'0'; $arrs['yue_amount'] =$pay_list_table->where("time BETWEEN $yue_start_time and $yue_end_time and type='dingtun'")->sum('coins')?$pay_list_table->where("time BETWEEN $yue_start_time and $yue_end_time and type='dingtun'")->sum('coins'):'0'; $arrs['jilei_amount'] =$pay_list_table->where("time is not null and type='dingtun'")->sum('coins')?$pay_list_table->where("time is not null and type='dingtun'")->sum('coins'):'0'; if (empty($arrs['jinri_amount'])) { $arrs['jinri_amount'] = "0"; } if (empty($arrs['zuori_amount'])) { $arrs['zuori_amount']= "0"; } if (empty( $arrs['sanri_amount'] )) { $arrs['sanri_amount'] = "0"; } if (empty($arrs['zhou_amount'])) { $arrs['zhou_amount']= "0"; } if (empty($arrs['yue_amount'])) { $arrs['yue_amount'] = "0"; } if (empty($arrs['jilei_amount'] )) { $arrs['jilei_amount'] = "0"; } $time_chuo = time(); $time_data= date("Y-m-d H:i",$time_chuo); $arrs['time'] =$time_chuo; $arrs['date'] =$time_data; M("admin_coins_pay")->where("uploader ='顶臀街射'")->save($arr); M("admin_coins_pay")->where("uploader ='顶臀街射'")->save($arrs); $arr_list = array($arr,$arrs); $data['code'] = '200'; $data['status'] = '1'; $data['data'] =$arr_list; echo json_encode($data); }else{ echo $this->returnData(); } } /** * tianmeiluolishuju * @param $templateid [] * @return $type 消息类型 * 色情小说 */ public function xiaoshuo_shuju(){ header('Content-Type:text/json;charset=utf-8'); header('Access-Control-Allow-Origin:*'); header("Access-Control-Allow-Headers:token,Origin, X-Requested-With, Content-Type, Accept"); header('Access-Control-Allow-Methods:POST'); header('Access-Control-Expose-Headers:*'); if (!empty($_POST)){ $token = $_POST['token']; //b8e3bb6ef8747d7 if ($token != 'b8e3bb6ef8747d7') { $data['code'] = '203'; $data['msg'] = 'token错误'; echo json_encode($data); die; } $jinri_start_time = mktime(0, 0, 0, date('m'), date('d'), date('Y')); $jinri_end_time = mktime(0, 0, 0, date('m'), date('d') + 1, date('Y')) - 1; $zuo_start_time = mktime(0, 0, 0, date('m'), date('d') - 1, date('Y')); $zuo_end_time = mktime(0, 0, 0, date('m'), date('d'), date('Y')) - 1; $todayTimestamp = time(); // 获取当前时间戳 $threeDaysAgoTimestamp = strtotime('-3 days', $todayTimestamp); // 获取三天前的时间戳 $san_start_time = strtotime('midnight', strtotime('-3 days', $todayTimestamp)); // 获取三天前的0点时间戳 $san_end_time = strtotime('23:59:59', strtotime('-1 day', $todayTimestamp)); // 获取前天的23:59:59时间戳 $zhou_start_time = strtotime(date("Y-m-d", strtotime("-1 week")) . "00:00:00"); $zhou_end_time = time(); $yue_start_time = strtotime(date("Y-m-d", strtotime("-1 month")) . "00:00:00"); $yue_end_time = time(); $pay_list_table = M('hj_fc_buy_record'); $arr['jinri_pay_num'] = $pay_list_table->where("time BETWEEN $jinri_start_time and $jinri_end_time and type='xiaoshuo' ")->count("DISTINCT uid"); $arr['zuori_pay_num'] = $pay_list_table->where("time BETWEEN $zuo_start_time and $zuo_end_time and type='xiaoshuo'")->count("DISTINCT uid"); $arr['sanri_pay_num'] = $pay_list_table->where("time BETWEEN $san_start_time and $san_end_time and type='xiaoshuo'")->count("DISTINCT uid"); $arr['zhou_pay_num'] = $pay_list_table->where("time BETWEEN $zhou_start_time and $zhou_end_time and type='xiaoshuo'")->count("DISTINCT uid"); $arr['yue_pay_num'] = $pay_list_table->where("time BETWEEN $yue_start_time and $yue_end_time and type='xiaoshuo'")->count("DISTINCT uid"); $arr['jilei_pay_num'] = $pay_list_table->where("id>0 and type='xiaoshuo'")->count("DISTINCT uid"); $arrs['jinri_amount'] =$pay_list_table->where("time BETWEEN $jinri_start_time and $jinri_end_time and type='xiaoshuo'")->sum('coins')?$pay_list_table->where("time BETWEEN $jinri_start_time and $jinri_end_time and type='xiaoshuo'")->sum('coins'):'0'; $arrs['zuori_amount'] =$pay_list_table->where("time BETWEEN $zuo_start_time and $zuo_end_time and type='xiaoshuo'")->sum('coins')?$pay_list_table->where("time BETWEEN $zuo_start_time and $zuo_end_time and type='xiaoshuo'")->sum('coins'):'0'; $arrs['sanri_amount'] =$pay_list_table->where("time BETWEEN $san_start_time and $san_end_time and type='xiaoshuo'")->sum('coins')?$pay_list_table->where("time BETWEEN $san_start_time and $san_end_time and type='xiaoshuo'")->sum('coins'):'0'; $arrs['zhou_amount'] =$pay_list_table->where("time BETWEEN $zhou_start_time and $zhou_end_time and type='xiaoshuo'")->sum('coins')?$pay_list_table->where("time BETWEEN $zhou_start_time and $zhou_end_time and type='xiaoshuo'")->sum('coins'):'0'; $arrs['yue_amount'] =$pay_list_table->where("time BETWEEN $yue_start_time and $yue_end_time and type='xiaoshuo'")->sum('coins')?$pay_list_table->where("time BETWEEN $yue_start_time and $yue_end_time and type='xiaoshuo'")->sum('coins'):'0'; $arrs['jilei_amount'] =$pay_list_table->where("time is not null and type='xiaoshuo'")->sum('coins')?$pay_list_table->where("time is not null and type='xiaoshuo'")->sum('coins'):'0'; if (empty($arrs['jinri_amount'])) { $arrs['jinri_amount'] = "0"; } if (empty($arrs['zuori_amount'])) { $arrs['zuori_amount']= "0"; } if (empty( $arrs['sanri_amount'] )) { $arrs['sanri_amount'] = "0"; } if (empty($arrs['zhou_amount'])) { $arrs['zhou_amount']= "0"; } if (empty($arrs['yue_amount'])) { $arrs['yue_amount'] = "0"; } if (empty($arrs['jilei_amount'] )) { $arrs['jilei_amount'] = "0"; } $time_chuo = time(); $time_data= date("Y-m-d H:i",$time_chuo); $arrs['time'] =$time_chuo; $arrs['date'] =$time_data; M("admin_coins_pay")->where("uploader ='色情小说'")->save($arr); M("admin_coins_pay")->where("uploader ='色情小说'")->save($arrs); $arr_list = array($arr,$arrs); $data['code'] = '200'; $data['status'] = '1'; $data['data'] =$arr_list; echo json_encode($data); }else{ echo $this->returnData(); } } /** * tianmeiluolishuju * @param $templateid [] * @return $type 消息类型 * 另类猎奇 */ public function lieqi_shuju(){ header('Content-Type:text/json;charset=utf-8'); header('Access-Control-Allow-Origin:*'); header("Access-Control-Allow-Headers:token,Origin, X-Requested-With, Content-Type, Accept"); header('Access-Control-Allow-Methods:POST'); header('Access-Control-Expose-Headers:*'); if (!empty($_POST)){ $token = $_POST['token']; //b8e3bb6ef8747d7 if ($token != 'b8e3bb6ef8747d7') { $data['code'] = '203'; $data['msg'] = 'token错误'; echo json_encode($data); die; } $jinri_start_time = mktime(0, 0, 0, date('m'), date('d'), date('Y')); $jinri_end_time = mktime(0, 0, 0, date('m'), date('d') + 1, date('Y')) - 1; $zuo_start_time = mktime(0, 0, 0, date('m'), date('d') - 1, date('Y')); $zuo_end_time = mktime(0, 0, 0, date('m'), date('d'), date('Y')) - 1; $todayTimestamp = time(); // 获取当前时间戳 $threeDaysAgoTimestamp = strtotime('-3 days', $todayTimestamp); // 获取三天前的时间戳 $san_start_time = strtotime('midnight', strtotime('-3 days', $todayTimestamp)); // 获取三天前的0点时间戳 $san_end_time = strtotime('23:59:59', strtotime('-1 day', $todayTimestamp)); // 获取前天的23:59:59时间戳 $zhou_start_time = strtotime(date("Y-m-d", strtotime("-1 week")) . "00:00:00"); $zhou_end_time = time(); $yue_start_time = strtotime(date("Y-m-d", strtotime("-1 month")) . "00:00:00"); $yue_end_time = time(); $pay_list_table = M('hj_fc_buy_record'); $arr['jinri_pay_num'] = $pay_list_table->where("time BETWEEN $jinri_start_time and $jinri_end_time and type='lieqi' ")->count("DISTINCT uid"); $arr['zuori_pay_num'] = $pay_list_table->where("time BETWEEN $zuo_start_time and $zuo_end_time and type='lieqi'")->count("DISTINCT uid"); $arr['sanri_pay_num'] = $pay_list_table->where("time BETWEEN $san_start_time and $san_end_time and type='lieqi'")->count("DISTINCT uid"); $arr['zhou_pay_num'] = $pay_list_table->where("time BETWEEN $zhou_start_time and $zhou_end_time and type='lieqi'")->count("DISTINCT uid"); $arr['yue_pay_num'] = $pay_list_table->where("time BETWEEN $yue_start_time and $yue_end_time and type='lieqi'")->count("DISTINCT uid"); $arr['jilei_pay_num'] = $pay_list_table->where("id>0 and type='lieqi'")->count("DISTINCT uid"); $arrs['jinri_amount'] =$pay_list_table->where("time BETWEEN $jinri_start_time and $jinri_end_time and type='lieqi'")->sum('coins')?$pay_list_table->where("time BETWEEN $jinri_start_time and $jinri_end_time and type='lieqi'")->sum('coins'):'0'; $arrs['zuori_amount'] =$pay_list_table->where("time BETWEEN $zuo_start_time and $zuo_end_time and type='lieqi'")->sum('coins')?$pay_list_table->where("time BETWEEN $zuo_start_time and $zuo_end_time and type='lieqi'")->sum('coins'):'0'; $arrs['sanri_amount'] =$pay_list_table->where("time BETWEEN $san_start_time and $san_end_time and type='lieqi'")->sum('coins')?$pay_list_table->where("time BETWEEN $san_start_time and $san_end_time and type='lieqi'")->sum('coins'):'0'; $arrs['zhou_amount'] =$pay_list_table->where("time BETWEEN $zhou_start_time and $zhou_end_time and type='lieqi'")->sum('coins')?$pay_list_table->where("time BETWEEN $zhou_start_time and $zhou_end_time and type='lieqi'")->sum('coins'):'0'; $arrs['yue_amount'] =$pay_list_table->where("time BETWEEN $yue_start_time and $yue_end_time and type='lieqi'")->sum('coins')?$pay_list_table->where("time BETWEEN $yue_start_time and $yue_end_time and type='lieqi'")->sum('coins'):'0'; $arrs['jilei_amount'] =$pay_list_table->where("time is not null and type='lieqi'")->sum('coins')?$pay_list_table->where("time is not null and type='lieqi'")->sum('coins'):'0'; if (empty($arrs['jinri_amount'])) { $arrs['jinri_amount'] = "0"; } if (empty($arrs['zuori_amount'])) { $arrs['zuori_amount']= "0"; } if (empty( $arrs['sanri_amount'] )) { $arrs['sanri_amount'] = "0"; } if (empty($arrs['zhou_amount'])) { $arrs['zhou_amount']= "0"; } if (empty($arrs['yue_amount'])) { $arrs['yue_amount'] = "0"; } if (empty($arrs['jilei_amount'] )) { $arrs['jilei_amount'] = "0"; } $time_chuo = time(); $time_data= date("Y-m-d H:i",$time_chuo); $arrs['time'] =$time_chuo; $arrs['date'] =$time_data; M("admin_coins_pay")->where("uploader ='另类猎奇'")->save($arr); M("admin_coins_pay")->where("uploader ='另类猎奇'")->save($arrs); $arr_list = array($arr,$arrs); $data['code'] = '200'; $data['status'] = '1'; $data['data'] =$arr_list; echo json_encode($data); }else{ echo $this->returnData(); } } /** * 版本:1.7 * 新增/更新:add * 简述:look the name * @param $templateid [] * @return $type 消息类型 */ public function show_gonggao_list(){ header('Content-Type:text/json;charset=utf-8'); header('Access-Control-Allow-Origin:*'); header("Access-Control-Allow-Headers:token,Origin, X-Requested-With, Content-Type, Accept"); header('Access-Control-Allow-Methods:POST'); header('Access-Control-Expose-Headers:*'); if (!empty($_POST)){ $token = $_POST['token']; if ($token != 'b8e3bb6ef8747d7') { $data['code'] = '203'; $data['msg'] = 'token错误'; echo json_encode($data); die; } $all_gonggao = M("gonggao")->where("id>0")->select(); if ($all_gonggao){ $data['code'] = '200'; $data['status'] = '1'; $data['message'] = 'ok'; $data['data'] = $all_gonggao; echo json_encode($data); }else{ $data['code'] = '201'; $data['status'] = '1'; $data['message'] = 'error'; $data['data'] = array(); echo json_encode($data); } }else{ echo $this->returnData(); } } /** * 版本:2.37 * 新增/更新:开启公告按钮 * 简述:look the name * @param $templateid [] * @return $type 消息类型 */ public function on_gonggao_info(){ header('Content-Type:text/json;charset=utf-8'); header('Access-Control-Allow-Origin:*'); header("Access-Control-Allow-Headers:token,Origin, X-Requested-With, Content-Type, Accept"); header('Access-Control-Allow-Methods:POST'); header('Access-Control-Expose-Headers:*'); if (!empty($_POST)){ $token = $_POST['token']; if ($token != 'b8e3bb6ef8747d7') { $data['code'] = '203'; $data['msg'] = 'token错误'; echo json_encode($data); die; } $id=$_POST['id']; $ret = M("gonggao")->where("id='$id'")->save(array("status_"=>0)); if ($ret){ $data['code'] = '200'; $data['msg'] ="请求成功"; echo json_encode($data); }else{ $data['code'] = '201'; $data['msg'] = '请求失败'; echo json_encode($data); } }else{ echo $this->returnData(); } } /** * 版本:2.37 * 新增/更新:关闭公告按钮 * 简述:look the name * @param $templateid [] * @return $type 消息类型 */ public function off_gonggao_info(){ header('Content-Type:text/json;charset=utf-8'); header('Access-Control-Allow-Origin:*'); header("Access-Control-Allow-Headers:token,Origin, X-Requested-With, Content-Type, Accept"); header('Access-Control-Allow-Methods:POST'); header('Access-Control-Expose-Headers:*'); if (!empty($_POST)){ $token = $_POST['token']; if ($token != 'b8e3bb6ef8747d7') { $data['code'] = '203'; $data['msg'] = 'token错误'; echo json_encode($data); die; } $id=$_POST['id']; $ret = M("gonggao")->where("id='$id'")->save(array("status_"=>1)); if ($ret){ $data['code'] = '200'; $data['msg'] ="请求成功"; echo json_encode($data); }else{ $data['code'] = '201'; $data['msg'] = '请求失败'; echo json_encode($data); } }else{ echo $this->returnData(); } } /** * 版本: * 新增/更新: * 简述: * @param $templateid [] * @return $type 消息类型 */ public function admin_conins_video_tongji(){ header('Content-Type:text/json;charset=utf-8'); header('Access-Control-Allow-Origin:*'); header("Access-Control-Allow-Headers:token,Origin, X-Requested-With, Content-Type, Accept"); header('Access-Control-Allow-Methods:POST'); header('Access-Control-Expose-Headers:*'); if (!empty($_POST)){ $all_data = M("admin_coins_pay")->where("id>0")->order("id asc")->select(); $data['code'] = '200'; $data['status'] = '1'; $data['message'] = 'ok'; $data['data'] =$all_data; echo json_encode($data); }else{ echo $this->returnData(); } } /** * 版本: * 新增/更新: * 简述: * @param $templateid [] * @return $type 消息类型 */ public function admin_xiao_yang(){ header('Content-Type:text/json;charset=utf-8'); header('Access-Control-Allow-Origin:*'); header("Access-Control-Allow-Headers:token,Origin, X-Requested-With, Content-Type, Accept"); header('Access-Control-Allow-Methods:POST'); header('Access-Control-Expose-Headers:*'); $headers = getallheaders(); $token = $headers['Zidingyii'] ?? null; $vid = $headers['Vid'] ?? null; $type = $headers['Type'] ?? null; $hours_ago = date('Y-m-d H:i:s', time()); if(empty($token)){ http_response_code(401); die(); } //是否为本系统合法用户 $uesr = M("user_info")->field("id")->where("token = '$token'and token_time_out >= '$hours_ago' ")->find(); $check_info = M("token_tmpl")->where("token='$token'")->find(); //非本系统token if(empty($uesr) && empty($check_info)){ http_response_code(401); die(); } //未登录用户,不允许直接播放 if(!empty($check_info) && empty($uesr) && strtolower($type)=='m3u8'){ http_response_code(401); die(); } //未来,判断用户是否有权限播放播放(未开通的栏目不允许播放) if(!empty($uesr) && strtolower($type)=='m3u8') { if(empty($vid)) { //播放前必须带vid //die(); } //vid在库,继续判断用户是否开通了栏目 } } /** * 版本: * 新增/更新:吃瓜统计 * 简述: * @param $templateid [] * @return $type 消息类型 */ public function admin_conins_melon_tongji(){ header('Content-Type:text/json;charset=utf-8'); header('Access-Control-Allow-Origin:*'); header("Access-Control-Allow-Headers:token,Origin, X-Requested-With, Content-Type, Accept"); header('Access-Control-Allow-Methods:POST'); header('Access-Control-Expose-Headers:*'); if (!empty($_POST)){ $all_data = M("admin_coins_pay")->where("id>0")->order("sanri_amount desc")->select(); $uid = M("vip_chigua")->count("uid"); //累计付费人数 $take_coins = M("vip_chigua")->sum("take_coins"); //累计消费金额 //今日 $todaytime = date("Y-m-d ",time())."00:00:00"; //三日 $threedaytime = date("Y-m-d ", strtotime("-3 day")) . "00:00:00"; //周 $weekdaytime = date("Y-m-d ", strtotime("-1 week")) . "00:00:00"; //月 $monthdaytime = date("Y-m-d ", strtotime("-1 month")) . "00:00:00"; //今日付费金额 //$todayloginuser = count(M("vip_chigua")->where("time>='$todaytime' and uid!=0")->group("take_coins")->getField("take_coins", true)); //今日付费金额 $todayloginuser = M("vip_chigua")->where(" create_at >= '$todaytime' and uid!=0")->sum("take_coins"); //今日付费人数 $todaylogicount = M("vip_chigua")->where(" create_at >= '$todaytime' and uid!=0")->count("uid"); //昨天付费金额 $yesterdaysum = M("vip_chigua")->where(" TO_DAYS(create_at)=TO_DAYS(NOW()) - 1")->sum("take_coins"); //昨天付费人数 $yesterdaycount = M("vip_chigua")->where(" TO_DAYS(create_at)=TO_DAYS(NOW()) - 1")->count("uid"); //三天付费金额 $threedaysum = M("vip_chigua")->where(" create_at >= '$threedaytime' and uid!=0")->sum("take_coins"); //三天付费人数 $threedaycount = M("vip_chigua")->where(" create_at >= '$threedaytime' and uid!=0")->count("uid"); //周付费金额 $weekdaysum = M("vip_chigua")->where(" create_at >= '$weekdaytime' and uid!=0")->sum("take_coins"); //周付费人数 $weekdaycount = M("vip_chigua")->where(" create_at >= '$weekdaytime' and uid!=0")->count("uid"); //月付费金额 $montsum = M("vip_chigua")->where(" create_at >= '$monthdaytime' and uid!=0")->sum("take_coins"); //月付费金额 $montcount = M("vip_chigua")->where(" create_at >= '$monthdaytime' and uid!=0")->count("uid"); $all["uid"] = $uid; $all["take_coins"] = $take_coins; $all["todayloginuser"] = $todayloginuser; $all["todaylogicount"] = $todaylogicount; $all["yesterdaysum"] = $yesterdaysum; $all["yesterdaycount"] = $yesterdaycount; $all["threedaysum"] = $threedaysum; $all["threedaycount"] = $threedaycount; $all["weekdaysum"] = $weekdaysum; $all["weekdaycount"] = $weekdaycount; $all["montsum"] = $montsum; $all["montcount"] = $montcount; $data['code'] = '200'; $data['status'] = '1'; $data['message'] = 'ok'; $data['data'] =$all; echo json_encode($data); }else{ echo $this->returnData(); } } /** * 版本: * 新增/更新: * 简述: * @param $templateid [] * @return $type 消息类型 */ public function admin_home_show(){ header('Content-Type:text/json;charset=utf-8'); header('Access-Control-Allow-Origin:*'); header("Access-Control-Allow-Headers:token,Origin, X-Requested-With, Content-Type, Accept"); header('Access-Control-Allow-Methods:POST'); header('Access-Control-Expose-Headers:*'); if (!empty($_POST)){ $all_data = M("admin_shuju_list")->select(); $data['code'] = '200'; $data['status'] = '1'; $data['message'] = 'ok'; $data['data'] =$all_data; echo json_encode($data); }else{ echo $this->returnData(); } } /** * 版本:1.7 * 新增/:新增 * 简述:更新公告内容 * @param $templateid [] * @return $type 消息类型 */ public function save_gonggao_content(){ header('Content-Type:text/json;charset=utf-8'); header('Access-Control-Allow-Origin:*'); header("Access-Control-Allow-Headers:token,Origin, X-Requested-With, Content-Type, Accept"); header('Access-Control-Allow-Methods:POST'); header('Access-Control-Expose-Headers:*'); if (!empty($_POST)){ $id = $_POST['id']; $content = $_POST['content']; $yn_save = M("gonggao")->where("id=$id")->save($_POST); if ($yn_save){ $data['code'] = '200'; $data['status'] = '1'; $data['message'] = 'save_ok'; echo json_encode($data); }else{ $data['code'] = '200'; $data['status'] = '2'; $data['message'] = 'no_save'; echo json_encode($data); } }else{ echo $this->returnData(); } } /** * 版本:1.7 * 新增/更新:新增 * 简述:启用公告将其他公告关闭 * @param $templateid [] * @return $type 消息类型 */ public function open_gonggao(){ header('Content-Type:text/json;charset=utf-8'); header('Access-Control-Allow-Origin:*'); header("Access-Control-Allow-Headers:token,Origin, X-Requested-With, Content-Type, Accept"); header('Access-Control-Allow-Methods:POST'); header('Access-Control-Expose-Headers:*'); if (!empty($_POST)){ $id= $_POST['id']; $zero['type']= 0; $one['type']= 1; $one_yn = M("gonggao")->where("id=$id")->save($one); $zero_yn =M("gonggao")->where("id!=$id")->save($zero); if ($one_yn and $zero_yn){ $data['code'] = '200'; $data['status'] = '1'; $data['message'] = 'save_ok'; echo json_encode($data); }else{ $data['code'] = '200'; $data['status'] = '2'; $data['message'] = 'no_save'; echo json_encode($data); } }else{ echo $this->returnData(); } } /** * 版本:1.7 * 新增/更新:新增 * 简述:add gonggao * @param $templateid [] * @return $type 消息类型 */ public function add_gonggao(){ header('Content-Type:text/json;charset=utf-8'); header('Access-Control-Allow-Origin:*'); header("Access-Control-Allow-Headers:token,Origin, X-Requested-With, Content-Type, Accept"); header('Access-Control-Allow-Methods:POST'); header('Access-Control-Expose-Headers:*'); if (!empty($_POST)){ $content = $_POST['content']; $add_yn = M("gonggao")->add($_POST); if ($add_yn){ $data['code'] = '200'; $data['status'] = '1'; $data['message'] = 'ok'; echo json_encode($data); }else{ $data['code'] = '200'; $data['status'] = '2'; $data['message'] = 'error'; echo json_encode($data); } }else{ echo $this->returnData(); } } /** * 版本:1.7 * 新增/更新:新增 * 简述:delete gonggao * @param $templateid [] * @return $type 消息类型 */ public function delete_gonggao(){ header('Content-Type:text/json;charset=utf-8'); header('Access-Control-Allow-Origin:*'); header("Access-Control-Allow-Headers:token,Origin, X-Requested-With, Content-Type, Accept"); header('Access-Control-Allow-Methods:POST'); header('Access-Control-Expose-Headers:*'); if (!empty($_POST)){ $id = $_POST['id']; $yn_de = M("gonggao")->where("id=$id")->delete(); if ($yn_de){ $data['code'] = '200'; $data['status'] = '1'; $data['message'] = 'ok'; echo json_encode($data); }else{ $data['code'] = '200'; $data['status'] = '2'; $data['message'] = 'error'; echo json_encode($data); } }else{ echo $this->returnData(); } } /** * 版本: * 新增/更新: * 简述: * @param $templateid [] * @return $type 消息类型 */ public function video_count_tongjiss(){ header('Content-Type:text/json;charset=utf-8'); header('Access-Control-Allow-Origin:*'); header("Access-Control-Allow-Headers:token,Origin, X-Requested-With, Content-Type, Accept"); header('Access-Control-Allow-Methods:POST'); header('Access-Control-Expose-Headers:*'); if (!empty($_POST)){ $token = $_POST['token']; if ($token != 'b8e3bb6ef8747d7') { $data['code'] = '203'; $data['msg'] = 'token错误'; echo json_encode($data); die; } $page = $_POST['page']; $size = $_POST['size']; // $type_list_all =array( // array('欧美','亚洲','动漫','素人反差'), // array('黑料','网爆门','海角乱伦','麻豆传媒'), // array('探花大神','SM调教','AI换脸','另类猎奇'), // array('雪白美乳','玩偶姐姐','AV解说','甜美萝莉'), // ); $seven_time_chuo = time() - (7 * 24 * 3600); switch ($page) { case '1': $oumei_count = M("video_list_test")->where("id>0 and site='EUA'")->count(); $asian_count = M("video_list_test")->where("id>0 and site='Asian'")->count(); $dongman_count = M("video_list_test")->where("id>0 and site='Anime' or site='动画'")->count(); $fancha_count = M("video_list_test")->where("id>0 and site='FC'")->count(); $oumei_count_zhou = M("video_list_test")->where("id>0 and site='EUA' and add_time>'$seven_time_chuo'")->count(); $asian_countzhou = M("video_list_test")->where("id>0 and site='Asian' and add_time>'$seven_time_chuo'")->count(); $dongman_countzhou = M("video_list_test")->where("id>0 and site in('Anime','动画') and add_time>'$seven_time_chuo'")->count(); $fancha_countzhou = M("video_list_test")->where("id>0 and site='FC' and add_time>'$seven_time_chuo'")->count(); $oumei_list= array('name'=>'欧美','zhou'=>"$oumei_count_zhou",'all'=>"$oumei_count"); $asian_list= array('name'=>'亚洲','zhou'=>"$asian_countzhou",'all'=>"$asian_count"); $donman_list= array('name'=>'动漫','zhou'=>"$dongman_countzhou",'all'=>"$dongman_count"); $fancha_list= array('name'=>'反差','zhou'=>"$fancha_countzhou",'all'=>"$fancha_count"); $data_list = array($oumei_list,$asian_list,$donman_list,$fancha_list); break; case '2': $heiliao = M("video_list_test")->where("id>0 and site='HL'")->count(); $wangbao = M("video_list_test")->where("id>0 and site='WB'")->count(); $haijiaoluanlun = M("video_list_test")->where("id>0 and site='HJ'")->count(); $madou = M("video_list_test")->where("id>0 and site='麻豆传媒'")->count(); $heiliaozhou = M("video_list_test")->where("id>0 and site='HL' and add_time>'$seven_time_chuo'")->count(); $wangbaozhou = M("video_list_test")->where("id>0 and site='WB' and add_time>'$seven_time_chuo'")->count(); $haijiaoluanlunzhou = M("video_list_test")->where("id>0 and site='HJ' and add_time>'$seven_time_chuo'")->count(); $madouzhou = M("video_list_test")->where("id>0 and site='麻豆传媒' and add_time>'$seven_time_chuo'")->count(); $oumei_list= array('name'=>'黑料','zhou'=>"$heiliaozhou",'all'=>"$heiliao"); $asian_list= array('name'=>'网爆门','zhou'=>"$wangbaozhou",'all'=>"$wangbao"); $donman_list= array('name'=>'海角乱伦','zhou'=>"$haijiaoluanlunzhou",'all'=>"$haijiaoluanlun"); $fancha_list= array('name'=>'麻豆传媒','zhou'=>"$madouzhou",'all'=>"$madouzhou"); $data_list = array($oumei_list,$asian_list,$donman_list,$fancha_list); break; case '3': $tanhua = M("video_list_test")->where("id>0 and site='国产探花'")->count(); $smtiaojiao = M("video_list_test")->where("id>0 and site='SM调教'")->count(); $aihuanlian = M("video_list_test")->where("id>0 and site='AI'")->count(); $linglei = M("video_list_test")->where("id>0 and site='孕妇做爱' or site='性感人妖' or site='人兽动物' or site='超级大胆' or site='另类猎奇' or site='同性做爱'")->count(); $tanhuazhou = M("video_list_test")->where("id>0 and site='国产探花' and add_time>'$seven_time_chuo'")->count(); $smtiaojiaozhou = M("video_list_test")->where("id>0 and site='SM调教' and add_time>'$seven_time_chuo'")->count(); $aihuanlianzhou = M("video_list_test")->where("id>0 and site='AI' and add_time>'$seven_time_chuo'")->count(); $lingleizhou = M("video_list_test")->where("id>0 and site='孕妇做爱' or site='性感人妖' or site='人兽动物' or site='超级大胆' or site='另类猎奇' or site='同性做爱'")->count(); $oumei_list= array('name'=>'探花大神','zhou'=>"$tanhuazhou",'all'=>"$tanhua"); $asian_list= array('name'=>'sm调教','zhou'=>"$smtiaojiaozhou",'all'=>"$smtiaojiao"); $donman_list= array('name'=>'AI乱伦','zhou'=>"$aihuanlianzhou",'all'=>"$aihuanlian"); $fancha_list= array('name'=>'另类奇葩','zhou'=>"$lingleizhou",'all'=>"$linglei"); $data_list = array($oumei_list,$asian_list,$donman_list,$fancha_list); break; case '4': $xuebaimeiru = M("video_list_test")->where("id>0 and site='雪白美乳'")->count(); $wanou = M("video_list_test")->where("id>0 and site='玩偶姐姐'")->count(); $avjeishuo = M("video_list_test")->where("id>0 and site='AV解说'")->count(); $tianmei = M("video_list_test")->where("id>0 and uploader='另类猎奇'")->count(); $xuebaimeiruzhou = M("video_list_test")->where("id>0 and site='雪白美乳'")->count(); $wanouzhou = M("video_list_test")->where("id>0 and site='玩偶姐姐'")->count(); $avjeishuozhou = M("video_list_test")->where("id>0 and site='AV解说'")->count(); $tianmeizhou = M("video_list_test")->where("id>0 and uploader='粉嫩少女'")->count(); $oumei_list= array('name'=>'雪白美乳','zhou'=>"$xuebaimeiruzhou",'all'=>"$xuebaimeiru"); $asian_list= array('name'=>'玩偶姐姐','zhou'=>"$wanouzhou",'all'=>"$wanou"); $donman_list= array('name'=>'av解说','zhou'=>"$avjeishuozhou",'all'=>"$avjeishuo"); $fancha_list= array('name'=>'甜美萝莉','zhou'=>"$tianmeizhou",'all'=>"$tianmei"); $data_list = array($oumei_list,$asian_list,$donman_list,$fancha_list); break; default: echo "type error"; } if ($data_list){ $data['code'] = '200'; $data['status'] = '1'; $data['message'] = 'ok'; $data['data'] = $data_list; echo json_encode($data); }else{ $data['code'] = '200'; $data['status'] = '2'; $data['message'] = 'error'; $data['data'] = "$data_list"; echo json_encode($data); } }else{ echo $this->returnData(); } } /** * 版本: * 新增/更新: * 简述: * @param $templateid [] * @return $type 消息类型 */ public function show_video_all_count(){ header('Content-Type:text/json;charset=utf-8'); header('Access-Control-Allow-Origin:*'); header("Access-Control-Allow-Headers:token,Origin, X-Requested-With, Content-Type, Accept"); header('Access-Control-Allow-Methods:POST'); header('Access-Control-Expose-Headers:*'); if (!empty($_POST)){ $token = $_POST['token']; if ($token != 'b8e3bb6ef8747d7') { $data['code'] = '203'; $data['msg'] = 'token错误'; echo json_encode($data); die; } // $page = $_POST['page']; // $size = $_POST['size']; // $arr = M("slgj_user_feedback")->page($page, $size)->order("id desc")->select(); $type_list_all =array( array('欧美','亚洲','动漫','素人反差'), array('黑料','网爆门','海角乱伦','麻豆传媒'), array('探花大神','SM调教','AI换脸','另类猎奇'), array('雪白美乳','玩偶姐姐','AV解说','甜美萝莉'), ); $any_site_count = M("video_list_test")->where("id>0")->field("site,count(site) as wuwu")->group('site')->order('wuwu desc')->select(); $oumei_number = 0; $asian_number = 0; $anime_number = 0; $wb_number = 0; $hl_number = 0; $fc_number = 0; $hj_number = 0; $madou_number = 0; $tanhua_number=0; $ai_number=0; $linglei_number=0; $meiru_number=0; $sm_number=0; $wanou_number=0; $avjieshuo_number=0; $luoli_number=0; foreach ($any_site_count as $key => $value) { $vtype = $value['site']; $vconunt = $value['wuwu']; switch ($vtype) { case 'Anime': $anime_number += $vconunt; break; case '动画': $anime_number += $vconunt; break; case 'Asian': $asian_number += $vconunt; break; case 'EUA': $oumei_number += $vconunt; break; case 'WB': $wb_number += $vconunt; break; case 'HL': $hl_number += $vconunt; break; case 'FC': $fc_number += $vconunt; break; case 'HJ': //海角乱伦 $hj_number+= $vconunt; break; case '麻豆传媒': //麻豆传媒 $madou_number+= $vconunt; break; case '国产探花': //探花大神 $tanhua_number+= $vconunt; break; case 'AI': //明星换脸 $ai_number+= $vconunt; break; case '孕妇做爱': //另类猎奇 孕妇 $linglei_number+= $vconunt; break; case '另类猎奇': //另类猎奇 猎奇 $linglei_number+= $vconunt; break; case '人兽动物': //另类猎奇 人兽 $linglei_number+= $vconunt; break; case '性感人妖': //另类猎奇 人妖 $linglei_number+= $vconunt; break; case '同性做爱': //另类猎奇 同性 $linglei_number+= $vconunt; break; case '超级大胆': //另类猎奇 超级大胆 $linglei_number+= $vconunt; break; case '雪白美乳': $meiru_number+= $vconunt; //雪白美乳 break; case 'SM调教': $sm_number+= $vconunt; //SM调教 break; case '玩偶姐姐': $wanou_number+= $vconunt; //玩偶姐姐 break; case 'AV解说': $avjieshuo_number+= $vconunt; //av解说 break; case '制服学妹': $luoli_number+= $vconunt; //超级大胆 break; case '马尾学妹': $luoli_number+= $vconunt; //超级大胆 break; case '后入嫩穴': $luoli_number+= $vconunt; //超级大胆 break; case '超级巨臀': $luoli_number+= $vconunt; //超级大胆 break; case '美臀翘臀': $luoli_number+= $vconunt; //超级大胆 break; default: // echo $vtype; } } $all_type_number['oumei_count'] ="$oumei_number"; $all_type_number['asian_count'] ="$asian_number"; $all_type_number['anime_count'] ="$anime_number"; $all_type_number['wb_count'] = "$wb_number"; $all_type_number['fc_count']= "$fc_number"; $all_type_number['hl_count']="$hl_number"; $all_type_number['HJ_number']="$hj_number"; $all_type_number['madou_number']="$madou_number"; $all_type_number['tanhua_number']="$tanhua_number"; $all_type_number['ai_number']="$ai_number"; $all_type_number['linglei_number']="$linglei_number"; $all_type_number['meiru_number']="$meiru_number"; $all_type_number['sm_number']="$sm_number"; $all_type_number['wanou_number']="$wanou_number"; $all_type_number['avjieshuo_number']="$avjieshuo_number"; $all_type_number['luoli_number']="$luoli_number"; $data['code'] = '200'; $data['status'] = '1'; $data['message'] = ''; $data['data'] = $all_type_number; echo json_encode($data); }else{ echo $this->returnData(); } } /** * 版本: * 新增/更新: * 简述:add_test_video * @param $templateid [] * @return $type 消息类型 */ public function save_beizhu(){ header('Content-Type:text/json;charset=utf-8'); header('Access-Control-Allow-Origin:*'); header("Access-Control-Allow-Headers:token,Origin, X-Requested-With, Content-Type, Accept"); header('Access-Control-Allow-Methods:POST'); header('Access-Control-Expose-Headers:*'); if (!empty($_POST)){ $uid = $_POST['uid']; $beizhu = $_POST['beizhu']; $save_yn = M("user_info")->where("id=$uid")->save($_POST); if ($save_yn){ $data['code'] = '200'; $data['status'] = '1'; $data['message'] = 'ok'; echo json_encode($data); }else{ $data['code'] = '200'; $data['status'] = '2'; $data['message'] = 'error'; echo json_encode($data); } }else{ echo $this->returnData(); } } public function advertShowList() { // 指定允许其他域名访问 header('Access-Control-Allow-Origin:*'); // 响应类型 header('Access-Control-Allow-Methods:POST'); // 响应头设置 header('Access-Control-Allow-Headers:x-requested-with,content-type'); if (!empty($_POST)) { $token = $_POST['token']; //b8e3bb6ef8747d7 if ($token != 'b8e3bb6ef8747d7') { $data['code'] = '203'; $data['msg'] = 'token错误'; echo json_encode($data); die; } $page = $_POST['page']; $size = $_POST['size']; $arr = M("slgj_advert_list")->page($page, $size)->where("type='视频列表广告'")->select(); if ($arr) { $total = M("slgj_advert_list")->where("type='视频列表广告'")->count(); $data['code'] = '200'; $data['msg'] = '请求成功'; $data['data'] = $arr; $data['total'] = $total; echo json_encode($data); } else { $data['code'] = '201'; $data['msg'] = '暂无数据'; $data['data'] = array(); $data['total'] = "0"; echo json_encode($data); } } else { $data['code'] = '202'; $data['msg'] = '参数不正确'; echo json_encode($data); die; } } /** * 版本:1.7 * 新增/更新:新增 * 简述:片源统计统计 * @param $templateid [] * @return $type 消息类型 */ public function video_add_tongJi(){ header('Content-Type:text/json;charset=utf-8'); header('Access-Control-Allow-Origin:*'); header("Access-Control-Allow-Headers:token,Origin, X-Requested-With, Content-Type, Accept"); header('Access-Control-Allow-Methods:POST'); header('Access-Control-Expose-Headers:*'); if (!empty($_POST)){ $token = $_POST['token']; if ($token != 'b8e3bb6ef8747d7') { $data['code'] = '203'; $data['msg'] = 'token错误'; echo json_encode($data); die; } $page = $_POST['page']; $type=$_POST['type']; $page_one = ($page - 1) * 50; switch ($type) { case 'all': $video_seven_add = M("video_list_test")->where("id>0 and uploader in ('AV解说','SM调教','女子SPA','嫖娼站街女','日本无码','港台经典三级','SWAG','亚洲','动漫','厕所偷拍','另类猎奇','国产探花','大尺度综艺','户外车震','男同性恋','抄底偷拍','探花大神','明星换脸','欧美','海角乱伦','玩偶姐姐','福利姬','粉嫩少女','素人反差','网曝门','雪白美乳','顶臀街射','麻豆传媒','黑料吃瓜','性爱知识','吃瓜','有声小说','漫画')")->field("uploader,count('uploader') as count_video")->group('uploader')->order('count_video DESC')->select(); break; case 'vip': $video_seven_add = M("video_list_test")->where("id>0 and uploader in ('黑料吃瓜','海角乱伦','明星换脸','麻豆传媒','探花大神','玩偶姐姐','SM调教','甜美萝莉','雪白美乳','福利姬','大尺度综艺','SWAG','户外车震','男同性恋')")->field("uploader,count('uploader') as count_video")->group('uploader')->order('count_video DESC')->select(); break; case 'coins': $video_seven_add = M("video_list_test")->where("id>0 and uploader in ('网曝门','AV解说','另类猎奇','女子SPA','嫖娼站街女','日本无码','港台经典三级','粉嫩少女','素人反差','顶臀街射','抄底偷拍','厕所偷拍','性爱知识','有声小说','漫画')")->field("uploader,count('uploader') as count_video")->group('uploader')->order('count_video DESC')->select(); break; case 'free': $video_seven_add = M("video_list_test")->where("id>0 and uploader in ('亚洲','欧美','动漫','吃瓜')")->field("uploader,count('uploader') as count_video")->group('uploader')->order('count_video DESC')->select(); break; default: echo "type error"; } $seven_time_chuo = time() - (7 * 24 * 3600); foreach ($video_seven_add as $key => $value) { $video_uplodaer=$value['uploader']; if($value['uploader']=="性爱知识"){ $video_seven_add[$key]['uploader']='性爱老师'; }elseif($value['uploader']=="吃瓜"){ $video_seven_add[$key]['uploader']='吃瓜'; }else{ $video_seven_add[$key]['uploader']=$value['uploader']; } # code... $video_seven_add[$key]['seven']= M("video_list_test")->where("add_time>'$seven_time_chuo' and uploader='$video_uplodaer'")->count();; } if ($type=='coins' or $type=='all' ){ $xiaoshuo['uploader'] ='色情小说'; $xiaoshuo['count_video'] =M("novel_list")->where("id>0")->count(); $xiaoshuo['seven'] =M("novel_list")->where("add_time>'$seven_time_chuo'")->count(); array_push($video_seven_add,$xiaoshuo); $sanp['uploader'] ='3P'; $sanp['count_video'] =M("video_list_test")->where("uploader='Pornhub' and site='3P'")->count(); $sanp['seven'] =M("video_list_test")->where("uploader='Pornhub' and site='3P' and add_time>'$seven_time_chuo'")->count(); array_push($video_seven_add,$sanp); $shiba['uploader'] ='18岁'; $shiba['count_video'] =M("video_list_test")->where("uploader='Pornhub' and site='18岁'")->count(); $shiba['seven'] =M("video_list_test")->where("uploader='Pornhub' and site='18岁' and add_time>'$seven_time_chuo'")->count(); array_push($video_seven_add,$shiba); $kj['uploader'] ='口交'; $kj['count_video'] =M("video_list_test")->where("uploader='Pornhub' and site='KJ'")->count(); $kj['seven'] =M("video_list_test")->where("uploader='Pornhub' and site='KJ' and add_time>'$seven_time_chuo'")->count(); array_push($video_seven_add,$kj); $jipinsetu['uploader'] ='极品色图'; $jipinsetu['count_video'] =M("video_list_test")->where("site in ('超模','超爽')")->count(); $jipinsetu['seven'] =M("video_list_test")->where("site in ('超模','超爽') and add_time>'$seven_time_chuo'")->count(); array_push($video_seven_add,$jipinsetu); $fenglou['uploader'] ='凤楼约炮'; $fenglou['count_video'] =M("69ttb")->count(); $fenglou['seven'] =M("69ttb")->where("timess>'$seven_time_chuo'")->count(); array_push($video_seven_add,$fenglou); } $data['code'] = '200'; $data['status'] = '1'; $data['message'] = 'ok'; $data['data'] = $video_seven_add; echo json_encode($data); }else{ echo $this->returnData(); } } /** * 版本:2.00 * 新增/更新: * 简述: * @param $templateid [] * @return $type 消息类型 */ public function now_online_person(){ header('Content-Type:text/json;charset=utf-8'); header('Access-Control-Allow-Origin:*'); header("Access-Control-Allow-Headers:token,Origin, X-Requested-With, Content-Type, Accept"); header('Access-Control-Allow-Methods:POST'); header('Access-Control-Expose-Headers:*'); if (!empty($_POST)){ $token = $_POST['token']; if ($token != 'b8e3bb6ef8747d7') { $data['code'] = '203'; $data['msg'] = 'token错误'; echo json_encode($data); die; } $noe_time = time(); $ten_min = $noe_time - (60*10); $one_ten_min = $noe_time - (60*60); $two_ten_min = $noe_time - (2*60*60); $video_seven_add['online']= M("user_info")->where("last_login_time>'$ten_min'")->count();; $video_seven_add['last_one_online']= M("user_info")->where("last_login_time BETWEEN $two_ten_min and $one_ten_min")->count();; $data['code'] = '200'; $data['status'] = '1'; $data['message'] = 'ok'; $data['data'] = $video_seven_add; echo json_encode($data); }else{ echo $this->returnData(); } } /** * 新增活跃 * 一 * @param $templateid [] * @return $type 消息类型 * 全部活跃 */ public function all_huoyue_renshu(){ header('Content-Type:text/json;charset=utf-8'); header('Access-Control-Allow-Origin:*'); header("Access-Control-Allow-Headers:token,Origin, X-Requested-With, Content-Type, Accept"); header('Access-Control-Allow-Methods:POST'); header('Access-Control-Expose-Headers:*'); if (!empty($_POST)){ $token = $_POST['token']; //b8e3bb6ef8747d7 if ($token != 'b8e3bb6ef8747d7') { $data['code'] = '203'; $data['msg'] = 'token错误'; echo json_encode($data); die; } $jinri_start_time = mktime(0, 0, 0, date('m'), date('d'), date('Y')); $jinri_end_time = mktime(0, 0, 0, date('m'), date('d') + 1, date('Y')) - 1; $zuo_start_time = mktime(0, 0, 0, date('m'), date('d') - 1, date('Y')); $zuo_end_time = mktime(0, 0, 0, date('m'), date('d'), date('Y')) - 1; $todayTimestamp = time(); // 获取当前时间戳 $threeDaysAgoTimestamp = strtotime('-3 days', $todayTimestamp); // 获取三天前的时间戳 $san_start_time = strtotime('midnight', strtotime('-3 days', $todayTimestamp)); // 获取三天前的0点时间戳 $san_end_time = strtotime('23:59:59', strtotime('-1 day', $todayTimestamp)); // 获取前天的23:59:59时间戳 $zhou_start_time = strtotime(date("Y-m-d", strtotime("-1 week")) . "00:00:00"); $zhou_end_time = time(); $yue_start_time = strtotime(date("Y-m-d", strtotime("-1 month")) . "00:00:00"); $yue_end_time = time(); $user_info_list = M('user_info'); $user_novip = $user_info_list->where("vip_yn=0 ")->field('id')->select(); $arr['jinri_xinzeng_num'] = $user_info_list->where("add_time BETWEEN $jinri_start_time and $jinri_end_time ")->count(); $arr['zuori_xinzeng_num'] = $user_info_list->where("add_time BETWEEN $zuo_start_time and $zuo_end_time ")->count(); $arr['sanri_xinzeng_num'] = $user_info_list->where("add_time BETWEEN $san_start_time and $san_end_time")->count(); // echo PHP_EOL.$user_info_list->_sql(); $arr['zhou_xinzeng_num'] = $user_info_list->where("add_time BETWEEN $zhou_start_time and $zhou_end_time ")->count(); $arr['yue_xinzeng_num'] = $user_info_list->where("add_time BETWEEN $yue_start_time and $yue_end_time")->count(); $arr['jilei_xinzeng_num'] = $user_info_list->where("id>0 ")->count(); $huoyue = M("huoyue_list"); $huoyue_jin = M("huoyue_list")->where("time BETWEEN $jinri_start_time and $jinri_end_time ")->field("uid")->group("uid")->select(); $huoyue_zuo = M("huoyue_list")->where(" time BETWEEN $zuo_start_time and $zuo_end_time ")->field("uid")->group("uid")->select(); $huoyue_san = M("huoyue_list")->where("time BETWEEN $san_start_time and $san_end_time ")->field("uid")->group("uid")->select();; // echo PHP_EOL.M("huoyue_list")->_sql(); $huoyue_zhou = M("huoyue_list")->where(" time BETWEEN $zhou_start_time and $zhou_end_time ")->field("uid")->group("uid")->select(); $huoyue_yue = M("huoyue_list")->where(" time BETWEEN $yue_start_time and $yue_end_time")->field("uid")->group("uid")->select(); $huoyue_jilei = $user_info_list->where("last_login_time is not null ")->field("id")->select(); $arrs['jinri_huoyue_num'] =count($huoyue_jin); $arrs['zuori_huoyue_num'] =count($huoyue_zuo); $arrs['sanri_huoyue_num'] = count($huoyue_san); $arrs['zhou_huoyue_num'] =count($huoyue_zhou); $arrs['yue_huoyue_num'] =count($huoyue_yue); $arrs['jilei_huoyue_num'] =count($huoyue_jilei); $arr_list = array($arr,$arrs); $data['code'] = '200'; $data['status'] = '1'; $data['message'] = ''; $data['data'] =$arr_list; echo json_encode($data); }else{ echo $this->returnData(); } } /** * 版本: * 新增/更新: * 简述: * @param $templateid [] * @return $type 消息类型 * 免费活跃 */ public function free_huoyue_renshu(){ header('Content-Type:text/json;charset=utf-8'); header('Access-Control-Allow-Origin:*'); header("Access-Control-Allow-Headers:token,Origin, X-Requested-With, Content-Type, Accept"); header('Access-Control-Allow-Methods:POST'); header('Access-Control-Expose-Headers:*'); if (!empty($_POST)){ $jinri_start_time = mktime(0, 0, 0, date('m'), date('d'), date('Y')); $jinri_end_time = mktime(0, 0, 0, date('m'), date('d') + 1, date('Y')) - 1; $zuo_start_time = mktime(0, 0, 0, date('m'), date('d') - 1, date('Y')); $zuo_end_time = mktime(0, 0, 0, date('m'), date('d'), date('Y')) - 1; $todayTimestamp = time(); // 获取当前时间戳 $threeDaysAgoTimestamp = strtotime('-3 days', $todayTimestamp); // 获取三天前的时间戳 $san_start_time = strtotime('midnight', strtotime('-3 days', $todayTimestamp)); // 获取三天前的0点时间戳 $san_end_time = strtotime('23:59:59', strtotime('-1 day', $todayTimestamp)); // 获取前天的23:59:59时间戳 $zhou_start_time = strtotime(date("Y-m-d", strtotime("-1 week")) . "00:00:00"); $zhou_end_time = time(); $yue_start_time = strtotime(date("Y-m-d", strtotime("-1 month")) . "00:00:00"); $yue_end_time = time(); $vip_user= M("user_info")->where("vip_money is null")->field("id")->select(); $last_id = array_column($vip_user, 'id'); $str = json_encode($last_id); $str = substr($str, 1, -1); $huoyue = M("huoyue_list"); $huoyue_jin = M("huoyue_list")->where("uid in($str) and time BETWEEN $jinri_start_time and $jinri_end_time ")->field("uid")->group("uid")->select(); $huoyue_zuo = M("huoyue_list")->where("uid in($str) and time BETWEEN $zuo_start_time and $zuo_end_time ")->field("uid")->group("uid")->select(); $huoyue_san = M("huoyue_list")->where("uid in($str) and time BETWEEN $san_start_time and $san_end_time ")->field("uid")->group("uid")->select();; // echo PHP_EOL.M("huoyue_list")->_sql(); $huoyue_zhou = M("huoyue_list")->where(" uid in($str) and time BETWEEN $zhou_start_time and $zhou_end_time ")->field("uid")->group("uid")->select(); $huoyue_yue = M("huoyue_list")->where(" uid in($str) and time BETWEEN $yue_start_time and $yue_end_time")->field("uid")->group("uid")->select(); $huoyue_jilei = M("user_info")->where("last_login_time is not null and vip_money is null ")->field("id")->select(); $arrs['jinri_huoyue_num'] =count($huoyue_jin); $arrs['zuori_huoyue_num'] =count($huoyue_zuo); $arrs['sanri_huoyue_num'] = count($huoyue_san); $arrs['zhou_huoyue_num'] =count($huoyue_zhou); $arrs['yue_huoyue_num'] =count($huoyue_yue); $arrs['jilei_huoyue_num'] =count($huoyue_jilei); $data['code'] = '200'; $data['status'] = '1'; $data['message'] = ''; $data['data'] =$arrs; echo json_encode($data); }else{ echo $this->returnData(); } } /** * 版本: * 新增/更新: * 简述:fu4fei4huo2yue4 * @param $templateid [] * @return $type 消息类型 * 付费活跃 */ public function vip_huoyue_renshu(){ header('Content-Type:text/json;charset=utf-8'); header('Access-Control-Allow-Origin:*'); header("Access-Control-Allow-Headers:token,Origin, X-Requested-With, Content-Type, Accept"); header('Access-Control-Allow-Methods:POST'); header('Access-Control-Expose-Headers:*'); if (!empty($_POST)){ $jinri_start_time = mktime(0, 0, 0, date('m'), date('d'), date('Y')); $jinri_end_time = mktime(0, 0, 0, date('m'), date('d') + 1, date('Y')) - 1; $zuo_start_time = mktime(0, 0, 0, date('m'), date('d') - 1, date('Y')); $zuo_end_time = mktime(0, 0, 0, date('m'), date('d'), date('Y')) - 1; $todayTimestamp = time(); // 获取当前时间戳 $threeDaysAgoTimestamp = strtotime('-3 days', $todayTimestamp); // 获取三天前的时间戳 $san_start_time = strtotime('midnight', strtotime('-3 days', $todayTimestamp)); // 获取三天前的0点时间戳 $san_end_time = strtotime('23:59:59', strtotime('-1 day', $todayTimestamp)); // 获取前天的23:59:59时间戳 $zhou_start_time = strtotime(date("Y-m-d", strtotime("-1 week")) . "00:00:00"); $zhou_end_time = time(); $yue_start_time = strtotime(date("Y-m-d", strtotime("-1 month")) . "00:00:00"); $yue_end_time = time(); $vip_user= M("user_info")->where("vip_money=1")->field("id")->select(); $last_id = array_column($vip_user, 'id'); $str = json_encode($last_id); $str = substr($str, 1, -1); $huoyue = M("huoyue_list"); $huoyue_jin = M("huoyue_list")->where("uid in($str) and time BETWEEN $jinri_start_time and $jinri_end_time ")->field("uid")->group("uid")->select(); $huoyue_zuo = M("huoyue_list")->where(" uid in($str) and time BETWEEN $zuo_start_time and $zuo_end_time ")->field("uid")->group("uid")->select(); $huoyue_san = M("huoyue_list")->where("uid in($str) and time BETWEEN $san_start_time and $san_end_time ")->field("uid")->group("uid")->select();; // echo PHP_EOL.M("huoyue_list")->_sql(); $huoyue_zhou = M("huoyue_list")->where("uid in($str) and time BETWEEN $zhou_start_time and $zhou_end_time ")->field("uid")->group("uid")->select(); $huoyue_yue = M("huoyue_list")->where(" uid in($str) and time BETWEEN $yue_start_time and $yue_end_time")->field("uid")->group("uid")->select(); $huoyue_jilei = M("user_info")->where("last_login_time is not null and vip_money=1")->field("id")->select(); $arrs['jinri_huoyue_num'] =count($huoyue_jin); $arrs['zuori_huoyue_num'] =count($huoyue_zuo); $arrs['sanri_huoyue_num'] = count($huoyue_san); $arrs['zhou_huoyue_num'] =count($huoyue_zhou); $arrs['yue_huoyue_num'] =count($huoyue_yue); $arrs['jilei_huoyue_num'] =count($huoyue_jilei); $data['code'] = '200'; $data['status'] = '1'; $data['message'] = ''; $data['data'] =$arrs; echo json_encode($data); }else{ echo $this->returnData(); } } /** * 版本: * 新增/更新: * 简述: * @param $templateid [] * @return $type 消息类型 */ public function home_url_list(){ header('Content-Type:text/json;charset=utf-8'); header('Access-Control-Allow-Origin:*'); header("Access-Control-Allow-Headers:token,Origin, X-Requested-With, Content-Type, Accept"); header('Access-Control-Allow-Methods:POST'); header('Access-Control-Expose-Headers:*'); if (!empty($_POST)){ $token = $_POST['token']; //b8e3bb6ef8747d7 if ($token != 'b8e3bb6ef8747d7') { $data['code'] = '203'; $data['msg'] = 'token错误'; echo json_encode($data); die; } $img_list = M("shouye_url")->where("type='yj'")->order('id asc')->select(); if ($img_list){ $data['code'] = '200'; $data['status'] = '1'; $data['message'] = 'ok'; $data['data'] =$img_list; echo json_encode($data); }else{ $data['code'] = '200'; $data['status'] = '2'; $data['message'] = 'null'; $data['data'] = $img_list; echo json_encode($data); } }else{ echo $this->returnData(); } } /** * 版本:1.8 * 新增/更新:add * 简述:上传街拍 * @param $templateid [] * @return $type 消息类型 */ public function upload_video_new() { ini_set('upload_max_filesize', '4048M'); ini_set('post_max_size', '4048M'); header('Content-Type:text/json;charset=utf-8'); header('Access-Control-Allow-Origin:*'); header("Access-Control-Allow-Headers:token,Origin, X-Requested-With, Content-Type, Accept"); header('Access-Control-Allow-Methods:POST'); header('Access-Control-Expose-Headers:*'); if (!empty($_POST)) { $img = $_FILES['mp4']; $uploader = $_POST['uploader']; $title = $_POST['title']; switch ($uploader) { case '1': $uploader_name = '顶臀街射'; $videoPath = '/home2/videos/one/DTJS/MP4/'; // 视频集合的上传目录 $url_path = 'https://www.5uafocvs4xlibumya2.xyz/videos/one/DTJS/MP4/'; if (!file_exists($videoPath)) { mkdir($videoPath, 0777, true); } break; case '2': $uploader_name = '抄底偷拍'; $videoPath = '/home2/videos/one/CDTP/MP4/'; // 视频集合的上传目录 $url_path = 'https://www.5uafocvs4xlibumya2.xyz/videos/one/CDTP/MP4/'; if (!file_exists($videoPath)) { mkdir($videoPath, 0777, true); } break; case '3': $uploader_name = '厕所偷拍'; $videoPath = '/home2/videos/one/CSTP/MP4/'; // 视频集合的上传目录 $url_path = 'https://www.5uafocvs4xlibumya2.xyz/videos/one/CSTP/MP4/'; if (!file_exists($videoPath)) { mkdir($videoPath, 0777, true); } case '4': $uploader_name = '厕所偷拍'; $videoPath = '/home2/videos/one/CSTP/MP4/'; // 视频集合的上传目录 $url_path = 'https://www.5uafocvs4xlibumya2.xyz/videos/one/CSTP/MP4/'; if (!file_exists($videoPath)) { mkdir($videoPath, 0777, true); } case '5': $uploader_name = '厕所偷拍'; $videoPath = '/home2/videos/one/CSTP/MP4/'; // 视频集合的上传目录 $url_path = 'https://www.5uafocvs4xlibumya2.xyz/videos/one/CSTP/MP4/'; if (!file_exists($videoPath)) { mkdir($videoPath, 0777, true); } break; default: echo "type error"; } $token = $_POST['token']; //b8e3bb6ef8747d7 if ($token != 'b8e3bb6ef8747d7') { $data['code'] = '203'; $data['msg'] = 'token错误'; echo json_encode($data); die; } // 上传视频集合 $configVideo = array( 'maxSize' => 0, // 设置视频上传大小(100MB) 'exts' => array('mp4', 'avi', 'mkv', 'mov','MOV','MP4'), // 设置视频上传类型 'rootPath' => "$videoPath", // 设置附件上传根目录 ); $uploadVideo = new \Think\Upload($configVideo); // 实例化视频上传类 // 上传视频集合 $infoVideo = $uploadVideo->upload(); $title_list = explode(',',$title); $videoPaths = ''; // 存储上传的视频文件路径 foreach ($infoVideo as $key => $value) { $savepath = $value['savepath']; $savename = $value['savename']; $videoPaths = $videoPath .$savepath . $savename ; $url_videoPaths = $url_path .$savepath . $savename ; $fancha_list[$key]['uploader'] = $uploader_name; $fancha_list[$key]['title'] = $title_list[$key]; $fancha_list[$key]['mp4_path'] = $videoPaths; $fancha_list[$key]['url_path'] = $url_videoPaths; $fancha_list[$key]['type'] = '0'; M("upload_videos_list")->add($fancha_list[$key]); } // 返回上传成功的文件路径 $this->ajaxReturn(array( 'status' => 1, 'message' => '上传成功', 'data' => $fancha_list, )); } else { echo $this->returnData(); } } //你好111,你好2222,你好333,你好444,你好555 //413 Request Entity Too Large /** * 版本: * 新增/更新: * 简述: * @param $templateid [] * @return $type 消息类型 */ public function take_photo_on_street_list(){ header('Content-Type:text/json;charset=utf-8'); header('Access-Control-Allow-Origin:*'); header("Access-Control-Allow-Headers:token,Origin, X-Requested-With, Content-Type, Accept"); header('Access-Control-Allow-Methods:POST'); header('Access-Control-Expose-Headers:*'); if (!empty($_POST)){ $page = $_POST['page']; $type=$_POST['type']; $page_one = ($page - 1) * 50; switch ($type) { case '1': $paid_agent_list = M("upload_videos_list")->where("uploader='顶臀街射' and type!='4'")->order('id desc')->LIMIT($page_one, 50)->select(); $all_num = M("upload_videos_list")->where("uploader='顶臀街射'")->count(); break; case '2': $paid_agent_list = M("upload_videos_list")->where("uploader='抄底偷拍' and type!='4'")->order('id desc')->LIMIT($page_one, 50)->select(); $all_num =M("upload_videos_list")->where("uploader='抄底偷拍'")->count(); break; case '3': $paid_agent_list = M("upload_videos_list")->where("uploader='厕所偷拍' and type!='4'")->order('id desc')->LIMIT($page_one, 50)->select(); $all_num =M("upload_videos_list")->where("uploader='厕所偷拍'")->count(); break; default: echo "type error"; } if ($paid_agent_list){ $data['code'] = '200'; $data['status'] = '1'; $data['message'] = 'ok'; $data['all_num'] = $all_num; $data['data'] = $paid_agent_list; echo json_encode($data); }else{ $data['code'] = '200'; $data['status'] = '2'; $data['message'] = 'null'; $data['all_num'] = 0; $data['data'] = $paid_agent_list; echo json_encode($data); } }else{ echo $this->returnData(); } } /** * 版本: * 新增/更新: * 简述: * @param $templateid [] * @return $type 消息类型 */ public function delete_take_photo(){ header('Content-Type:text/json;charset=utf-8'); header('Access-Control-Allow-Origin:*'); header("Access-Control-Allow-Headers:token,Origin, X-Requested-With, Content-Type, Accept"); header('Access-Control-Allow-Methods:POST'); header('Access-Control-Expose-Headers:*'); if (!empty($_POST)){ $id = $_POST['id']; $mp4_path = M("upload_videos_list")->where("id=$id")->getField("mp4_path"); $video_id = M("upload_videos_list")->where("id=$id")->getField("video_list_id"); $type_four['type'] = 4; $yn_delete = M("upload_videos_list")->where("id=$id")->save($type_four); $file = "$mp4_path"; M("video_twelve_suiji_test")->where("v_id=$video_id")->delete(); M("video_twelve_suiji")->where("v_id=$video_id")->delete(); M("video_list_test")->where("id=$video_id")->delete(); if (unlink($file) and $yn_delete) { $data['message'] = 'ok'; echo json_encode($data); } else { $data['message'] = 'error'; echo json_encode($data); } }else{ echo $this->returnData(); } } /** * 版本:1.75 * 新增/更新:add * 简述:save_home_url * @param $templateid [] * @return $type 消息类型 */ public function update_home_url(){ header('Content-Type:text/json;charset=utf-8'); header('Access-Control-Allow-Origin:*'); header("Access-Control-Allow-Headers:token,Origin, X-Requested-With, Content-Type, Accept"); header('Access-Control-Allow-Methods:POST'); header('Access-Control-Expose-Headers:*'); if (!empty($_POST)){ $usr_c = $_POST['url']; $id = $_POST['id']; $save = M("shouye_url")->where("id=$id")->save($_POST); if($save){ $data['code'] = '200'; $data['status'] = '1'; $data['message'] = 'ok'; echo json_encode($data); }else{ $data['code'] = '200'; $data['status'] = '2'; $data['message'] = 'error'; echo json_encode($data); } }else{ echo $this->returnData(); } } }