作者 郭鑫

接口调试提交

... ... @@ -20,35 +20,39 @@ use api\portal\model\CodeModel;
class CommonController extends HomeBaseController
{
// connect 1 登录注册 ,2其他
// public function _initialize()
// {
// if($this->request->param('connect')){
// $connect = $this->request->param('connect');
// }else{
// $connect = 2;
// }
// if($connect == 2){
// $where_firstMember['token'] = $this->request->param('token');
// $firstMember = Db::name('Member')->where($where_firstMember)->field('id,update_time')->find();
// if($firstMember){
// if(($firstMember['update_time']+604800) < time() ){
// $firstStr = rand(1000,9999).time().rand(100,999);
// $firstData['token'] = $this->md5($firstStr);
// $firstData['update_time'] = time();
// $firstData['status'] = 1;
// $firstLogin = Db::name('Member')->where($where_firstMember)->update($firstData);
// if($firstLogin){
// $this->apiResponse('0','请重新登录');
// }else{
// $this->apiResponse('0','token重置失败');
// }
// }
// }else{
// $this->apiResponse('0','暂未注册');
// }
// }
//
// }
public function _initialize()
{
if($this->request->param('connect')){
$connect = $this->request->param('connect');
}else{
$connect = 2;
}
if($connect == 2){
$where_firstMember['token'] = $this->request->param('token');
$firstMember = Db::name('Member')->where($where_firstMember)->field('id,update_time,status')->find();
if($firstMember){
if($firstMember['status'] == 9){
$this->apiResponse('0','您已被拉黑,请联系管理员');
}else{
if(($firstMember['update_time']+604800) < time() ){
$firstStr = rand(1000,9999).time().rand(100,999);
$firstData['token'] = $this->md5($firstStr);
$firstData['update_time'] = time();
$firstData['status'] = 1;
$firstLogin = Db::name('Member')->where($where_firstMember)->update($firstData);
if($firstLogin){
$this->apiResponse('0','请重新登录');
}else{
$this->apiResponse('0','token重置失败');
}
}
}
}else{
$this->apiResponse('0','暂未注册');
}
}
}
/**
* API返回信息格式函数 ;0失败,1成功,-1需要登录
* @param string $code
... ...
... ... @@ -131,7 +131,7 @@ class IntermediaryController extends CommonController
public function left($token){
$where_member['token'] = $token;
$where_member['status'] = 1;
$member = Db::name('Member')->where($where_member)->field('name,id,start,reputation,company,store,quarters,tel,city,pic,money,get_money')->find();
$member = Db::name('Member')->where($where_member)->field('name,id,start,reputation,company,store,quarters,tel,city,pic,money,get_money,referee_tel')->find();
if(!$member){
$this->apiResponse('0','用户信息错误');
}
... ... @@ -399,7 +399,7 @@ class IntermediaryController extends CommonController
* @title 中介个人中心我的资料(sure)
* @description 接口说明
* @author 开发者
* @url /api/portal/Intermediary/myDetail
* @url /api/portal/Intermediary/mySelf
* @method POST
* @param name:token type:int require:1 default: other: desc:token
*/
... ... @@ -407,9 +407,13 @@ class IntermediaryController extends CommonController
$data = $request->param();
$my = $this->left($data['token']);
$final['intermediary'] = $my;
$where_card['user_id'] = $my['id'];
$where_card['status'] = 1;
$card = Db::name('Card')->where($where_card)->select()->toArray();
$where_card['c.user_id'] = $my['id'];
$where_card['c.status'] = 1;
$card = Db::name('Card')->alias('c')
->where($where_card)
->join("Bank b",'b.id=c.bank_id')
->field('c.id,b.name,c.card_num')
->select()->toArray();
$final['card'] = $card;
$this->apiResponse('1','成功',$final);
}
... ... @@ -418,7 +422,7 @@ class IntermediaryController extends CommonController
* @title 中介资料修改(sure)
* @description 接口说明
* @author 开发者
* @url /api/portal/Intermediary/myIndex
* @url /api/portal/Intermediary/myChange
* @method POST
* @param name:token type:int require:1 default: other: desc:token
* @param name:company type:int require:1 default: other: desc:所属公司
... ... @@ -428,18 +432,29 @@ class IntermediaryController extends CommonController
* @data status:'状态(1->待发布,2->已发布,待报价,3->已成交,4->未交保证金,5->已过期,6->未选择中介,7->中介未确认,8->报价人数不足,9->删除)'
*/
public function myChange(Request $request){
$update_member = $request->param();
$update_member['status'] = 1;
$update_member['type'] = 2;
$model = new MemberModel();
$member = $model->update($update_member);
if(!$member){
$this->apiResponse('0','更新失败');
$data = $request->param();
$where_member['token'] = $data['token'];
$where_member['status'] = 1;
$member = Db::name('Member')->where($where_member)->find();
if(!empty($data['company'])){
$update_member['company'] = $data['company'];
$update_member['id'] = $member['id'];
$update_member['store'] = $data['store'];
$update_member['quarters'] = $data['quarters'];
$model = new MemberModel();
$member = $model->isUpdate(true)->save($update_member);
if(!$member){
$this->apiResponse('0','中介信息有误');
}else{
$this->apiResponse('1','成功');
}
}else{
$this->apiResponse('1','更新成功');
if(!$member){
$this->apiResponse('0','中介信息有误');
}else{
$this->apiResponse('1','成功',$member);
}
}
}
... ... @@ -450,7 +465,6 @@ class IntermediaryController extends CommonController
* @url /api/portal/Intermediary/checkIn
* @method POST
* @param name:token type:int require:1 default: other: desc:token
* @return data:''@
*/
public function checkIn(Request $request){
$data = $request->param();
... ...
... ... @@ -39,7 +39,7 @@ class ThirdsendController extends HomeBaseController
// 查询中介报价
// $need_id 需求id
public function Offer($user_id,$need_id){
public function Offer($user_id,$need_id){
$where_agency['status'] = 2;
$where_agency['create_time'] = array('lt',time());
$where_agency['need_id'] = $need_id;
... ... @@ -78,7 +78,7 @@ class ThirdsendController extends HomeBaseController
// 30分钟后发布(sure)(分钟执行)
public function thirdSend(){
public function thirdSend(){
Db::startTrans();
$where_need['status'] = 2;
$userNeedList = Db::name('UserNeed')->where($where_need)->field('id,pay_time')->select()->toArray();
... ... @@ -103,7 +103,7 @@ class ThirdsendController extends HomeBaseController
}
// 规定时间结束报价(sure)(分钟执行)
public function over()
public function over()
{
Db::startTrans();
// 查询用户发布需求信息
... ... @@ -131,12 +131,21 @@ class ThirdsendController extends HomeBaseController
$agen_arr = array();
$money_arr = array();
if ($agency_list) {
// 删除十万以内报价
foreach ($agency_list as $tenk=>$tenv){
$ten_money = $tenv['housing_price'] * 10000 + $tenv['assessment_tax'] + $tenv['security_tax'] + $tenv['else_tax'] + $tenv['service_charge'];
if($ten_money > 1000000){
$is_trueMoney[] = $tenv;
}
}
// 判断是否超过三个报价人
if (count($agency_list) >= 3) {
if (count($is_trueMoney) >= 3) {
// 查询三人中是否有品牌中介
// 循环匹配品牌企业
foreach ($agency_list as $agencyk => $agencyv) {
foreach ($is_trueMoney as $agencyk => $agencyv) {
foreach ($band_list as $brak => $brav) {
// 判断是否在品牌企业中
if (strstr($brav, $agencyv['company']) !== false) {
... ... @@ -216,6 +225,7 @@ class ThirdsendController extends HomeBaseController
$add_a['user_id'] = $changeva['agency_id'];
$add_a['title'] = '报价人数不足';
$add_a['type'] = 1;
$add_a['reason'] = 1;
$add_a['money'] = $changeva['deposit'];
$add_a['create_time'] = time();
$add_a['update_time'] = time();
... ... @@ -246,6 +256,7 @@ class ThirdsendController extends HomeBaseController
$add_del['need_id'] = $uNeedv['id'];
$add_del['user_id'] = $uNeedv['user_id'];
$add_del['title'] = '报价人数不足';
$add_del['reason'] = 1;
$add_del['type'] = 1;
$add_del['money'] = $uNeedv['pay_money'];
$add_del['create_time'] = time();
... ... @@ -311,7 +322,7 @@ class ThirdsendController extends HomeBaseController
}
// 三天用户选择(sure)(天执行)
public function userChoose(){
public function userChoose(){
Db::startTrans();
// 查询用户发布需求信息
$where_need['status'] = 5;
... ... @@ -382,7 +393,7 @@ class ThirdsendController extends HomeBaseController
// 三天中介确认
public function intermediaryChoose(){
public function intermediaryChoose(){
Db::startTrans();
$where_need['status'] = 7;
$need_list = Db::name('UserNeed')->where($where_need)->field('id,choose_time')->select()->toArray();
... ...
... ... @@ -18,6 +18,7 @@ use think\Request;
use think\Loader;
use think\Config;
use think\captcha\Captcha;
use think\Response;
use think\Url;
use SmsDemo;
use think\Session;
... ... @@ -40,54 +41,18 @@ class UserController extends CommonController
// 验证码图片
public function getImgUrl($id = "")
public function getImgUrl($rand = '',$id = "")
{
\think\Route::get('captcha/[:id]/rand/[:rand]', "\\think\\captcha\\CaptchaController@index");
\think\Validate::extend('captcha', function ($value, $id = "") {
return captcha_check($value, $id, (array)\think\Config::get('captcha'));
});
$middle_url = \think\Url::build('/captcha/new' . ($id ? "/{$id}" : ''));
$middle_url = \think\Url::build('/captcha/new' . ($id ? "/{$id}" : '').'?rand='.$rand);
return cmf_get_image_url($middle_url);
// $rand = str_replace(".","",substr(microtime(true),-5)).rand(1000,9999);
// $imgUrl = $middle_url."&time=".$rand;
// return cmf_get_image_url($imgUrl);
// return $id;
}
public function a(){
$true = $this->request->param();
// $session = $this->request->session();
if(!empty($true['code'])){
session_start();
$result = cmf_captcha_check($true['code']);
if(!$result) {
$this->apiResponse('0','验证码错误',$result);
}
}else{
session_start();
$rand = str_replace(".","",substr(microtime(true),-5)).rand(1000,9999);
$img = $this->getImgUrl();
// $cc = file_get_contents($img);
$cc = $this->curl($img);
echo "<pre/>";
print_r($cc);
die;
// cmf_captcha_check($true['code']);
$html = "<img src='".$img."'>";
// $key = $this->authcode($this->seKey);
// $secode = Session::get($key, '');
// echo "<pre/>";
//// print_r($img);
// print_r($html);
// print_r($_SESSION);
// die;
}
}
private function authcode($str)
public function authcode($str)
{
$key = substr(md5('ThinkPHP.CN'), 5, 8);
$str = substr(md5($str), 8, 10);
... ... @@ -134,13 +99,26 @@ public function a(){
// 验证图形验证码
// 验证码
session_start();
if(!$request->param('imgCode')){
if(empty($data['imgCode'])){
$this->apiResponse('0','请先输入图形验证码');
}
$result = cmf_captcha_check($request->param('imgCode'));
if(!$result) {
$this->apiResponse('0','验证码错误');
// 验证码
$first = explode('?',$data['rand']);
$next = explode('=',$first[1]);
$third = explode('.',$next[1]);
$postImg = $this->authcode(strtoupper($data['imgCode']));
$where_imgcode['rand'] = $third[0];
$find_code = Db::name('Imgcode')->where($where_imgcode)->find();
if($find_code){
if($find_code['code'] != $postImg){
$this->apiResponse('0','验证码错误1');
}else{
Db::name('Imgcode')->where($where_imgcode)->delete();
}
}else{
$this->apiResponse('0','验证码错误2');
}
$code = 'SMS_137411611';
$type = 2;
}else if($genre == 3 ){
... ... @@ -160,6 +138,8 @@ public function a(){
$this->SmsResult($tel,$code,$type);
}
/**
* @title 用户注册(sure)
* @description 接口说明
... ... @@ -273,6 +253,7 @@ public function a(){
* @param name:tel type:int require:1 default: other: desc:手机号
* @param name:password type:int require:1 default: other: desc:密码
* @param name:imgCode type:int require:1 default: other: desc:验证码
* @param name:rand type:int require:1 default: other: desc:随机数
* @param name:connect type:int require:1 default: other:1 登录注册 ,2其他 desc:1
* @return data:''@
* @data type:'1->用户,2->中介'
... ... @@ -281,11 +262,12 @@ public function a(){
public function login(Request $request){
if($request->post() && $request->Post('tel')){
$getData = $request->param();
// 登录验证
// 判空
$tel = $request->param('tel');
$password = $request->param('password');
$true = $request->param('imgCode');
$tel = $getData['tel'];
$password = $getData['password'];
$true = $getData['imgCode'];
if(empty($tel)){
$this->apiResponse('0','手机号不能为空');
}else if(empty($password)){
... ... @@ -294,13 +276,27 @@ public function a(){
if(empty($true)){
$this->apiResponse('0','验证码不能为空');
}
if(empty($getData['rand'])){
$this->apiResponse('0','随机数不能为空');
}
// 验证
// 验证码
// session_start();
// $result = cmf_captcha_check($true);
// if(!$result) {
// $this->apiResponse('0','验证码错误',$result);
// }
$first = explode('?',$getData['rand']);
$next = explode('=',$first[1]);
$third = explode('.',$next[1]);
$postImg = $this->authcode(strtoupper($true));
$where_imgcode['rand'] = $third[0];
$find_code = Db::name('Imgcode')->where($where_imgcode)->find();
if($find_code){
if($find_code['code'] != $postImg){
$this->apiResponse('0','验证码错误1');
}
// else{
// Db::name('Imgcode')->where($where_imgcode)->delete();
// }
}else{
$this->apiResponse('0','验证码错误2');
}
// 手机、密码
$memberModel = new MemberModel();
$where_member['tel'] = $tel;
... ... @@ -315,24 +311,22 @@ public function a(){
$member = $memberModel->isUpdate(true)->save($update_member);
if($member){
session('uid',$uid['id']);
session('token',$uid['token']);
$final['token'] = $uid['token'];
session('token',$update_member['token']);
$final['token'] = $update_member['token'];
$final['uid'] = $uid['id'];
$final['type'] = $uid['type'];
$this->apiResponse('1','登录成功',$final);
}else{
$this->apiResponse('0','您输入的账号或密码不正确');
$this->apiResponse('0','登录失败');
}
}else{
$this->apiResponse('0','您输入的账号或密码不正确');
}
}else{
// 返回验证码图片
session_start();
header("ACCESS-CONTROL-ALLOW-ORIGIN:http://localhost");
$img = $this->getImgUrl();
$a = Request::instance()->header();
echo "<pre/>";
print_r($a);
die;
$rand = str_replace(".","",substr(microtime(true),-5)).rand(1000,9999);
$img = $this->getImgUrl($rand);
$this->apiResponse('1','成功',$img);
}
}
... ... @@ -568,7 +562,7 @@ die;
* @url /api/portal/User/myCard
* @method POST
* @param name:token type:int require:1 default: other: desc:token
* @param name:card_name type:int require:1 default: other: desc:银行名称
* @param name:bank_id type:int require:1 default: other: desc:银行id
* @param name:card_num type:int require:1 default: other: desc:银行卡号
* @param name:code type:int require:1 default: other: desc:短信验证码
*/
... ... @@ -578,7 +572,7 @@ die;
// $where_member['token'] = $data['token'];
// $where_member['status'] = 1;
// $member = Db::name('Member')->where($where_member)->field('id,name,tel')->find();
if(!empty($data['card_num'])){
if(!empty($data['bank_id']) && !empty($data['card_num'])){
// 验证码
$where_code['type'] = 5;
$where_code['status'] = 1;
... ... @@ -587,6 +581,9 @@ die;
if(!$code){
$this->apiResponse('0','请先获取验证码');
}
if(empty($data['code'])){
$this->apiResponse('0','请先获取验证码');
}
if($code['code'] != $data['code']){
$this->apiResponse('0','验证码错误');
}
... ... @@ -597,7 +594,7 @@ die;
if($is_issetCard){
$this->apiResponse('0','您已绑定银行卡');
}
$add['card_name'] = $data['card_name'];
$add['bank_id'] = $data['bank_id'];
$add['card_num'] = $data['card_num'];
$add['create_time'] = time();
$add['update_time'] = time();
... ... @@ -610,7 +607,11 @@ die;
$this->apiResponse('0','添加失败');
}
}else{
$this->apiResponse('1','成功',$user);
$where_bank['status'] = 1;
$bank = Db::name('Bank')->where($where_bank)->order('score desc,create_time desc')->select();
$final['bank'] = $bank;
$final['user'] = $user;
$this->apiResponse('1','成功',$final);
}
}
... ... @@ -622,7 +623,7 @@ die;
* @method POST
* @param name:token type:int require:1 default: other: desc:token
* @param name:card_id type:int require:1 default: other: desc:银行卡id
* @param name:card_name type:int require:1 default: other: desc:银行名称
* @param name:bank_id type:int require:1 default: other: desc:银行id
* @param name:card_num type:int require:1 default: other: desc:银行卡号
* @param name:code type:int require:1 default: other: desc:短信验证码
*/
... ... @@ -632,7 +633,7 @@ die;
if(empty($data['card_id'])){
$this->apiResponse('0','银行卡id不能为空');
}
if(!empty($data['card_name'])){
if(!empty($data['bank_id'])){
// 验证码
$where_code['type'] = 5;
$where_code['status'] = 1;
... ... @@ -641,11 +642,14 @@ die;
if(!$code){
$this->apiResponse('0','请先获取验证码');
}
if(empty($data['code'])){
$this->apiResponse('0','请先获取验证码');
}
if($code['code'] != $data['code']){
$this->apiResponse('0','验证码错误');
}
$where_add['id'] = $data['card_id'];
$add['card_name'] = $data['card_name'];
$add['bank_id'] = $data['bank_id'];
$add['card_num'] = $data['card_num'];
$add['update_time'] = time();
$add_final = Db::name('Card')->where($where_add)->update($add);
... ... @@ -657,10 +661,18 @@ die;
}
}else{
$where_cardFirst['id'] = $data['card_id'];
$cardFind = Db::name('Card')->where($where_cardFirst)->find();
$where_cardFirst['c.id'] = $data['card_id'];
$cardFind = Db::name('Card')->alias('c')
->where($where_cardFirst)
->join("Bank b",'b.id = c.bank_id')
->field('c.*,b.name')
->find();
$where_bank['status'] = 1;
$bank = Db::name('Bank')->where($where_bank)->order('score desc,create_time desc')->select();
$final['bank'] = $bank;
$final['card'] = $cardFind;
if($cardFind){
$this->apiResponse('1','成功',$cardFind);
$this->apiResponse('1','成功',$final);
}else{
$this->apiResponse('0','信息查询失败');
}
... ... @@ -756,17 +768,46 @@ die;
* @url /api/portal/User/myNeed
* @method POST
* @param name:token type:int require:1 default: other: desc:token
* @param name:page type:int require:1 default: other: desc:分页
* @return data:''@
* @data status:'状态(1->待发布,2->已发布,待报价,3->已成交,4->未交保证金,5->已过期,6->未选择中介,7->中介未确认,8->报价人数不足,9->删除)'
* @data status:'状态(1->待发布,2->未交保证金,3->已发布,待报价,4->报价人数不足,5->待选择中介,6->未选择中介,7->已选择中介,待中介确认,8->中介未确认,9->删除,10->已成交,中介已确认)'
* @data comment:'剩余评价次数'
*/
public function myNeed(Request $request){
$token = $request->param('token');
$member = $this->myleft($token);
$data = $request->param();
$page = $data['page']?$data['page']:1;
$final['user'] = $member;
$where_userNeed['user_id'] = $member['id'];
$where_userNeed['status'] = array('neq',9);
$user_need = Db::name('UserNeed')->where($where_userNeed)->order('create_time desc')->select();
$user_need = Db::name('UserNeed')->where($where_userNeed)
->order('create_time desc')
->page($page)
->select()->toArray();
if($user_need){
foreach ($user_need as $unk=>$unv){
$where_comment['need_id'] = $unv['id'];
$where_comment['user_id'] = $unv['user_id'];
$where_comment['status'] = 1;
$comment = Db::name('Comment')->where($where_comment)->field('is_comment,create_time')->find();
if($comment){
// 判断是否超过30天
if(time() > ($comment['create_time'] + 2592000)){
$user_need[$unk]['comment'] = 0;
}else{
if($comment['is_comment'] == 1){
$user_need[$unk]['comment'] = 0;
}else{
$user_need[$unk]['comment'] = 1;
}
}
}else{
$user_need[$unk]['comment'] = 2;
}
}
$final['user_need'] = $user_need;
}else{
$final['user_need'] = array();
... ... @@ -776,10 +817,6 @@ die;
}
/**
* @title 我的比价明细(sure)
* @description 接口说明
... ... @@ -836,9 +873,13 @@ die;
public function myMes(Request $request){
$data = $request->param();
$user = $this->myleft($data['token']);
$where_card['status'] = 1;
$where_card['user_id'] = $user['id'];
$card = Db::name('Card')->where($where_card)->field('id,card_name,card_num')->select()->toArray();
$where_card['c.status'] = 1;
$where_card['c.user_id'] = $user['id'];
$card = Db::name('Card')->alias('c')
->where($where_card)
->join("Bank b",'b.id = c.bank_id')
->field('c.id,b.name,c.card_num')
->select()->toArray();
foreach ($card as $cardk=>$cardv){
$card[$cardk]['user_name'] = $user['name'];
}
... ... @@ -963,7 +1004,13 @@ die;
$add['update_time'] = time();
$add_result = Db::name('Comment')->insertGetId($add);
if($add_result){
$this->apiResponse('1','评价成功');
$change_status['status'] = 11;
$change_com = Db::name('UserNeed')->where($where_need)->update($change_status);
if($change_com){
$this->apiResponse('1','评价成功');
}else{
$this->apiResponse('0','评价失败');
}
}else{
$this->apiResponse('0','评价失败');
}
... ... @@ -975,6 +1022,84 @@ die;
}
}
/**
* @title 修改评价(sure)
* @description 接口说明
* @author 开发者
* @url /api/portal/User/changeUserComment
* @method POST
* @param name:token type:int require:1 default: other: desc:token
* @param name:comment_id type:int require:1 default: other: desc:评论id
* @param name:content type:int require:1 default: other: desc:评论内容
*/
public function changeUserComment(Request $request){
$data = $request->param();
if(empty($data['comment_id'])){
$this->apiResponse('0','评论id不能为空');
}
if(empty($data['content'])){
$where_change['id'] = $data['comment_id'];
$where_change['status'] = 1;
$where_change['is_comment'] = 0;
$find_comment = Db::name('Comment')->where($where_change)->find();
if($find_comment){
$this->apiResponse('1','成功',$find_comment);
}else{
$this->apiResponse('0','该评价不可修改');
}
}else{
$where_update['id'] = $data['comment_id'];
$where_update['status'] = 1;
$update['content'] = $data['content'];
$update['is_comment'] = 1;
$update_result = Db::name('Comment')->where($where_update)->update($update);
if($update_result){
$this->apiResponse('1','修改成功');
}else{
$this->apiResponse('0','修改失败');
}
}
if(empty($data['content'])){
$this->apiResponse('0','评论内容不能为空');
}
$where_need['status'] = 10;
$where_need['id'] = $data['need_id'];
$need = Db::name('UserNeed')->where($where_need)->find();
if($need){
$where_agency['status'] = 11;
$where_agency['need_id'] = $need['id'];
$agency = Db::name('Agency')->where($where_agency)->find();
if($agency){
$add['need_id'] = $need['id'];
$add['agency_id'] = $agency['id'];
$add['intermediary_id'] = $agency['agency_id'];
$add['user_id'] = $need['user_id'];
$add['content'] = $data['content'];
$add['create_time'] = time();
$add['update_time'] = time();
$add_result = Db::name('Comment')->insertGetId($add);
if($add_result){
$change_status['status'] = 11;
$change_com = Db::name('UserNeed')->where($where_need)->update($change_status);
if($change_com){
$this->apiResponse('1','评价成功');
}else{
$this->apiResponse('0','评价失败');
}
}else{
$this->apiResponse('0','评价失败');
}
}else{
$this->apiResponse('0','评价失败');
}
}else{
$this->apiResponse('0','评价失败');
}
}
/**
* @title 投诉(sure)
... ...
<?php
// +----------------------------------------------------------------------
// | ThinkCMF [ WE CAN DO IT MORE SIMPLE ]
// +----------------------------------------------------------------------
// | Copyright (c) 2013-2018 http://www.thinkcmf.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: 老猫 <thinkcmf@126.com>
// +----------------------------------------------------------------------
namespace app\portal\controller;
use app\portal\model\BankModel;
use app\portal\model\BrandModel;
use app\portal\model\CooperationModel;
use app\portal\model\ProcessModel;
use cmf\controller\AdminBaseController;
use app\portal\model\PortalTagModel;
use app\portal\service\PostService;
use think\Db;
use think\Request;
use think\Loader;
class BankController extends AdminBaseController
{
/**
* 列表(暂无用)
* @adminMenu(
* 'name' => '文章管理',
* 'parent' => 'portal/AdminIndex/default',
* 'display'=> true,
* 'hasView'=> true,
* 'order' => 10000,
* 'icon' => '',
* 'remark' => '文章列表',
* 'param' => ''
* )
*/
public function index(Request $request)
{
$where_coo['status'] = 1;
// $where_coo = array();
if($request->post()){
$search = $request->post();
if($search['start_time']){
$start = strtotime($search['start_time']);
if($search['end_time']){
$end = strtotime($search['end_time']);
}else{
$end = time();
}
$where_coo['update_time'] = array('between',"$start,$end");
$this->assign('start_time',date('Y-m-d H:i',$start));
$this->assign('end_time',date('Y-m-d H:i',$end));
}
if($search['keyword']){
$where_coo['name'] = array('like',"%".$search['keyword']."%");
$this->assign('keyword',$search['keyword']);
}
}
$coo_list = Db::name('Bank')->where($where_coo)->order('score desc , create_time desc')->paginate();
$page = $coo_list->render();
$this->assign('page',$page);
$this->assign('list',$coo_list);
return $this->fetch();
}
/**
* 添加、修改
* @adminMenu(
* 'name' => '添加文章',
* 'parent' => 'index',
* 'display'=> false,
* 'hasView'=> true,
* 'order' => 10000,
* 'icon' => '',
* 'remark' => '添加文章',
* 'param' => ''
* )
*/
public function add(Request $request)
{
if($request->post()){
// 添加数据
$data = $request->post();
if($request->Post('id')){
// 修改
$add['name'] = $data['name'];
$add['score'] = $data['score'];
$validate = Loader::validate('Bank');
if(!$validate->scene('edit')->check($add)){
$mes = $validate->getError();
$this->error("$mes");
}
$add['id'] = $request->param('id');
$model = new BankModel();
$final = $model->isUpdate(true)->allowField(true)->save($add);
}else{
// 添加
$add['name'] = $data['name'];
$add['score'] = $data['score'];
$validate = Loader::validate('Bank');
if(!$validate->scene('add')->check($add)){
$mes = $validate->getError();
$this->error("$mes");
}
$model = new BankModel();
$final = $model->save($add);
}
if($final){
$this->success('成功',url('index'));
}else{
$this->error('失败');
}
}else{
$where_find['id'] = $request->param('id');
$list = Db::name('Bank')->where($where_find)->find();
$this->assign('list',$list);
return $this->fetch('add');
}
}
// 删除
public function del(Request $request){
$ids = $this->request->post();
$id = $request->param('id');
if($ids){
$add_del['id'] = array('in',$ids['ids']);
}else if($id){
$add_del['id'] = $request->param('id');
}else{
$this->error('删除失败');
}
$add_del['status'] = 9;
$model = new BankModel();
$del = $model->isUpdate(true)->allowField(true)->save($add_del);
if($del){
$this->success('删除成功',url('index'));
}else{
$this->error('删除失败');
}
}
}
... ...
<?php
// +----------------------------------------------------------------------
// | ThinkCMF [ WE CAN DO IT MORE SIMPLE ]
// +----------------------------------------------------------------------
// | Copyright (c) 2013-2018 http://www.thinkcmf.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: 老猫 <thinkcmf@126.com>
// +----------------------------------------------------------------------
namespace app\portal\controller;
use app\portal\model\BankModel;
use app\portal\model\NewModel;
use cmf\controller\AdminBaseController;
use think\Db;
use think\Request;
use think\Loader;
class CodeController extends AdminBaseController
{
/**
* 列表(暂无用)
* @adminMenu(
* 'name' => '文章管理',
* 'parent' => 'portal/AdminIndex/default',
* 'display'=> true,
* 'hasView'=> true,
* 'order' => 10000,
* 'icon' => '',
* 'remark' => '文章列表',
* 'param' => ''
* )
*/
public function index(Request $request)
{
$where_coo['status'] = 1;
// $where_coo = array();
$search = $request->post();
if($search){
if($search['start_time']){
$start = strtotime($search['start_time']);
if($search['end_time']){
$end = strtotime($search['end_time']);
}else{
$end = time();
}
$where_coo['update_time'] = array('between',"$start,$end");
$this->assign('start_time',date('Y-m-d H:i',$start));
$this->assign('end_time',date('Y-m-d H:i',$end));
}
if($search['keyword']){
$where_coo['tel'] = array('like',"%".$search['keyword']."%");
$this->assign('keyword',$search['keyword']);
}
if($search['type']){
$where_coo['type'] = $search['type'];
}
}
$type = empty($search['type'])?0:$search['type'];
$this->assign('type',$type);
$coo_list = Db::name('Code')->where($where_coo)->order('create_time desc')->paginate(10);
$page = $coo_list->render();
$this->assign('page',$page);
$this->assign('list',$coo_list);
return $this->fetch();
}
// 删除
// public function del(Request $request){
// $ids = $this->request->post();
// $id = $request->param('id');
// if($ids){
// $add_del['id'] = array('in',$ids['ids']);
// }else if($id){
// $add_del['id'] = $request->param('id');
// }else{
// $this->error('删除失败');
// }
// $add_del['status'] = 9;
// $model = new NewModel();
// $del = $model->isUpdate(true)->allowField(true)->save($add_del);
// if($del){
// $this->success('删除成功',url('index'));
// }else{
// $this->error('删除失败');
// }
// }
}
... ...
<?php
// +----------------------------------------------------------------------
// | ThinkCMF [ WE CAN DO IT MORE SIMPLE ]
// +----------------------------------------------------------------------
// | Copyright (c) 2013-2018 http://www.thinkcmf.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: 老猫 <thinkcmf@126.com>
// +----------------------------------------------------------------------
namespace app\portal\controller;
use app\portal\model\BankModel;
use app\portal\model\NewModel;
use cmf\controller\AdminBaseController;
use think\Db;
use think\Request;
use think\Loader;
class NewController extends AdminBaseController
{
/**
* 列表(暂无用)
* @adminMenu(
* 'name' => '文章管理',
* 'parent' => 'portal/AdminIndex/default',
* 'display'=> true,
* 'hasView'=> true,
* 'order' => 10000,
* 'icon' => '',
* 'remark' => '文章列表',
* 'param' => ''
* )
*/
public function index(Request $request)
{
$where_coo['status'] = 1;
// $where_coo = array();
if($request->post()){
$search = $request->post();
if($search['start_time']){
$start = strtotime($search['start_time']);
if($search['end_time']){
$end = strtotime($search['end_time']);
}else{
$end = time();
}
$where_coo['update_time'] = array('between',"$start,$end");
$this->assign('start_time',date('Y-m-d H:i',$start));
$this->assign('end_time',date('Y-m-d H:i',$end));
}
if($search['keyword']){
$where_coo['name'] = array('like',"%".$search['keyword']."%");
$this->assign('keyword',$search['keyword']);
}
}
$coo_list = Db::name('New')->where($where_coo)->order('score desc , create_time desc')->paginate(10);
$page = $coo_list->render();
$this->assign('page',$page);
$this->assign('list',$coo_list);
return $this->fetch();
}
/**
* 添加、修改
* @adminMenu(
* 'name' => '添加文章',
* 'parent' => 'index',
* 'display'=> false,
* 'hasView'=> true,
* 'order' => 10000,
* 'icon' => '',
* 'remark' => '添加文章',
* 'param' => ''
* )
*/
public function add(Request $request)
{
if($request->post()){
// 添加数据
$data = $request->post();
if($request->Post('id')){
// 修改
$add = $data;
$validate = Loader::validate('New');
if(!$validate->scene('edit')->check($add)){
$mes = $validate->getError();
$this->error("$mes");
}
$add['id'] = $request->param('id');
$model = new NewModel();
$final = $model->isUpdate(true)->allowField(true)->save($add);
}else{
// 添加
$add = $data;
$validate = Loader::validate('New');
if(!$validate->scene('add')->check($add)){
$mes = $validate->getError();
$this->error("$mes");
}
$model = new NewModel();
$final = $model->save($add);
}
if($final){
$this->success('成功',url('index'));
}else{
$this->error('失败');
}
}else{
$where_find['id'] = $request->param('id');
$list = Db::name('New')->where($where_find)->find();
$this->assign('list',$list);
return $this->fetch('add');
}
}
// 删除
public function del(Request $request){
$ids = $this->request->post();
$id = $request->param('id');
if($ids){
$add_del['id'] = array('in',$ids['ids']);
}else if($id){
$add_del['id'] = $request->param('id');
}else{
$this->error('删除失败');
}
$add_del['status'] = 9;
$model = new NewModel();
$del = $model->isUpdate(true)->allowField(true)->save($add_del);
if($del){
$this->success('删除成功',url('index'));
}else{
$this->error('删除失败');
}
}
}
... ...
<?php
// +----------------------------------------------------------------------
// | ThinkCMF [ WE CAN DO IT MORE SIMPLE ]
// +----------------------------------------------------------------------
// | Copyright (c) 2013-2018 http://www.thinkcmf.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: 老猫 <thinkcmf@126.com>
// +----------------------------------------------------------------------
namespace app\portal\model;
use app\admin\model\RouteModel;
use think\Model;
class BankModel extends Model
{
protected $autoWriteTimestamp = true;
}
\ No newline at end of file
... ...
<?php
// +----------------------------------------------------------------------
// | ThinkCMF [ WE CAN DO IT MORE SIMPLE ]
// +----------------------------------------------------------------------
// | Copyright (c) 2013-2018 http://www.thinkcmf.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: 老猫 <thinkcmf@126.com>
// +----------------------------------------------------------------------
namespace app\portal\model;
use app\admin\model\RouteModel;
use think\Model;
class NewModel extends Model
{
protected $autoWriteTimestamp = true;
}
\ No newline at end of file
... ...
<?php
// +----------------------------------------------------------------------
// | ThinkCMF [ WE CAN DO IT MORE SIMPLE ]
// +----------------------------------------------------------------------
// | Copyright (c) 2013-2018 http://www.thinkcmf.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: 小夏 < 449134904@qq.com>
// +----------------------------------------------------------------------
namespace app\portal\validate;
use think\Validate;
class BankValidate extends Validate
{
protected $rule = [
'name' => 'require',
];
protected $message = [
'name.require' => '内容不为空!',
];
protected $scene = [
];
}
\ No newline at end of file
... ...
<?php
// +----------------------------------------------------------------------
// | ThinkCMF [ WE CAN DO IT MORE SIMPLE ]
// +----------------------------------------------------------------------
// | Copyright (c) 2013-2018 http://www.thinkcmf.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: 小夏 < 449134904@qq.com>
// +----------------------------------------------------------------------
namespace app\portal\validate;
use think\Validate;
class NewValidate extends Validate
{
protected $rule = [
'name' => 'require',
'city' => 'require',
'floor' => 'require',
'area' => 'require',
'sure_money' => 'require',
'save' => 'require',
'agency' => 'require',
];
protected $message = [
'name.require' => '内容不为空!',
'city.require' => '城市不为空!',
'floor.require' => '户型不为空!',
'area.require' => '建筑面积不为空!',
'sure_money.require' => '成交价不为空!',
'save.require' => '节约价格不为空!',
'agency.require' => '成交中介不为空!',
];
protected $scene = [
];
}
\ No newline at end of file
... ...
... ... @@ -48,6 +48,34 @@ class AdminOauthController extends AdminBaseController
{
// 用户
$where_member['type'] = 1;
$data = $this->request->param();
if($data){
$startTime = empty($data['start_time']) ? 0 : strtotime($data['start_time']);
$endTime = empty($data['end_time']) ? 0 : strtotime($data['end_time']);
if ($startTime && $endTime) {
$where_member['create_time'] = array('between',"$startTime,$endTime");
$this->assign('start_time', $data['start_time']);
$this->assign('end_time', $data['end_time']);
}else{
if($startTime){
$where_member['create_time'] = array('egt',$startTime);
$this->assign('start_time', $data['start_time']);
}
if($endTime){
$where_member['create_time'] = array('elt',$endTime);
$this->assign('end_time', $data['end_time']);
}
}
if(!empty($data['name'])){
$where_member['name'] = array('like','%'.$data['name'].'%');
$this->assign('name', $data['name']);
}
if(!empty($data['tel'])){
$where_member['tel'] = array('like','%'.$data['tel'].'%');
$this->assign('tel', $data['tel']);
}
}
$lists = Db::name('Member')->where($where_member)->select()->toArray();
foreach ($lists as $lk=>$lv){
$where_referee['id'] = $lv['referee_id'];
... ... @@ -68,8 +96,35 @@ class AdminOauthController extends AdminBaseController
public function intermediary()
{
// 中介
$data = $this->request->param();
if($data){
$startTime = empty($data['start_time']) ? 0 : strtotime($data['start_time']);
$endTime = empty($data['end_time']) ? 0 : strtotime($data['end_time']);
if ($startTime && $endTime) {
$where_member['create_time'] = array('between',"$startTime,$endTime");
$this->assign('start_time', $data['start_time']);
$this->assign('end_time', $data['end_time']);
}else{
if($startTime){
$where_member['create_time'] = array('egt',$startTime);
$this->assign('start_time', $data['start_time']);
}
if($endTime){
$where_member['create_time'] = array('elt',$endTime);
$this->assign('end_time', $data['end_time']);
}
}
if(!empty($data['name'])){
$where_member['name'] = array('like','%'.$data['name'].'%');
$this->assign('name', $data['name']);
}
if(!empty($data['tel'])){
$where_member['tel'] = array('like','%'.$data['tel'].'%');
$this->assign('tel', $data['tel']);
}
}
$where_member['type'] = 2;
$lists = Db::name('Member')->where($where_member)->select()->toArray();
foreach ($lists as $lk=>$lv){
... ... @@ -110,7 +165,7 @@ class AdminOauthController extends AdminBaseController
Db::name("third_party_user")->where("id", $id)->delete();
$this->success("删除成功!", "admin_oauth/index");
}
// 删除
// 黑名单
public function del(Request $request)
{
$where_member['id'] = $request->param('id');
... ... @@ -126,6 +181,75 @@ class AdminOauthController extends AdminBaseController
}else{
$this->error('删除失败!');
}
}
// 黑名单
public function black(Request $request)
{
$where_member['status'] = 8;
$data = $request->param();
if($data){
$startTime = empty($data['start_time']) ? 0 : strtotime($data['start_time']);
$endTime = empty($data['end_time']) ? 0 : strtotime($data['end_time']);
if ($startTime && $endTime) {
$where_member['create_time'] = array('between',"$startTime,$endTime");
$this->assign('start_time', $data['start_time']);
$this->assign('end_time', $data['end_time']);
}else{
if($startTime){
$where_member['create_time'] = array('egt',$startTime);
$this->assign('start_time', $data['start_time']);
}
if($endTime){
$where_member['create_time'] = array('elt',$endTime);
$this->assign('end_time', $data['end_time']);
}
}
if(!empty($data['name'])){
$where_member['name'] = array('like','%'.$data['name'].'%');
$this->assign('name', $data['name']);
}
if(!empty($data['tel'])){
$where_member['tel'] = array('like','%'.$data['tel'].'%');
$this->assign('tel', $data['tel']);
}
}
$is_isset = Db::name('Member')->where($where_member)->select()->toArray();
if(!$is_isset){
$is_isset = array();
}else{
foreach ($is_isset as $lk=>$lv){
$where_referee['id'] = $lv['referee_id'];
$referee = Db::name('Member')->where($where_referee)->field('id,name')->find();
if($referee){
$is_isset[$lk]['referee_name'] = $referee['name'];
}else{
$is_isset[$lk]['referee_name'] = '';
}
}
}
$this->assign('lists', $is_isset);
return $this->fetch();
}
// 恢复黑名单
public function recovery(Request $request)
{
$where_member['id'] = $request->param('id');
$where_member['status'] = 8;
$is_isset = Db::name('Member')->where($where_member)->field('status')->find();
if(!$is_isset){
$this->error('用户信息错误!');
}
$save['status'] = 1;
$save['update_time'] = time();
$update = Db::name('Member')->where($where_member)->update($save);
if($update){
$this->success("恢复成功!", "admin_oauth/black");
}else{
$this->error('恢复失败!');
}
}
}
\ No newline at end of file
... ...
... ... @@ -150,12 +150,17 @@ return array (
'PORTAL_ADMINTAG_INDEX' => '文章标签',
'PORTAL_ADMINTAG_UPSTATUS' => '更新标签状态',
'PORTAL_ALL_ADD' => '包干价',
'PORTAL_BANK_DEFAULT' => '银行管理',
'PORTAL_BANK_INDEX' => '银行名称列表',
'PORTAL_BANNER_INDEX' => '首页轮播图',
'PORTAL_BRAND_DEFAULT' => '品牌中介名单',
'PORTAL_BRAND_INDEX' => '品牌中介列表',
'PORTAL_CODE_DEFAULT' => '短信验证码管理',
'PORTAL_CODE_INDEX' => '短信验证码列表',
'PORTAL_COOPERATION_DEFAULT' => '首页内容管理',
'PORTAL_COOPERATION_INDEX' => '合作企业列表',
'PORTAL_NEED_USER' => '需求管理',
'PORTAL_NEW_INDEX' => '最新成交公布',
'PORTAL_PROCESS_INDEX' => '交易流程',
'PORTAL_USERNEED_DEFAULT' => '发布需求管理',
'PORTAL_USERNEED_INDEX' => '保证金内容管理',
... ... @@ -166,6 +171,7 @@ return array (
'USER_ADMININDEX_DEFAULT' => '用户管理',
'USER_ADMININDEX_DEFAULT1' => '用户组',
'USER_ADMININDEX_INDEX' => '本站用户',
'USER_ADMINOAUTH_BLACK' => '黑名单',
'USER_ADMINOAUTH_DELETE' => '删除第三方用户绑定',
'USER_ADMINOAUTH_INTERMEDIARY' => '中介管理',
'USER_ADMINOAUTH_USER' => '用户管理',
... ...
<include file="public@header"/>
<style type="text/css">
.pic-list li {
margin-bottom: 5px;
}
</style>
</head>
<body>
<div class="wrap js-check-wrap">
<ul class="nav nav-tabs">
<li><a href="{:url('Bank/index')}">银行列表</a></li>
<li class="active"><a href="{:url('Bank/add')}">添加银行</a></li>
</ul>
<form action="{:url('Bank/add')}" method="post" class="form-horizontal js-ajax-form margin-top-20">
<div class="row">
<div class="col-md-9">
<table class="table table-bordered">
<input class="form-control" type="hidden" name="id"
value="{$list['id']}"/>
<tr>
<th width="15%">银行名称</th>
<td><input class="form-control" type="text" name="name"
value="{$list['name']}" placeholder="请输入银行名称"/>
</td>
</tr>
<tr>
<th width="10%">排序</th>
<td><input class="form-control" type="text" name="score"
value="{$list['score']}" placeholder="请输入排序,数字越大越靠前"/>
</td>
</tr>
</table>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<button type="submit" class="btn btn-primary js-ajax-submit">{:lang('ADD')}</button>
<a class="btn btn-default" href="{:url('Bank/index')}">{:lang('BACK')}</a>
</div>
</div>
</div>
</div>
</form>
</div>
<script type="text/javascript" src="__STATIC__/js/admin.js"></script>
<script type="text/javascript">
//编辑器路径定义
var editorURL = GV.WEB_ROOT;
</script>
<script type="text/javascript" src="__STATIC__/js/ueditor/ueditor.config.js"></script>
<script type="text/javascript" src="__STATIC__/js/ueditor/ueditor.all.min.js"></script>
<script type="text/javascript">
$(function () {
editorcontent = new baidu.editor.ui.Editor();
editorcontent.render('content');
try {
editorcontent.sync();
} catch (err) {
}
$('.btn-cancel-thumbnail').click(function () {
$('#thumbnail-preview').attr('src', '__TMPL__/public/assets/images/default-thumbnail.png');
$('#thumbnail').val('');
});
});
// function doSelectCategory() {
// var selectedCategoriesId = $('#js-categories-id-input').val();
// openIframeLayer("{:url('AdminCategory/select')}?ids=" + selectedCategoriesId, '请选择分类', {
// area: ['700px', '400px'],
// btn: ['确定', '取消'],
// yes: function (index, layero) {
// //do something
//
// var iframeWin = window[layero.find('iframe')[0]['name']];
// var selectedCategories = iframeWin.confirm();
// if (selectedCategories.selectedCategoriesId.length == 0) {
// layer.msg('请选择分类');
// return;
// }
// $('#js-categories-id-input').val(selectedCategories.selectedCategoriesId.join(','));
// $('#js-categories-name-input').val(selectedCategories.selectedCategoriesName.join(' '));
// //console.log(layer.getFrameIndex(index));
// layer.close(index); //如果设定了yes回调,需进行手工关闭
// }
// });
// }
</script>
</body>
</html>
... ...
<include file="public@header"/>
</head>
<body>
<div class="wrap js-check-wrap">
<ul class="nav nav-tabs">
<li class="active"><a href="javascript:;">银行列表</a></li>
<li><a href="{:url('Bank/add')}">添加银行</a></li>
</ul>
<form class="well form-inline margin-top-20" method="post" action="{:url('Bank/index')}">
<!--分类:-->
<!--<select class="form-control" name="category" style="width: 140px;">-->
<!--<option value='0'>全部</option>-->
<!--{$category_tree|default=''}-->
<!--</select> &nbsp;&nbsp;-->
时间:
<input type="text" class="form-control js-bootstrap-datetime" name="start_time"
value="{$start_time|default=''}"
style="width: 140px;" autocomplete="off">-
<input type="text" class="form-control js-bootstrap-datetime" name="end_time"
value="{$end_time|default=''}"
style="width: 140px;" autocomplete="off"> &nbsp; &nbsp;
关键字:
<input type="text" class="form-control" name="keyword" style="width: 200px;"
value="{$keyword|default=''}" placeholder="请输入品牌中介名称">
<input type="submit" class="btn btn-primary" value="搜索"/>
<a class="btn btn-danger" href="{:url('Bank/index')}">清空</a>
</form>
<form class="js-ajax-form" action="" method="post">
<div class="table-actions">
<!--<notempty name="category">-->
<!--<button class="btn btn-primary btn-sm js-ajax-submit" type="submit"-->
<!--data-action="{:url('AdminArticle/listOrder')}">{:lang('SORT')}-->
<!--</button>-->
<!--</notempty>-->
<!--<button class="btn btn-primary btn-sm js-ajax-submit" type="submit"-->
<!--data-action="{:url('AdminArticle/publish',array('yes'=>1))}" data-subcheck="true">发布-->
<!--</button>-->
<!--<button class="btn btn-primary btn-sm js-ajax-submit" type="submit"-->
<!--data-action="{:url('AdminArticle/publish',array('no'=>1))}" data-subcheck="true">取消发布-->
<!--</button>-->
<!--<button class="btn btn-primary btn-sm js-ajax-submit" type="submit"-->
<!--data-action="{:url('AdminArticle/top',array('yes'=>1))}" data-subcheck="true">置顶-->
<!--</button>-->
<!--<button class="btn btn-primary btn-sm js-ajax-submit" type="submit"-->
<!--data-action="{:url('AdminArticle/top',array('no'=>1))}" data-subcheck="true">取消置顶-->
<!--</button>-->
<!--<button class="btn btn-primary btn-sm js-ajax-submit" type="submit"-->
<!--data-action="{:url('AdminArticle/recommend',array('yes'=>1))}" data-subcheck="true">推荐-->
<!--</button>-->
<!--<button class="btn btn-primary btn-sm js-ajax-submit" type="submit"-->
<!--data-action="{:url('AdminArticle/recommend',array('no'=>1))}" data-subcheck="true">取消推荐-->
<!--</button>-->
<!--
<notempty name="category">
<button class="btn btn-primary btn-sm js-articles-move" type="button">批量移动</button>
</notempty>
<button class="btn btn-primary btn-sm js-articles-copy" type="button">批量复制</button>
-->
<button class="btn btn-danger btn-sm js-ajax-submit" type="submit"
data-action="{:url('Bank/del')}" data-subcheck="true" data-msg="您确定删除吗?">
{:lang('DELETE')}
</button>
</div>
<table class="table table-hover table-bordered table-list">
<thead>
<tr>
<th width="15">
<label>
<input type="checkbox" class="js-check-all" data-direction="x" data-checklist="js-check-x">
</label>
</th>
<notempty name="category">
<th width="50">{:lang('SORT')}</th>
</notempty>
<th width="50">ID</th>
<th>品牌中介名</th>
<th>排序</th>
<!--<th>排序</th>-->
<th width="130">更新时间</th>
<th width="130">发布时间</th>
<!--<th width="70">状态</th>-->
<th width="90">操作</th>
</tr>
</thead>
<foreach name="list" item="list">
<tr>
<td>
<input type="checkbox" class="js-check" data-yid="js-check-y" data-xid="js-check-x" name="ids[]"
value="{$list.id}" title="ID:{$list.id}">
</td>
<td>{$list.id}</td>
<td>
{$list.name}
</td>
<td>
{$list.score}
</td>
<td>
{:date('Y-m-d H:i',$list['update_time'])}
</td>
<td>
{:date('Y-m-d H:i',$list['create_time'])}
<!--<empty name="vo.published_time">-->
<!--未发布-->
<!--<else/>-->
<!--{:date('Y-m-d H:i',$list['published_time'])}-->
<!--</empty>-->
</td>
<td>
<a href="{:url('Bank/add',array('id'=>$list['id']))}">{:lang('EDIT')}</a>
<a href="{:url('Bank/del',array('id'=>$list['id']))}" class="js-ajax-delete">{:lang('DELETE')}</a>
</td>
</tr>
</foreach>
</table>
<ul class="pagination">{$page|default=''}</ul>
</form>
</div>
<script src="__STATIC__/js/admin.js"></script>
<script>
function reloadPage(win) {
win.location.reload();
}
$(function () {
setCookie("refersh_time", 0);
Wind.use('ajaxForm', 'artDialog', 'iframeTools', function () {
//批量复制
$('.js-articles-copy').click(function (e) {
var ids = [];
$("input[name='ids[]']").each(function () {
if ($(this).is(':checked')) {
ids.push($(this).val());
}
});
if (ids.length == 0) {
art.dialog.through({
id: 'error',
icon: 'error',
content: '您没有勾选信息,无法进行操作!',
cancelVal: '关闭',
cancel: true
});
return false;
}
ids = ids.join(',');
art.dialog.open("__ROOT__/index.php?g=portal&m=AdminArticle&a=copy&ids=" + ids, {
title: "批量复制",
width: "300px"
});
});
//批量移动
$('.js-articles-move').click(function (e) {
var ids = [];
$("input[name='ids[]']").each(function () {
if ($(this).is(':checked')) {
ids.push($(this).val());
}
});
if (ids.length == 0) {
art.dialog.through({
id: 'error',
icon: 'error',
content: '您没有勾选信息,无法进行操作!',
cancelVal: '关闭',
cancel: true
});
return false;
}
ids = ids.join(',');
art.dialog.open("__ROOT__/index.php?g=portal&m=AdminArticle&a=move&old_term_id={$term.term_id|default=0}&ids=" + ids, {
title: "批量移动",
width: "300px"
});
});
});
});
</script>
</body>
</html>
\ No newline at end of file
... ...
<include file="public@header"/>
</head>
<body>
<div class="wrap js-check-wrap">
<ul class="nav nav-tabs">
<li class="active"><a href="javascript:;">验证码列表</a></li>
</ul>
<form class="well form-inline margin-top-20" method="post" action="{:url('Code/index')}">
<!--分类:-->
<!--<select class="form-control" name="category" style="width: 140px;">-->
<!--<option value='0'>全部</option>-->
<!--{$category_tree|default=''}-->
<!--</select> &nbsp;&nbsp;-->
时间:
<input type="text" class="form-control js-bootstrap-datetime" name="start_time"
value="{$start_time|default=''}"
style="width: 140px;" autocomplete="off"> -
<input type="text" class="form-control js-bootstrap-datetime" name="end_time"
value="{$end_time|default=''}"
style="width: 140px;" autocomplete="off"> &nbsp; &nbsp;
手机号:
<input type="text" class="form-control" name="keyword" style="width: 200px;"
value="{$keyword|default=''}" placeholder="请输入手机号">&nbsp;&nbsp;&nbsp;&nbsp;
类型:
<select class="form-control" style="width: 200px;" name="type">
<option name="type[]" value="0" <eq name="type" value="0">selected</eq>>请选择类型</option>
<option name="type[]" value="1" <eq name="type" value="1">selected</eq>>注册</option>
<option name="type[]" value="2" <eq name="type" value="2">selected</eq>>密码找回</option>
<option name="type[]" value="3" <eq name="type" value="3">selected</eq>>发布需求</option>
<option name="type[]" value="4" <eq name="type" value="4">selected</eq>>修改手机号</option>
<option name="type[]" value="5" <eq name="type" value="5">selected</eq>>绑定银行卡</option>
</select>
<input type="submit" class="btn btn-primary" value="搜索"/>
<a class="btn btn-danger" href="{:url('Code/index')}">清空</a>
</form>
<form class="js-ajax-form" action="" method="post">
<div class="table-actions">
<button class="btn btn-danger btn-sm js-ajax-submit" type="submit"
data-action="{:url('Code/del')}" data-subcheck="true" data-msg="您确定删除吗?">
{:lang('DELETE')}
</button>
</div>
<table class="table table-hover table-bordered table-list">
<thead>
<tr>
<th width="15">
<label>
<input type="checkbox" class="js-check-all" data-direction="x" data-checklist="js-check-x">
</label>
</th>
<notempty name="category">
<th width="50">{:lang('SORT')}</th>
</notempty>
<th width="50">ID</th>
<th>手机号</th>
<th>验证码</th>
<th>类型</th>
<th width="130">更新时间</th>
<th width="130">发布时间</th>
<!--<th width="90">操作</th>-->
</tr>
</thead>
<foreach name="list" item="list">
<tr>
<td>
<input type="checkbox" class="js-check" data-yid="js-check-y" data-xid="js-check-x" name="ids[]"
value="{$list.id}" title="ID:{$list.id}">
</td>
<td>{$list.id}</td>
<td>{$list.tel}</td>
<td>{$list.code}</td>
<td>
<eq name="list['type']" value="1">注册</eq>
<eq name="list['type']" value="2">密码找回</eq>
<eq name="list['type']" value="3">发布需求</eq>
<eq name="list['type']" value="4">修改手机号</eq>
<eq name="list['type']" value="5">绑定银行卡</eq>
</td>
<td>
{:date('Y-m-d H:i',$list['update_time'])}
</td>
<td>
{:date('Y-m-d H:i',$list['create_time'])}
<!--<empty name="vo.published_time">-->
<!--未发布-->
<!--<else/>-->
<!--{:date('Y-m-d H:i',$list['published_time'])}-->
<!--</empty>-->
</td>
<!--<td>-->
<!--<a href="{:url('New/add',array('id'=>$list['id']))}">{:lang('EDIT')}</a>-->
<!--<a href="{:url('New/del',array('id'=>$list['id']))}" class="js-ajax-delete">{:lang('DELETE')}</a>-->
<!--</td>-->
</tr>
</foreach>
</table>
<ul class="pagination">{$page|default=''}</ul>
</form>
</div>
<script src="__STATIC__/js/admin.js"></script>
<script>
function reloadPage(win) {
win.location.reload();
}
$(function () {
setCookie("refersh_time", 0);
Wind.use('ajaxForm', 'artDialog', 'iframeTools', function () {
//批量复制
$('.js-articles-copy').click(function (e) {
var ids = [];
$("input[name='ids[]']").each(function () {
if ($(this).is(':checked')) {
ids.push($(this).val());
}
});
if (ids.length == 0) {
art.dialog.through({
id: 'error',
icon: 'error',
content: '您没有勾选信息,无法进行操作!',
cancelVal: '关闭',
cancel: true
});
return false;
}
ids = ids.join(',');
art.dialog.open("__ROOT__/index.php?g=portal&m=AdminArticle&a=copy&ids=" + ids, {
title: "批量复制",
width: "300px"
});
});
//批量移动
$('.js-articles-move').click(function (e) {
var ids = [];
$("input[name='ids[]']").each(function () {
if ($(this).is(':checked')) {
ids.push($(this).val());
}
});
if (ids.length == 0) {
art.dialog.through({
id: 'error',
icon: 'error',
content: '您没有勾选信息,无法进行操作!',
cancelVal: '关闭',
cancel: true
});
return false;
}
ids = ids.join(',');
art.dialog.open("__ROOT__/index.php?g=portal&m=AdminArticle&a=move&old_term_id={$term.term_id|default=0}&ids=" + ids, {
title: "批量移动",
width: "300px"
});
});
});
});
</script>
</body>
</html>
\ No newline at end of file
... ...
<include file="public@header"/>
<style type="text/css">
.pic-list li {
margin-bottom: 5px;
}
</style>
</head>
<body>
<div class="wrap js-check-wrap">
<ul class="nav nav-tabs">
<li><a href="{:url('New/index')}">成交公布列表</a></li>
<li class="active"><a href="{:url('New/add')}">添加成交公布</a></li>
</ul>
<form action="{:url('New/add')}" method="post" class="form-horizontal js-ajax-form margin-top-20">
<div class="row">
<div class="col-md-9">
<table class="table table-bordered">
<input class="form-control" type="hidden" name="id"
value="{$list['id']}"/>
<tr>
<th width="15%">用户名称</th>
<td><input class="form-control" type="text" name="name"
value="{$list['name']}" placeholder="请输入用户名称"/>
</td>
</tr>
<tr>
<th width="15%">城市</th>
<td><input class="form-control" type="text" name="city"
value="{$list['city']}" placeholder="请输入城市"/>
</td>
</tr>
<tr>
<th width="15%">户型</th>
<td><input class="form-control" type="text" name="floor"
value="{$list['floor']}" placeholder="请输入户型"/>
</td>
</tr>
<tr>
<th width="17%">建筑面积(平米)</th>
<td><input class="form-control" type="text" name="area"
value="{$list['area']}" placeholder="请输入建筑面积"/>
</td>
</tr>
<tr>
<th width="15%">成交价(万)</th>
<td><input class="form-control" type="text" name="sure_money"
value="{$list['sure_money']}" placeholder="请输入成交价"/>
</td>
</tr>
<tr>
<th width="15%">节约价格(万)</th>
<td><input class="form-control" type="text" name="save"
value="{$list['save']}" placeholder="请输入节约价格"/>
</td>
</tr>
<tr>
<th width="15%">成交中介</th>
<td><input class="form-control" type="text" name="agency"
value="{$list['agency']}" placeholder="请输入成交中介"/>
</td>
</tr>
<tr>
<th width="10%">排序</th>
<td><input class="form-control" type="text" name="score"
value="{$list['score']}" placeholder="请输入排序,数字越大越靠前"/>
</td>
</tr>
</table>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<button type="submit" class="btn btn-primary js-ajax-submit">{:lang('ADD')}</button>
<a class="btn btn-default" href="{:url('New/index')}">{:lang('BACK')}</a>
</div>
</div>
</div>
</div>
</form>
</div>
<script type="text/javascript" src="__STATIC__/js/admin.js"></script>
<script type="text/javascript">
//编辑器路径定义
var editorURL = GV.WEB_ROOT;
</script>
<script type="text/javascript" src="__STATIC__/js/ueditor/ueditor.config.js"></script>
<script type="text/javascript" src="__STATIC__/js/ueditor/ueditor.all.min.js"></script>
<script type="text/javascript">
$(function () {
editorcontent = new baidu.editor.ui.Editor();
editorcontent.render('content');
try {
editorcontent.sync();
} catch (err) {
}
$('.btn-cancel-thumbnail').click(function () {
$('#thumbnail-preview').attr('src', '__TMPL__/public/assets/images/default-thumbnail.png');
$('#thumbnail').val('');
});
});
// function doSelectCategory() {
// var selectedCategoriesId = $('#js-categories-id-input').val();
// openIframeLayer("{:url('AdminCategory/select')}?ids=" + selectedCategoriesId, '请选择分类', {
// area: ['700px', '400px'],
// btn: ['确定', '取消'],
// yes: function (index, layero) {
// //do something
//
// var iframeWin = window[layero.find('iframe')[0]['name']];
// var selectedCategories = iframeWin.confirm();
// if (selectedCategories.selectedCategoriesId.length == 0) {
// layer.msg('请选择分类');
// return;
// }
// $('#js-categories-id-input').val(selectedCategories.selectedCategoriesId.join(','));
// $('#js-categories-name-input').val(selectedCategories.selectedCategoriesName.join(' '));
// //console.log(layer.getFrameIndex(index));
// layer.close(index); //如果设定了yes回调,需进行手工关闭
// }
// });
// }
</script>
</body>
</html>
... ...
<include file="public@header"/>
</head>
<body>
<div class="wrap js-check-wrap">
<ul class="nav nav-tabs">
<li class="active"><a href="javascript:;">成交公布列表</a></li>
<li><a href="{:url('New/add')}">添加成交公布</a></li>
</ul>
<form class="well form-inline margin-top-20" method="post" action="{:url('New/index')}">
<!--分类:-->
<!--<select class="form-control" name="category" style="width: 140px;">-->
<!--<option value='0'>全部</option>-->
<!--{$category_tree|default=''}-->
<!--</select> &nbsp;&nbsp;-->
时间:
<input type="text" class="form-control js-bootstrap-datetime" name="start_time"
value="{$start_time|default=''}"
style="width: 140px;" autocomplete="off">-
<input type="text" class="form-control js-bootstrap-datetime" name="end_time"
value="{$end_time|default=''}"
style="width: 140px;" autocomplete="off"> &nbsp; &nbsp;
关键字:
<input type="text" class="form-control" name="keyword" style="width: 200px;"
value="{$keyword|default=''}" placeholder="请输入用户名">
<input type="submit" class="btn btn-primary" value="搜索"/>
<a class="btn btn-danger" href="{:url('New/index')}">清空</a>
</form>
<form class="js-ajax-form" action="" method="post">
<div class="table-actions">
<!--<notempty name="category">-->
<!--<button class="btn btn-primary btn-sm js-ajax-submit" type="submit"-->
<!--data-action="{:url('AdminArticle/listOrder')}">{:lang('SORT')}-->
<!--</button>-->
<!--</notempty>-->
<!--<button class="btn btn-primary btn-sm js-ajax-submit" type="submit"-->
<!--data-action="{:url('AdminArticle/publish',array('yes'=>1))}" data-subcheck="true">发布-->
<!--</button>-->
<!--<button class="btn btn-primary btn-sm js-ajax-submit" type="submit"-->
<!--data-action="{:url('AdminArticle/publish',array('no'=>1))}" data-subcheck="true">取消发布-->
<!--</button>-->
<!--<button class="btn btn-primary btn-sm js-ajax-submit" type="submit"-->
<!--data-action="{:url('AdminArticle/top',array('yes'=>1))}" data-subcheck="true">置顶-->
<!--</button>-->
<!--<button class="btn btn-primary btn-sm js-ajax-submit" type="submit"-->
<!--data-action="{:url('AdminArticle/top',array('no'=>1))}" data-subcheck="true">取消置顶-->
<!--</button>-->
<!--<button class="btn btn-primary btn-sm js-ajax-submit" type="submit"-->
<!--data-action="{:url('AdminArticle/recommend',array('yes'=>1))}" data-subcheck="true">推荐-->
<!--</button>-->
<!--<button class="btn btn-primary btn-sm js-ajax-submit" type="submit"-->
<!--data-action="{:url('AdminArticle/recommend',array('no'=>1))}" data-subcheck="true">取消推荐-->
<!--</button>-->
<!--
<notempty name="category">
<button class="btn btn-primary btn-sm js-articles-move" type="button">批量移动</button>
</notempty>
<button class="btn btn-primary btn-sm js-articles-copy" type="button">批量复制</button>
-->
<button class="btn btn-danger btn-sm js-ajax-submit" type="submit"
data-action="{:url('New/del')}" data-subcheck="true" data-msg="您确定删除吗?">
{:lang('DELETE')}
</button>
</div>
<table class="table table-hover table-bordered table-list">
<thead>
<tr>
<th width="15">
<label>
<input type="checkbox" class="js-check-all" data-direction="x" data-checklist="js-check-x">
</label>
</th>
<notempty name="category">
<th width="50">{:lang('SORT')}</th>
</notempty>
<th width="50">ID</th>
<th>用户名</th>
<th>城市</th>
<th>户型</th>
<th>建筑面积</th>
<th>成交价</th>
<th>节约价格</th>
<th>成交中介</th>
<th>排序</th>
<th width="130">更新时间</th>
<th width="130">发布时间</th>
<th width="90">操作</th>
</tr>
</thead>
<foreach name="list" item="list">
<tr>
<td>
<input type="checkbox" class="js-check" data-yid="js-check-y" data-xid="js-check-x" name="ids[]"
value="{$list.id}" title="ID:{$list.id}">
</td>
<td>{$list.id}</td>
<td>{$list.name}</td>
<td>{$list.city}</td>
<td>{$list.floor}</td>
<td>{$list.area} 平米</td>
<td>{$list.sure_money} 万</td>
<td>{$list.save} 万</td>
<td>{$list.agency}</td>
<td>
{$list.score}
</td>
<td>
{:date('Y-m-d H:i',$list['update_time'])}
</td>
<td>
{:date('Y-m-d H:i',$list['create_time'])}
<!--<empty name="vo.published_time">-->
<!--未发布-->
<!--<else/>-->
<!--{:date('Y-m-d H:i',$list['published_time'])}-->
<!--</empty>-->
</td>
<td>
<a href="{:url('New/add',array('id'=>$list['id']))}">{:lang('EDIT')}</a>
<a href="{:url('New/del',array('id'=>$list['id']))}" class="js-ajax-delete">{:lang('DELETE')}</a>
</td>
</tr>
</foreach>
</table>
<ul class="pagination">{$page|default=''}</ul>
</form>
</div>
<script src="__STATIC__/js/admin.js"></script>
<script>
function reloadPage(win) {
win.location.reload();
}
$(function () {
setCookie("refersh_time", 0);
Wind.use('ajaxForm', 'artDialog', 'iframeTools', function () {
//批量复制
$('.js-articles-copy').click(function (e) {
var ids = [];
$("input[name='ids[]']").each(function () {
if ($(this).is(':checked')) {
ids.push($(this).val());
}
});
if (ids.length == 0) {
art.dialog.through({
id: 'error',
icon: 'error',
content: '您没有勾选信息,无法进行操作!',
cancelVal: '关闭',
cancel: true
});
return false;
}
ids = ids.join(',');
art.dialog.open("__ROOT__/index.php?g=portal&m=AdminArticle&a=copy&ids=" + ids, {
title: "批量复制",
width: "300px"
});
});
//批量移动
$('.js-articles-move').click(function (e) {
var ids = [];
$("input[name='ids[]']").each(function () {
if ($(this).is(':checked')) {
ids.push($(this).val());
}
});
if (ids.length == 0) {
art.dialog.through({
id: 'error',
icon: 'error',
content: '您没有勾选信息,无法进行操作!',
cancelVal: '关闭',
cancel: true
});
return false;
}
ids = ids.join(',');
art.dialog.open("__ROOT__/index.php?g=portal&m=AdminArticle&a=move&old_term_id={$term.term_id|default=0}&ids=" + ids, {
title: "批量移动",
width: "300px"
});
});
});
});
</script>
</body>
</html>
\ No newline at end of file
... ...
<include file="public@header"/>
<link rel="stylesheet" href="__STATIC__/install/css/mdialog.css">
<style>
.popup{
width: 250px;
height: 100px;
background-color: rgba(0,0,0,0.5);
position: fixed;
top: 50%;
transform: translateY(-50px);
left: 0;
right: 0;
margin: 0 auto;
border-radius: 5px;
color: #ffffff;
}
.popup p{
text-align: center;
margin-top: 20px;
}
.popup span{
text-align: center;
line-height: 30px;
cursor: pointer;
}
.popup .queding{
display: inline-block;
width: 80px;
height: 30px;
background-color: #1E9FFF;
border-radius: 3px;
}
.popup span:hover{
opacity: 0.8;
}
.popup .quxiao{
display: inline-block;
width: 80px;
height: 30px;
ckground-color: #9cb945 ;
color: #333333;
border-radius: 3px;
background-color:#fff;
margin-left: 35px;
}
.btn_list{
margin: 0 auto;
width: 200px;
}
</style>
</head>
<body>
<div class="wrap">
<ul class="nav nav-tabs">
<li class="active"><a>{:lang('USER_OAUTHADMIN_INDEX')}</a></li>
</ul>
<form class="well form-inline margin-top-20" method="post" action="{:url('AdminOauth/black')}">
时间:
<input type="text" class="form-control js-bootstrap-datetime" name="start_time"
value="{$start_time|default=''}"
style="width: 140px;" autocomplete="off"> -
<input type="text" class="form-control js-bootstrap-datetime" name="end_time"
value="{$end_time|default=''}"
style="width: 140px;" autocomplete="off"> &nbsp; &nbsp;
姓名:
<input type="text" class="form-control" name="name" style="width: 200px;"
value="{$name|default=''}" placeholder="请输入姓名">
手机号:
<input type="text" class="form-control" name="tel" style="width: 200px;"
value="{$tel|default=''}" placeholder="请输入手机号">
<input type="submit" class="btn btn-primary" value="搜索"/>
<a class="btn btn-danger" href="{:url('AdminOauth/black')}">清空</a>
</form>
<form method="post" class="js-ajax-form margin-top-20">
<table class="table table-hover table-bordered">
<thead>
<tr>
<th>ID</th>
<th>姓名</th>
<th>手机号</th>
<th>推荐人</th>
<th>推荐人id</th>
<th>创建时间</th>
<th>更新时间</th>
<th>状态</th>
<th align="center">操作</th>
</tr>
</thead>
<tbody>
<foreach name="lists" item="vo">
<tr>
<td>{$vo.id}</td>
<td>{$vo.name}</td>
<td>{$vo.tel}</td>
<td>
<empty name="vo.referee_name">
暂无
</empty>
{$vo.referee_name}
</td>
<td>
<empty name="vo.referee_name">
暂无
</empty>
{$vo.referee_id}
</td>
<td>{:date('Y-m-d H:i:s',$vo['create_time'])}</td>
<td>{:date('Y-m-d H:i:s',$vo['update_time'])}</td>
<td>
<eq name="vo.status" value="1">
正常
</eq>
<eq name="vo.status" value="8">
已拉黑
</eq>
<eq name="vo.status" value="9">
已删除
</eq>
</td>
<td>
<span class="recovery" style="color: #18BC9C; text-decoration:underline;" index="{$vo.id}">恢复</span>
</td>
</tr>
</foreach>
</tbody>
</table>
</form>
<div class="popup" style="display: none;">
<p>确认恢复该用户</p>
<div class="btn_list">
<span class="queding">确认</span>
<span class="quxiao">取消</span>
</div>
</div>
</div>
<script src="__STATIC__/js/admin.js"></script>
<script src="__STATIC__/js/layer/layer.js"></script>
<script type="text/javascript" src="__STATIC__/js/zepto.min.js"></script>
<script type="text/javascript" src="__STATIC__/js/mdialog.js"></script>
<script type="">
$('.recovery').click(function () {
var id = $('.recovery').attr('index');
$('.popup').css('display','block');
// 删除
$('.queding').click(function () {
$.ajax({
type:"POST",
url:"{:url('AdminOauth/recovery')}",
data:{
"id":id,
},
success:function (data) {
new TipBox({type:'success',str:'操作成功',hasBtn:true});
$('.popup').css('display','none');
},
error:function () {
new TipBox({type:'error',str:'对不起,出错了!',hasBtn:true});
$('.popup').css('display','none');
}
})
})
})
$('.quxiao').click(function () {
$('.popup').css('display','none');
})
</script>
</body>
</html>
\ No newline at end of file
... ...
... ... @@ -54,6 +54,23 @@
<ul class="nav nav-tabs">
<li class="active"><a>{:lang('USER_OAUTHADMIN_INDEX')}</a></li>
</ul>
<form class="well form-inline margin-top-20" method="post" action="{:url('AdminOauth/intermediary')}">
时间:
<input type="text" class="form-control js-bootstrap-datetime" name="start_time"
value="{$start_time|default=''}"
style="width: 140px;" autocomplete="off"> -
<input type="text" class="form-control js-bootstrap-datetime" name="end_time"
value="{$end_time|default=''}"
style="width: 140px;" autocomplete="off">
姓名:
<input type="text" class="form-control" name="name" style="width: 200px;"
value="{$name|default=''}" placeholder="请输入姓名">
手机号:
<input type="text" class="form-control" name="tel" style="width: 200px;"
value="{$tel|default=''}" placeholder="请输入手机号">
<input type="submit" class="btn btn-primary" value="搜索"/>
<a class="btn btn-danger" href="{:url('AdminOauth/intermediary')}">清空</a>
</form>
<form method="post" class="js-ajax-form margin-top-20">
<table class="table table-hover table-bordered">
<thead>
... ...
... ... @@ -54,6 +54,25 @@
<ul class="nav nav-tabs">
<li class="active"><a>{:lang('USER_OAUTHADMIN_INDEX')}</a></li>
</ul>
<form class="well form-inline margin-top-20" method="post" action="{:url('AdminOauth/user')}">
时间:
<input type="text" class="form-control js-bootstrap-datetime" name="start_time"
value="{$start_time|default=''}"
style="width: 140px;" autocomplete="off"> -
<input type="text" class="form-control js-bootstrap-datetime" name="end_time"
value="{$end_time|default=''}"
style="width: 140px;" autocomplete="off"> &nbsp; &nbsp;
姓名:
<input type="text" class="form-control" name="name" style="width: 200px;"
value="{$name|default=''}" placeholder="请输入姓名">
手机号:
<input type="text" class="form-control" name="tel" style="width: 200px;"
value="{$tel|default=''}" placeholder="请输入手机号">
<input type="submit" class="btn btn-primary" value="搜索"/>
<a class="btn btn-danger" href="{:url('AdminOauth/user')}">清空</a>
</form>
<form method="post" class="js-ajax-form margin-top-20">
<table class="table table-hover table-bordered">
<thead>
... ... @@ -66,7 +85,7 @@
<th>创建时间</th>
<th>更新时间</th>
<th>状态</th>
<th align="center">操作</th>
<th align="center" style="cursor: pointer;">操作</th>
</tr>
</thead>
<tbody>
... ... @@ -103,13 +122,13 @@
</td>
<td>
<eq name="vo.status" value="1">
<span class="black" style="color: #18BC9C; text-decoration:underline;" index="{$vo.id}">拉黑</span>
<span class="black" style="color: #18BC9C; text-decoration:underline; cursor: pointer; " index="{$vo.id}">拉黑</span>
</eq>
<eq name="vo.status" value="8">
<span style="color:#aaaaaa;" index="{$vo.id}">已拉黑</span>
<span style="color:#aaaaaa; cursor: pointer; " index="{$vo.id}">已拉黑</span>
</eq>
<eq name="vo.status" value="9">
<span style="color:#aaaaaa;" index="{$vo.id}">已删除</span>
<span style="color:#aaaaaa; cursor: pointer; " index="{$vo.id}">已删除</span>
</eq>
</td>
</tr>
... ...
... ... @@ -80,14 +80,19 @@ class CaptchaController
$config = array_merge($defaultCaptchaConfig, $config);
}
ob_clean();//解决验证码不显示问题
$rand = $request->param('rand');
$captcha = new Captcha($config);
ob_clean();// 清除输出缓存
// $final_return['img'] = $captcha->entry($id,$rand);
// $final_return['rand'] = $rand;
return $captcha->entry($id);
// return $final_return;
$rand_middle = $request->param('rand');
if($rand_middle){
$rand = explode('.',$rand_middle);
$final_ret = $captcha->entry($id,$rand[0]);
}else{
$final_ret = $captcha->entry($id);
}
return $final_ret;
}
}
... ...
... ... @@ -135,7 +135,7 @@ class Captcha
* @param string $id 要生成验证码的标识
* @return \think\Response
*/
public function entry($id = '')
public function entry($id = '',$rand='')
{
// 图片宽(px)
$this->imageW || $this->imageW = $this->length * $this->fontSize * 1.5 + $this->length * $this->fontSize / 2;
... ... @@ -201,7 +201,9 @@ class Captcha
$secode['verify_code'] = $code; // 把校验码保存到session
$secode['verify_time'] = time(); // 验证码创建时间
Session::set($key . $id, $secode, '');
$rand = str_replace(".","",substr(microtime(true),-5)).rand(1000,9999);
// $rand = str_replace(".","",substr(microtime(true),-5)).rand(1000,9999);
if(!empty($rand)){
$img_add['code'] = $code;
$img_add['time'] = time();
... ... @@ -220,7 +222,6 @@ class Captcha
imagepng($this->_image);
$content = ob_get_clean();
imagedestroy($this->_image);
// return response($content, 200, ['Content-Length' => strlen($content),'rand' => $rand])->contentType('image/png');
$re = response($content, 200, ['Content-Length' => strlen($content),'rand' => $rand])->contentType('image/png');
return $re;
}
... ...