Commit 2704d431 authored by wangtao's avatar wangtao

管理后台 看板

parent 44a5c681
...@@ -8,9 +8,12 @@ ...@@ -8,9 +8,12 @@
* --------------------------------------------------------------------------- * ---------------------------------------------------------------------------
*/ */
declare (strict_types=1); declare (strict_types=1);
namespace app; namespace app;
use think\App; use think\App;
use think\facade\Cache;
use think\facade\Db;
use think\Response; use think\Response;
use think\facade\View; use think\facade\View;
use think\exception\HttpResponseException; use think\exception\HttpResponseException;
...@@ -78,6 +81,28 @@ abstract class BaseController ...@@ -78,6 +81,28 @@ abstract class BaseController
$this->__auth(); $this->__auth();
// 控制器初始化 // 控制器初始化
$this->__init(); $this->__init();
$this->logon();
//访问量
$this->__website();
}
protected function __website()
{
$ip = $this->request->ip();
$websitelog = Cache::get('webistelog:' . $ip);
if (empty($websitelog)) {
$url = substr(vhtmlspecialchars(strip_sql($this->request->url())), 0, 200);
$a = substr(vhtmlspecialchars(strip_sql(request()->header('user-agent'))), 0, 200);
$data['ip'] = $ip;
$data['url'] = $url;
$data['user_agent'] = $a;
$data['logtime'] = time();
Db::name('webiste_log')->insert($data);
Db::name('webiste')->where('id', 1)->setInc('unique_visitors');
Cache::set('webistelog:' . $ip, $ip, 72000);
}
} }
/** /**
...@@ -86,45 +111,50 @@ abstract class BaseController ...@@ -86,45 +111,50 @@ abstract class BaseController
protected function __home() protected function __home()
{ {
// 前台统一开关 需后台配置参数 开关类型:site_close 和 文本域类型:site_close_tip // 前台统一开关 需后台配置参数 开关类型:site_close 和 文本域类型:site_close_tip
if(vconfig('site_close')) $this->exitMsg(vconfig('site_close_tip','系统升级维护中,请稍后访问!'),400); if (vconfig('site_close')) $this->exitMsg(vconfig('site_close_tip', '系统升级维护中,请稍后访问!'), 400);
// 获取会员信息 // 获取会员信息
$this->memUser = session(VT_MEMBER); $this->memUser = session(VT_MEMBER);
} }
/** /**
* 验证(登录、权限) * 验证(登录、权限)
*/ */
protected function __auth(){} protected function __auth()
{
}
/** /**
* 初始化 * 初始化
*/ */
protected function __init(){} protected function __init()
{
}
/** /**
* 空方法 * 空方法
*/ */
public function __call($name, $arg) public function __call($name, $arg)
{ {
$this->exitMsg('Method does not exist',400); $this->exitMsg('Method does not exist', 400);
} }
/** /**
* 日志/在线处理 * 日志/在线处理
* @access protected * @access protected
* @param string $tip 提示 * @param string $tip 提示
*/ */
protected function logon(string $tip = '') protected function logon(string $tip = '')
{ {
$flag1 = vconfig('home_log',0); $flag1 = vconfig('home_log', 0);
$flag2 = in_array(vconfig('online_on',0),[2,3]);
if($flag1 || $flag2) $url = substr(vhtmlspecialchars(strip_sql($this->request->url())),0,200); $flag2 = in_array(vconfig('online_on', 0), [2, 3]);
if ($flag1 || $flag2) $url = substr(vhtmlspecialchars(strip_sql($this->request->url())), 0, 200);
/*访问日志*/ /*访问日志*/
if($flag1){ if ($flag1) {
\app\model\system\SystemWebLog::add(['url'=>$url.$tip,'username'=>$this->memUser['username'] ?? '','ip'=>$this->request->ip()]); \app\model\system\SystemWebLog::add(['url' => $url . $tip, 'username' => $this->memUser['username'] ?? '', 'ip' => $this->request->ip()]);
}/**/ }/**/
/*在线统计【0:关闭全部 1:开启后台 2:开启会员 3:开启全部】*/ /*在线统计【0:关闭全部 1:开启后台 2:开启会员 3:开启全部】*/
if($flag2){ if ($flag2) {
\app\model\system\SystemOnline::recod($this->memUser, $url); \app\model\system\SystemOnline::recod($this->memUser, $url);
}/**/ }/**/
} }
...@@ -132,7 +162,7 @@ abstract class BaseController ...@@ -132,7 +162,7 @@ abstract class BaseController
/** /**
* 模板赋值 * 模板赋值
* @access protected * @access protected
* @param string|array $vars 赋值表达式/数组 * @param string|array $vars 赋值表达式/数组
*/ */
protected final function assign(...$vars) protected final function assign(...$vars)
{ {
...@@ -142,9 +172,9 @@ abstract class BaseController ...@@ -142,9 +172,9 @@ abstract class BaseController
/** /**
* 模板渲染 * 模板渲染
* @access protected * @access protected
* @param string $tmp 模板名称 * @param string $tmp 模板名称
* @param string $tip 提示 * @param string $tip 提示
* @param bool $logon 记录日志 * @param bool $logon 记录日志
*/ */
protected final function fetch(string $tmp = '', string $tip = '', bool $logon = true) protected final function fetch(string $tmp = '', string $tip = '', bool $logon = true)
{ {
...@@ -155,7 +185,7 @@ abstract class BaseController ...@@ -155,7 +185,7 @@ abstract class BaseController
/** /**
* 重定向 * 重定向
* @access protected * @access protected
* @param string $args 重定向地址 * @param string $args 重定向地址
* @throws HttpResponseException * @throws HttpResponseException
*/ */
protected final function redirect(...$args) protected final function redirect(...$args)
...@@ -166,20 +196,20 @@ abstract class BaseController ...@@ -166,20 +196,20 @@ abstract class BaseController
/** /**
* 中断反馈信息 * 中断反馈信息
* @access protected * @access protected
* @param string $m 信息字符 * @param string $m 信息字符
* @param int $c 状态值 400前台关闭 401 Ajax请求未登陆 303网址请求未登录 * @param int $c 状态值 400前台关闭 401 Ajax请求未登陆 303网址请求未登录
* @param array $d 数组信息 * @param array $d 数组信息
* @param array $h 发送的Header信息 * @param array $h 发送的Header信息
* @throws HttpResponseException * @throws HttpResponseException
*/ */
protected final function exitMsg($m, $c = 0, $d = [], $h = []) protected final function exitMsg($m, $c = 0, $d = [], $h = [])
{ {
if($c==400){ if ($c == 400) {
$re = Response::create(ROOT_PATH . 'app/v_msg.tpl','view')->assign(['msg'=>$m,'site'=>vconfig('site_title')])->header($h); $re = Response::create(ROOT_PATH . 'app/v_msg.tpl', 'view')->assign(['msg' => $m, 'site' => vconfig('site_title')])->header($h);
}else if($c==303){ } else if ($c == 303) {
$re = Response::create(ROOT_PATH . 'app/v_msg.tpl','view')->assign(['msg'=>$m,'site'=>vconfig('site_title'),'url'=>$d['url']])->header($h); $re = Response::create(ROOT_PATH . 'app/v_msg.tpl', 'view')->assign(['msg' => $m, 'site' => vconfig('site_title'), 'url' => $d['url']])->header($h);
}else{ } else {
$rs = json_encode(['code'=>$c,'msg'=>$m,'data'=>$d,'token'=>$this->token]); $rs = json_encode(['code' => $c, 'msg' => $m, 'data' => $d, 'token' => $this->token]);
$re = Response::create($rs)->header($h); $re = Response::create($rs)->header($h);
} }
throw new HttpResponseException($re); throw new HttpResponseException($re);
...@@ -188,39 +218,39 @@ abstract class BaseController ...@@ -188,39 +218,39 @@ abstract class BaseController
/** /**
* 返回组信息 * 返回组信息
* @access protected * @access protected
* @param string|array|obj $msg 信息字符 * @param string|array|obj $msg 信息字符
* @param int $code 状态码 * @param int $code 状态码
* @param array $data 数组信息 * @param array $data 数组信息
* @param int $scode 页头状态码 * @param int $scode 页头状态码
* @param array $header 头部 * @param array $header 头部
* @param array $options 参数 * @param array $options 参数
* @return html/json * @return html/json
*/ */
protected final function returnMsg($msg = '', $code = 0, $data = [], $scode = 200, $header = [], $options = []) protected final function returnMsg($msg = '', $code = 0, $data = [], $scode = 200, $header = [], $options = [])
{ {
$msg = is_object($msg) ? $msg->toArray() : $msg; $msg = is_object($msg) ? $msg->toArray() : $msg;
if(is_array($msg)){ if (is_array($msg)) {
if(isset($msg['total'])){ //分页模式 if (isset($msg['total'])) { //分页模式
$data = $msg['data']; $data = $msg['data'];
$count = $msg['total']; $count = $msg['total'];
$data['msg'] = $msg['msg'] ?? ''; $data['msg'] = $msg['msg'] ?? '';
}else{ } else {
$data = $msg; $data = $msg;
} }
$msg = $data['msg'] ?? ''; $msg = $data['msg'] ?? '';
$code = $data['code'] ?? $code; $code = $data['code'] ?? $code;
unset($data['msg'],$data['code']); unset($data['msg'], $data['code']);
$data = $data['data'] ?? $data; $data = $data['data'] ?? $data;
}elseif($this->msgTpl === ''){ } elseif ($this->msgTpl === '') {
$this->logon((string)$msg); $this->logon((string)$msg);
} }
$token = $this->token; $token = $this->token;
$count = isset($count) ? $count : (is_array($data) ? count($data) : 1); $count = isset($count) ? $count : (is_array($data) ? count($data) : 1);
if($this->msgTpl){ if ($this->msgTpl) {
$this->assign(compact('code', 'msg', 'data', 'count', 'token')); $this->assign(compact('code', 'msg', 'data', 'count', 'token'));
return $this->fetch($this->msgTpl); return $this->fetch($this->msgTpl);
}else{ } else {
return json(compact('code', 'msg', 'data', 'count', 'token'), $scode, $header, $options); return json(compact('code', 'msg', 'data', 'count', 'token'), $scode, $header, $options);
} }
} }
...@@ -228,82 +258,92 @@ abstract class BaseController ...@@ -228,82 +258,92 @@ abstract class BaseController
/** /**
* 带模板反馈提示 * 带模板反馈提示
* @access protected * @access protected
* @param string $msg 提示信息 * @param string $msg 提示信息
* @param int $tpl 提示模板 * @param int $tpl 提示模板
* @param string $url 跳转的地址 * @param string $url 跳转的地址
*/ */
protected final function returnTpl($msg = '', $tpl = '', $url = '') protected final function returnTpl($msg = '', $tpl = '', $url = '')
{ {
$tpl = $tpl ?: ($this->request->isMobile() ? 'err' : ROOT_PATH . 'app/v_msg.tpl'); $tpl = $tpl ?: ($this->request->isMobile() ? 'err' : ROOT_PATH . 'app/v_msg.tpl');
$this->assign(['msg'=>$msg,'url'=>$url]); $this->assign(['msg' => $msg, 'url' => $url]);
return $this->fetch($tpl); return $this->fetch($tpl);
} }
/** /**
* 获取指定的参数 过滤方法后执行【key / *或?表非空时验证或$表非空时验证不规范则置空不中断 / 规则(e邮箱m手机c身份证p密码u帐号n姓名i数串a插件名v配置名)或位数范围如{1,3} / 提示(传入优先) / 合法的字符集0,1..串 默认0:字母数字汉字下划线 1:数字 2:小写字母 3:大写字母 4:汉字 5:任何非空白字符 / 允许的字符】 * 获取指定的参数 过滤方法后执行【key / *或?表非空时验证或$表非空时验证不规范则置空不中断 / 规则(e邮箱m手机c身份证p密码u帐号n姓名i数串a插件名v配置名)或位数范围如{1,3} / 提示(传入优先) / 合法的字符集0,1..串 默认0:字母数字汉字下划线 1:数字 2:小写字母 3:大写字母 4:汉字 5:任何非空白字符 / 允许的字符】
* @access protected * @access protected
* @param array $name 变量名 /a转数组 /d整数 /f浮点 /b布尔 /s字符串 /u网址净化 /h全净化去标签 /c转为HTML实体 /r转为2位小数 /*验证【默认允许:汉字|字母|数字|下划线|空格.#-】 * @param array $name 变量名 /a转数组 /d整数 /f浮点 /b布尔 /s字符串 /u网址净化 /h全净化去标签 /c转为HTML实体 /r转为2位小数 /*验证【默认允许:汉字|字母|数字|下划线|空格.#-】
* @param mixed $type 方法类型 默认 post * @param mixed $type 方法类型 默认 post
* @param string|array $filter 过滤方法 默认 strip_sql * @param string|array $filter 过滤方法 默认 strip_sql
* @param bool $bin 是否以传入数组为准 默认是 * @param bool $bin 是否以传入数组为准 默认是
* @return array * @return array
*/ */
protected final function only($name = [], $type = 'post', $filter = 'strip_sql', $bin = true) protected final function only($name = [], $type = 'post', $filter = 'strip_sql', $bin = true)
{ {
if(isset($name['@token'])){ if (isset($name['@token'])) {
if(!env('APP_DEBUG')){ if (!env('APP_DEBUG')) {
$arr = array_merge([$this->tokenName,[]],(array)$name['@token']); $arr = array_merge([$this->tokenName, []], (array)$name['@token']);
$this->request->checkToken($arr[0],$arr[1]) === false && $this->exitMsg("Token错误"); $this->request->checkToken($arr[0], $arr[1]) === false && $this->exitMsg("Token错误");
$this->token = token($this->tokenName); $this->token = token($this->tokenName);
} }
unset($name['@token']); unset($name['@token']);
if(!$name) return []; if (!$name) return [];
} }
$item = []; $item = [];
$data = $this->request->$type(false); $data = $this->request->$type(false);
$preg = [ $preg = [
'e'=>[2=>'email',3=>'邮箱地址格式错误',4=>'',5=>''], 'e' => [2 => 'email', 3 => '邮箱地址格式错误', 4 => '', 5 => ''],
'm'=>[2=>'mobile',3=>'手机号码格式错误',4=>'',5=>''], 'm' => [2 => 'mobile', 3 => '手机号码格式错误', 4 => '', 5 => ''],
'c'=>[2=>'idcard',3=>'身份证号格式错误',4=>'',5=>''], 'c' => [2 => 'idcard', 3 => '身份证号格式错误', 4 => '', 5 => ''],
'p'=>[2=>'{6,16}',3=>'密码',4=>'5',5=>''], 'p' => [2 => '{6,16}', 3 => '密码', 4 => '5', 5 => ''],
'u'=>[2=>'{4,30}',3=>'帐号',4=>'1,2,3',5=>'._@'], 'u' => [2 => '{4,30}', 3 => '帐号', 4 => '1,2,3', 5 => '._@'],
'n'=>[2=>'{2,30}',3=>'姓名',4=>'0',5=>' .'], 'n' => [2 => '{2,30}', 3 => '姓名', 4 => '0', 5 => ' .'],
'i'=>[2=>'{1,30}',3=>'数串',4=>'1',5=>','], 'i' => [2 => '{1,30}', 3 => '数串', 4 => '1', 5 => ','],
'a'=>[2=>'{3,20}',3=>'插件名',4=>'1,2',5=>''], 'a' => [2 => '{3,20}', 3 => '插件名', 4 => '1,2', 5 => ''],
'v'=>[2=>'{2,20}',3=>'配置名',4=>'1,2,3',5=>'_'] 'v' => [2 => '{2,20}', 3 => '配置名', 4 => '1,2,3', 5 => '_']
]; ];
foreach($name as $key => $val){ foreach ($name as $key => $val) {
$default = ''; $default = '';
$sub = ['','','','','0',' .#-']; // 对应['key','转换类型|验证符*或?','验证规则','提示','合法的字符集','允许的字符'] $sub = ['', '', '', '', '0', ' .#-']; // 对应['key','转换类型|验证符*或?','验证规则','提示','合法的字符集','允许的字符']
if(strpos($val, '/')){ if (strpos($val, '/')) {
$sub = explode('/', $val) + $sub; $sub = explode('/', $val) + $sub;
$val = $sub[0]; $val = $sub[0];
} }
$flag = true; //用于是否 $filter 过滤控制 $flag = true; //用于是否 $filter 过滤控制
if(is_int($key)){ if (is_int($key)) {
$key = $val; $key = $val;
if($key[0] == '@'){$flag = false; $key = ltrim($key,'@');} if ($key[0] == '@') {
if(!key_exists($key,$data) && !$sub[1]){ $flag = false;
$key = ltrim($key, '@');
}
if (!key_exists($key, $data) && !$sub[1]) {
$item[$key] = $default; $item[$key] = $default;
continue; continue;
} }
}else{ } else {
$default = $val; $default = $val;
if($key[0] == '@'){$flag = false; $key = ltrim($key,'@');} if ($key[0] == '@') {
$flag = false;
$key = ltrim($key, '@');
}
} }
$v = $data[$key] ?? $default; $v = $data[$key] ?? $default;
if($sub[1]){ if ($sub[1]) {
$must = $msg = true; // $must:是否必须验证 $msg:是否验证不规范时中断反馈提示 $must = $msg = true; // $must:是否必须验证 $msg:是否验证不规范时中断反馈提示
if(in_array($sub[1],['?','$'])){$must = $v ? true : false; if($sub[1] == '$') $msg = false; $sub[1] = '*';} if (in_array($sub[1], ['?', '$'])) {
switch($sub[1]){ $must = $v ? true : false;
if ($sub[1] == '$') $msg = false;
$sub[1] = '*';
}
switch ($sub[1]) {
case 'a': case 'a':
$v = $v ? (array) $v : []; $v = $v ? (array)$v : [];
break; break;
case 'd': case 'd':
$v = (int) $v; $v = (int)$v;
break; break;
case 'u': case 'u':
$v = strip_html($v,0); $v = strip_html($v, 0);
break; break;
case 'h': case 'h':
$v = strip_html($v); $v = strip_html($v);
...@@ -315,37 +355,45 @@ abstract class BaseController ...@@ -315,37 +355,45 @@ abstract class BaseController
$v = dround($v); $v = dround($v);
break; break;
case '*': case '*':
if($sub[2]=='p') $must = is_md5($v) ? false : $must; if ($sub[2] == 'p') $must = is_md5($v) ? false : $must;
$tip = $sub[3]; if(isset($preg[$sub[2]])){$sub = $preg[$sub[2]] + $sub; $tip = $tip ?: $sub[3];} $tip = $sub[3];
$reg = explode(',',$sub[4]); if (isset($preg[$sub[2]])) {
if($must && !is_preg($v,$sub[2],$reg,$sub[5])){ $sub = $preg[$sub[2]] + $sub;
if($msg){ $tip = $tip ?: $sub[3];
$tip = $tip ?: "字段{$key}不合规范"; $txt = ['汉字字母数字下划线','数字','小写字母','大写字母','汉字','任何非空白字符']; }
if($reg[0]!==''){ $reg = explode(',', $sub[4]);
$str = ''; foreach($reg as $i){$str .= ($txt[$i] ?? '').'、';} if ($must && !is_preg($v, $sub[2], $reg, $sub[5])) {
$tip = $tip.'必须由'.(str_replace(['{',',','}'],['','-',''],$sub[2])).'位'.rtrim($str,'、').($sub[5] ? '和'.str_replace(' ', '空格', $sub[5]) : '').'组成'; if ($msg) {
$tip = $tip ?: "字段{$key}不合规范";
$txt = ['汉字字母数字下划线', '数字', '小写字母', '大写字母', '汉字', '任何非空白字符'];
if ($reg[0] !== '') {
$str = '';
foreach ($reg as $i) {
$str .= ($txt[$i] ?? '') . '、';
}
$tip = $tip . '必须由' . (str_replace(['{', ',', '}'], ['', '-', ''], $sub[2])) . '位' . rtrim($str, '、') . ($sub[5] ? '和' . str_replace(' ', '空格', $sub[5]) : '') . '组成';
} }
$this->exitMsg($tip); $this->exitMsg($tip);
}else{ } else {
$v = ''; $v = '';
} }
} }
break; break;
case 'f': case 'f':
$v = (float) $v; $v = (float)$v;
break; break;
case 'b': case 'b':
$v = (boolean) $v; $v = (boolean)$v;
break; break;
case 's': case 's':
if(is_scalar($v)){ if (is_scalar($v)) {
$v = (string) $v; $v = (string)$v;
}else{ } else {
throw new \InvalidArgumentException('variable type error:' . gettype($v)); throw new \InvalidArgumentException('variable type error:' . gettype($v));
} }
break; break;
} }
if($sub[1] != '*' && $sub[2] && !$v) $this->exitMsg($sub[2]); if ($sub[1] != '*' && $sub[2] && !$v) $this->exitMsg($sub[2]);
} }
$item[$key] = $flag ? call_user_func($filter, $v) : $v; $item[$key] = $flag ? call_user_func($filter, $v) : $v;
} }
......
...@@ -49,6 +49,15 @@ abstract class AdminBase extends BaseController ...@@ -49,6 +49,15 @@ abstract class AdminBase extends BaseController
*/ */
protected function __home() protected function __home()
{ {
}
/**
* 覆盖无需业务
*/
protected function __website()
{
} }
/** /**
......
...@@ -7,14 +7,16 @@ ...@@ -7,14 +7,16 @@
* Licensed: 这不是一个自由软件,不允许对程序代码以任何形式任何目的的再发行 * Licensed: 这不是一个自由软件,不允许对程序代码以任何形式任何目的的再发行
* --------------------------------------------------------------------------- * ---------------------------------------------------------------------------
*/ */
namespace app\admin\controller; namespace app\admin\controller;
use app\job\Jobtask; use app\job\Jobtask;
use app\model\system\SystemDict as Dict; use app\model\system\SystemDict as Dict;
use app\model\system\SystemMenus as Menus; use app\model\system\SystemMenus as Menus;
use app\model\system\SystemCategory as Category; use app\model\system\SystemCategory as Category;
use think\facade\Db;
use think\facade\Queue; use think\facade\Queue;
use Carbon\Carbon;
/** /**
* 后台主控制器 * 后台主控制器
...@@ -27,72 +29,176 @@ class Index extends AdminBase ...@@ -27,72 +29,176 @@ class Index extends AdminBase
*/ */
public function index() public function index()
{ {
$this->assign([ $this->assign([
"appMap" => $this->appMap, "appMap" => $this->appMap,
"tokenName" => $this->tokenName "tokenName" => $this->tokenName
]); ]);
return $this->fetch('','',false); return $this->fetch('', '', false);
} }
/** /**
* 后台主面板 * 后台主面板
* @return mixed * @return mixed
*/ */
public function main() public function main()
{ {
$business_dsh_count = Db::name('business')->where(['is_del' => '0', 'status' => 0])->count(); //企业资料待审核
$school_dsh_count = Db::name('school')->where(['is_del' => '0', 'status' => 0])->count(); //学校资料待审核
$course_dsh_count = Db::name('sh_course')->where(['is_del' => '0', 'status' => 1])->count(); //课程待审核
$project_dsh_count = Db::name('project')->where(['sh_status' => 0])->where('deletetime', 'NUll')->count(); //项目待审核
$tixian_dsh_count = Db::name('user_withdrawal')->where(['sh_status' => 0])->where('deletetime', 'NUll')->count(); //提现待审核
$tixian_dk_dsh_count = Db::name('user_withdrawal')->where(['sh_status' => 2, 'dk_status' => 0])->where('deletetime', 'NUll')->count(); //打款待审核
$data['business_dsh_count'] = $business_dsh_count ?? 0;
$data['school_dsh_count'] = $school_dsh_count ?? 0;
$data['course_dsh_count'] = $course_dsh_count ?? 0;
$data['project_dsh_count'] = $project_dsh_count ?? 0;
$data['tixian_dsh_count'] = $tixian_dsh_count ?? 0;
$data['tixian_dk_dsh_count'] = $tixian_dk_dsh_count ?? 0;
$visitors_sum = Db::name('webiste')->where('id', 1)->value('unique_visitors'); //总访问量
$todayStart = Carbon::today()->timestamp;// 今日开始时间(00:00:00)
$todayEnd = Carbon::today()->endOfDay()->timestamp; // 今日结束时间(23:59:59)
$map[] = ['logtime', '>=', $todayStart];
$map[] = ['logtime', '<=', $todayEnd];
$day_visitors = Db::name('webiste_log')->where($map)->count(); //今日访问量
$payment_sum_money = Db::name('payment')->where('pay_status', 1)->sum('pay_amount'); //总销售金额
$monthStart = Carbon::now()->startOfMonth()->timestamp; // 本月1号 00:00:00
$monthEnd = Carbon::now()->endOfMonth()->timestamp; // 本月最后一天 23:59:59
$map = [];
$map[] = ['pay_time', '>=', $monthStart];
$map[] = ['pay_time', '<=', $monthEnd];
$map[] = ['pay_status', '=', 1];
$month_sum_money = Db::name('payment')->where($map)->sum('pay_amount'); //月销售金额
$payment_sum_count = Db::name('payment')->where('pay_status', 1)->count(); //订单量
$map = [];
$map[] = ['pay_time', '>=', $monthStart];
$map[] = ['pay_time', '<=', $monthEnd];
$map[] = ['pay_status', '=', 1];
$month_payment_count = Db::name('payment')->where($map)->sum('pay_amount'); //月订单量
$user_sum_count = Db::name('user')->where('is_del', 0)->count(); //总用户数量
$map = [];
$map[] = ['reg_time', '>=', $todayStart];
$map[] = ['reg_time', '<=', $todayEnd];
$user_day_count = Db::name('user')->where($map)->count(); //今日新增用户量
$course_sum_tvclick_count = Db::name('course')->where('is_del', 0)->sum('tvclick'); //课程总播放量
$course_sum_count = Db::name('course')->where('is_del', 0)->count(); //课程数量
$data['visitors_sum'] = $visitors_sum;
$data['day_visitors'] = $day_visitors;
$data['payment_sum_money'] = $payment_sum_money;
$data['month_sum_money'] = $month_sum_money;
$data['payment_sum_count'] = $payment_sum_count;
$data['month_payment_count'] = $month_payment_count;
$data['user_sum_count'] = $user_sum_count;
$data['user_day_count'] = $user_day_count;
$data['course_sum_tvclick_count'] = $course_sum_tvclick_count;
$data['course_sum_count'] = $course_sum_count;
//统计图
// 如果需要每天的起始和结束时间戳
$recent15DaysRanges = [];
for ($i = 0; $i < 15; $i++) {
$day = Carbon::now()->subDays($i);
$recent15DaysRanges[] = [
'start' => $day->startOfDay()->timestamp,
'end' => $day->endOfDay()->timestamp,
'date' => date('m-d', $day->timestamp)
];
}
$add_user_category = array_column($recent15DaysRanges, 'date');
$add_user_series = [];
foreach ($recent15DaysRanges as $k => $v) {
$map = [];
$map[] = ['reg_time', '>=', $v['start']];
$map[] = ['reg_time', '<=', $v['end']];
$map[] = ['is_del', '=', 0];
$add_user_series[] = Db::name('user')->where($map)->count(); //新增用户量
}
$data['add_user_category'] = $add_user_category ? json_encode($add_user_category) : [];
$data['add_user_series'] = $add_user_series ? json_encode($add_user_series) : [];
//销售金额
$add_payment_category = $add_user_category;
$add_payment_series = [];
foreach ($recent15DaysRanges as $k => $v) {
$map = [];
$map[] = ['pay_time', '>=', $v['start']];
$map[] = ['pay_time', '<=', $v['end']];
$map[] = ['pay_status', '=', 1];
$add_payment_series[] = Db::name('payment')->where($map)->sum('pay_amount'); //销售金额
}
$data['add_payment_category'] = $add_payment_category ? json_encode($add_payment_category) : [];
$data['add_payment_series'] = $add_payment_series ? json_encode($add_payment_series) : [];
$this->assign('data', $data);
return $this->fetch();
}
public function main11111111111()
{
// Queue::push(Jobtask::class, '','coursetask'); // 推送到队列的任务类及其数据参数 // Queue::push(Jobtask::class, '','coursetask'); // 推送到队列的任务类及其数据参数
if($this->request->isPost()){ if ($this->request->isPost()) {
return $this->returnMsg('登录成功!',1); return $this->returnMsg('登录成功!', 1);
} }
$data['type'] = 'imagewt'; $data['type'] = 'imagewt';
$data['name'] = 'headimgwt'; $data['name'] = 'headimgwt';
$this->assign('data',$data); $this->assign('data', $data);
$data2['type'] = 'imageswt'; $data2['type'] = 'imageswt';
$data2['name'] = 'headimgwt2'; $data2['name'] = 'headimgwt2';
$data2['value'] = ''; $data2['value'] = '';
$this->assign('data2',$data2); $this->assign('data2', $data2);
$data3['type'] = 'imageswt'; $data3['type'] = 'imageswt';
$data3['name'] = 'headimgwts2'; $data3['name'] = 'headimgwts2';
$data3['value'] = ''; $data3['value'] = '';
$this->assign('data3',$data3); $this->assign('data3', $data3);
$data4['type'] = 'upfilewt'; $data4['type'] = 'upfilewt';
$data4['name'] = 'filename'; $data4['name'] = 'filename';
$data4['value'] = ''; $data4['value'] = '';
$this->assign('data4',$data4); $this->assign('data4', $data4);
return $this->fetch(); return $this->fetch();
} }
/** /**
* 获取左侧菜单和用户信息 * 获取左侧菜单和用户信息
* @param int $do 是否更新字典缓存0否1是 * @param int $do 是否更新字典缓存0否1是
* @return json * @return json
*/ */
public function json(int $do = 0) public function json(int $do = 0)
{ {
$arr = []; $arr = [];
$cat = Category::catList([['state','=',1],['type','=','01']],0,'title,icon,catid'); // 获取菜单分类 $cat = Category::catList([['state', '=', 1], ['type', '=', '01']], 0, 'title,icon,catid'); // 获取菜单分类
$data = Menus::getMenus(array_intersect_key($this->manUser, ['userid'=>"",'role_menuid'=>""])); // 获取拥有的菜单数据 $data = Menus::getMenus(array_intersect_key($this->manUser, ['userid' => "", 'role_menuid' => ""])); // 获取拥有的菜单数据
$rs =[ $rs = [
'menus' => $cat ? ['cat'=>$cat,'menus'=>$data['menus']]: $data['menus'], 'menus' => $cat ? ['cat' => $cat, 'menus' => $data['menus']] : $data['menus'],
'user' => $this->manUser + ['roles' => $data['roles']] + ['rolem' => \app\model\system\SystemRoles::where("state = 1 AND roleid IN(".$this->manUser['roleids'].")")->column("roleid id,role_name name")] + ['dict' => Dict::cache((int)$do)] 'user' => $this->manUser + ['roles' => $data['roles']] + ['rolem' => \app\model\system\SystemRoles::where("state = 1 AND roleid IN(" . $this->manUser['roleids'] . ")")->column("roleid id,role_name name")] + ['dict' => Dict::cache((int)$do)]
]; ];
unset($rs['user']['password'],$rs['user']['passsalt']); unset($rs['user']['password'], $rs['user']['passsalt']);
return json($rs); return json($rs);
} }
/** /**
* 清空缓存 * 清空缓存
* @return json * @return json
*/ */
public function clear(){ public function clear()
\think\facade\Cache::clear(); {
\think\facade\Cache::clear();
return $this->returnMsg("清理缓存成功!"); return $this->returnMsg("清理缓存成功!");
} }
...@@ -102,9 +208,9 @@ class Index extends AdminBase ...@@ -102,9 +208,9 @@ class Index extends AdminBase
*/ */
public function ip() public function ip()
{ {
$url = 'https://whois.pconline.com.cn/ipJson.jsp?callback='.input('callback').'&ip='.input('ip'); $url = 'https://whois.pconline.com.cn/ipJson.jsp?callback=' . input('callback') . '&ip=' . input('ip');
$cont = trim(file_get_contents($url)); $cont = trim(file_get_contents($url));
$cont = iconv("gb2312","utf-8//IGNORE",$cont); $cont = iconv("gb2312", "utf-8//IGNORE", $cont);
return $cont; return $cont;
} }
......
...@@ -62,6 +62,7 @@ class Course extends AdminBase ...@@ -62,6 +62,7 @@ class Course extends AdminBase
$category = CourseCategoryModel::field('*,pid as parentid')->where('is_del', 0)->order('sort desc')->select()->toArray(); $category = CourseCategoryModel::field('*,pid as parentid')->where('is_del', 0)->order('sort desc')->select()->toArray();
$this->assign('category', json_encode($category)); $this->assign('category', json_encode($category));
$this->assign('limit', $limit); $this->assign('limit', $limit);
$this->assign('get', input());
return $this->fetch('', '', false); return $this->fetch('', '', false);
} }
......
...@@ -19,21 +19,21 @@ ...@@ -19,21 +19,21 @@
<div class="layui-inline" style="width:250px;"><input type="text" name="kw" placeholder="提现单号" autocomplete="off" class="layui-input" lay-affix="clear"/></div> <div class="layui-inline" style="width:250px;"><input type="text" name="kw" placeholder="提现单号" autocomplete="off" class="layui-input" lay-affix="clear"/></div>
<div class="layui-inline" style="width:250px;"><input type="text" name="user" placeholder="用户名,用户手机" autocomplete="off" class="layui-input" lay-affix="clear"/></div> <div class="layui-inline" style="width:250px;"><input type="text" name="user" placeholder="用户名,用户手机" autocomplete="off" class="layui-input" lay-affix="clear"/></div>
<div class="layui-inline" style="width:150px;"> <div class="layui-inline" style="width:150px;">
<select name="sh_status"> <select name="sh_status" id="statusselect-tixian">
<option value="-1">审核状态</option> <option value="-1">审核状态</option>
<option value="0">待审核</option> <option value="0" {php}if(input('sh_status') == 0){echo 'selected';}{/php}>待审核</option>
<option value="1">审核失败</option> <option value="1" {php}if(input('sh_status') == 1){echo 'selected';}{/php}>审核失败</option>
<option value="2">审核通过</option> <option value="2" {php}if(input('sh_status') == 2){echo 'selected';}{/php}>审核通过</option>
</select> </select>
</div> </div>
<div class="layui-inline" style="width:150px;"> <div class="layui-inline" style="width:150px;">
<select name="dk_status"> <select name="dk_status" id="dkstatusselect-tixian">
<option value="-1">打款状态</option> <option value="-1">打款状态</option>
<option value="0">未打款</option> <option value="0" {php}if(input('dk_status') == 0){echo 'selected';}{/php}>未打款</option>
<option value="1">打款中</option> <option value="1" {php}if(input('dk_status') == 1){echo 'selected';}{/php}>打款中</option>
<option value="2">打款失败</option> <option value="2" {php}if(input('dk_status') == 2){echo 'selected';}{/php}>打款失败</option>
<option value="3">已打款</option> <option value="3" {php}if(input('dk_status') == 3){echo 'selected';}{/php}>已打款</option>
</select> </select>
</div> </div>
<div class="layui-inline"> <div class="layui-inline">
...@@ -101,6 +101,8 @@ ...@@ -101,6 +101,8 @@
var layer = layui.layer,table=layui.table,form=layui.form,admin=layui.admin; var layer = layui.layer,table=layui.table,form=layui.form,admin=layui.admin;
var sh_status = $("#statusselect-tixian").val();
var dk_status = $("#dkstatusselect-tixian").val();
/*渲染数据*/ /*渲染数据*/
table.render({ table.render({
elem: '#withdrawal', elem: '#withdrawal',
...@@ -109,6 +111,7 @@ ...@@ -109,6 +111,7 @@
height: 'full-341', height: 'full-341',
// toolbar: 'default', //开启工具栏,此处显示默认图标,可以自定义模板,详见文档 // toolbar: 'default', //开启工具栏,此处显示默认图标,可以自定义模板,详见文档
url: app_root+"index?&do=json", url: app_root+"index?&do=json",
where:{sh_status:sh_status,dk_status:dk_status},
// css: 'td .layui-table-cell{height:80px;line-height:80px;padding:0 5px;}', // css: 'td .layui-table-cell{height:80px;line-height:80px;padding:0 5px;}',
cols: [[ cols: [[
{type:'checkbox',fixed:'left'}, {type:'checkbox',fixed:'left'},
......
...@@ -29,12 +29,12 @@ ...@@ -29,12 +29,12 @@
<div class="layui-inline" style="width:250px;"><input type="text" name="kw" placeholder="课程关键词" autocomplete="off" class="layui-input" lay-affix="clear"/></div> <div class="layui-inline" style="width:250px;"><input type="text" name="kw" placeholder="课程关键词" autocomplete="off" class="layui-input" lay-affix="clear"/></div>
<div class="layui-inline" style="width:150px;"> <div class="layui-inline" style="width:150px;">
<select name="status"> <select name="status" id="statusselect">
<option value="-1">审核状态</option> <option value="-1">审核状态</option>
<option value="0">待提交</option> <option value="0" {php}if(input('status') == 0){echo 'selected';}{/php}>待提交</option>
<option value="1">待审核</option> <option value="1" {php}if(input('status') == 1){echo 'selected';}{/php}>待审核</option>
<option value="2">审核失败</option> <option value="2" {php}if(input('status') == 2){echo 'selected';}{/php}>审核失败</option>
<option value="3">审核成功</option> <option value="3" {php}if(input('status') == 3){echo 'selected';}{/php}>审核成功</option>
</select> </select>
</div> </div>
<div class="layui-inline"> <div class="layui-inline">
...@@ -125,9 +125,8 @@ ...@@ -125,9 +125,8 @@
// load ? item.find('.layui-tree-main>.layui-tree-txt').trigger('click') : item.addClass('organ-tree-click'); // load ? item.find('.layui-tree-main>.layui-tree-txt').trigger('click') : item.addClass('organ-tree-click');
} }
/*初始渲染*/ /*初始渲染*/
/*==============左树结构END==============*/ /*==============左树结构END==============*/
var status = $("#statusselect").val();
/*渲染数据*/ /*渲染数据*/
table.render({ table.render({
elem: '#course', elem: '#course',
...@@ -136,6 +135,7 @@ ...@@ -136,6 +135,7 @@
height: 'full-341', height: 'full-341',
url: app_root+"index?&do=json", url: app_root+"index?&do=json",
// css: 'td .layui-table-cell{height:80px;line-height:80px;padding:0 5px;}', // css: 'td .layui-table-cell{height:80px;line-height:80px;padding:0 5px;}',
where:{status:status},
cols: [[ cols: [[
{type:'checkbox',fixed:'left'}, {type:'checkbox',fixed:'left'},
{field:'id',width:50,unresize:true,align:'center',title:'ID',sort:!0}, {field:'id',width:50,unresize:true,align:'center',title:'ID',sort:!0},
......
...@@ -95,5 +95,6 @@ layui.config({ ...@@ -95,5 +95,6 @@ layui.config({
}); });
}); });
</script> </script>
<script src="https://cdn.jsdelivr.net/npm/echarts@5.6.0/dist/echarts.min.js"></script>
</body> </body>
</html> </html>
\ No newline at end of file
<tpl> <div class="layui-fluid">
<style>
.pull-right2{ margin-top: 10px;}
.console-app-group {
display: block;
padding: 16px;
border-radius: 4px;
text-align: center;
background-color: #fff;
cursor: pointer;
}
.layui-col-md3{ width: 20%;}
</style>
<div class="layui-fluid ew-console-wrapper" >
<div class="layui-row layui-col-space15">
<div class="layui-col-xs6 layui-col-sm2">
<a class="console-app-group" href="#/users.business/index/status=0">
<p class="lay-big-font layui-font-red">{$data.business_dsh_count}</p>
<div class="console-app-name">企业资料待审核</div>
</a>
</div>
<div class="layui-col-xs6 layui-col-sm2">
<a class="console-app-group" href="#/users.school/index/status=0">
<p class="lay-big-font layui-font-red">{$data.school_dsh_count}</p>
<div class="console-app-name">学校资料待审核</div>
</a>
</div>
<div class="layui-col-xs6 layui-col-sm2">
<a class="console-app-group" href="#/course.course/index/status=1">
<p class="lay-big-font layui-font-red">{$data.course_dsh_count}</p>
<div class="console-app-name">课程待审核</div>
</a>
</div>
<div class="layui-col-xs6 layui-col-sm2">
<a class="console-app-group" href="#/project.project/index/sh_status=0">
<p class="lay-big-font layui-font-red">{$data.project_dsh_count}</p>
<div class="console-app-name">项目待审核</div>
</a>
</div>
<div class="layui-col-xs6 layui-col-sm2">
<a class="console-app-group" href="#/caiwu.withdrawal/index/sh_status=0">
<p class="lay-big-font layui-font-red">{$data.tixian_dsh_count}</p>
<div class="console-app-name">提现待审核</div>
</a>
</div>
<div class="layui-col-xs6 layui-col-sm2">
<a class="console-app-group" href="#/caiwu.withdrawal/index/sh_status=2/dk_status=0">
<p class="lay-big-font layui-font-red">{$data.tixian_dk_dsh_count}</p>
<div class="console-app-name">提现待打款</div>
</a>
</div>
</div>
<div class="layui-row layui-col-space15">
<div class="layui-col-xs12 layui-col-sm6 layui-col-md3">
<div class="layui-card">
<div class="layui-card-header">
访问量<span class="layui-badge layui-badge-green pull-right pull-right2"></span>
</div>
<div class="layui-card-body">
<p class="lay-big-font">{$data.day_visitors}</p>
<p>总访问量<span class="pull-right">{$data.visitors_sum}</span></p>
</div>
</div>
</div>
<div class="layui-col-xs12 layui-col-sm6 layui-col-md3">
<div class="layui-card">
<div class="layui-card-header">
销售额<span class="layui-badge layui-badge-blue pull-right pull-right2"></span>
</div>
<div class="layui-card-body">
<p class="lay-big-font"><span style="font-size: 26px;line-height: 1;">¥</span>{$data.month_sum_money}</p>
<p>总销售额<span class="pull-right">{$data.payment_sum_money}</span></p>
</div>
</div>
</div>
<div class="layui-col-xs12 layui-col-sm6 layui-col-md3">
<div class="layui-card">
<div class="layui-card-header">
订单量<span class="layui-badge layui-badge-blue pull-right pull-right2"></span>
</div>
<div class="layui-card-body">
<p class="lay-big-font">{$data.month_payment_count}</p>
<p>总订单量<span class="pull-right">{$data.payment_sum_count}</span></p>
</div>
</div>
</div>
<div class="layui-col-xs12 layui-col-sm6 layui-col-md3">
<div class="layui-card">
<div class="layui-card-header">
新增用户
<span class="layui-badge layui-badge-green pull-right pull-right2"></span>
</div>
<div class="layui-card-body">
<p class="lay-big-font">{$data.user_day_count} <span style="font-size: 24px;line-height: 1;"></span></p>
<p>总用户<span class="pull-right">{$data.user_sum_count} 人</span></p>
</div>
</div>
</div>
<div class="layui-col-xs12 layui-col-sm6 layui-col-md3 ">
<div class="layui-card">
<div class="layui-card-header">
播放量
<span class="layui-badge layui-badge-green pull-right pull-right2"></span>
</div>
<div class="layui-card-body">
<p class="lay-big-font">{$data.course_sum_tvclick_count} <span style="font-size: 24px;line-height: 1;"></span></p>
<p>课程数量<span class="pull-right">{$data.course_sum_count}</span></p>
</div>
</div>
</div>
<div style="clear: both;"></div>
</div>
<div class="layui-row layui-col-space15" >
<div class="layui-col-xs12 layui-col-sm6 ">
<div class="layui-card" style="padding-top: 10px;">
<div id="myChart" style="height:400px; "></div>
</div>
</div>
<div class="layui-col-xs12 layui-col-sm6 ">
<div class="layui-card" style="padding-top: 10px;">
<div id="myChart2" style="height:400px; "></div>
</div>
</div>
<div style="clear: both;"></div>
</div>
</div>
</div>
<script>
var myChart = echarts.init(document.getElementById('myChart'));
option = {
// title : {
// text: '新增用户统计',
// subtext: ''
// },
tooltip : {
trigger: 'axis'
},
legend: {
data:['新增用户']
},
toolbox: {
show : true,
feature : {
mark : {show: true},
dataView : {show: true, readOnly: false},
magicType : {show: true, type: ['line', 'bar']},
restore : {show: true},
saveAsImage : {show: true}
}
},
calculable : true,
xAxis : [
{
type : 'category',
data : {$data.add_user_category|raw}
}
],
yAxis : [
{
type : 'value'
}
],
series : [
{
name:'新增用户',
type:'bar',
data:{$data.add_user_series},
markPoint : {
data : [
{type : 'max', name: '最大值'},
{type : 'min', name: '最小值'}
]
},
markLine : {
data : [
{type : 'average', name: '平均值'}
]
}
}
]
};
myChart.setOption(option);
var myChart2 = echarts.init(document.getElementById('myChart2'));
option = {
// title : {
// text: '销售金额',
// subtext: ''
// },
tooltip : {
trigger: 'axis'
},
legend: {
data:['销售金额']
},
toolbox: {
show : true,
feature : {
mark : {show: true},
dataView : {show: true, readOnly: false},
magicType : {show: true, type: ['line', 'bar']},
restore : {show: true},
saveAsImage : {show: true}
}
},
calculable : true,
xAxis : [
{
type : 'category',
data : {$data.add_payment_category|raw}
}
],
yAxis : [
{
type : 'value'
}
],
series : [
{
name:'销售金额',
type:'bar',
data:{$data.add_payment_series},
markPoint : {
data : [
{type : 'max', name: '最大值'},
{type : 'min', name: '最小值'}
]
},
markLine : {
data : [
{type : 'average', name: '平均值'}
]
}
}
]
};
myChart2.setOption(option);
</script>
</tpl>
\ No newline at end of file
...@@ -30,11 +30,11 @@ ...@@ -30,11 +30,11 @@
<div class="layui-inline" style="width:250px;"><input type="text" name="kw" placeholder="关键词" autocomplete="off" class="layui-input" lay-affix="clear"/></div> <div class="layui-inline" style="width:250px;"><input type="text" name="kw" placeholder="关键词" autocomplete="off" class="layui-input" lay-affix="clear"/></div>
<div class="layui-inline" style="width:250px;"><input type="text" name="user" placeholder="用户名,用户手机" autocomplete="off" class="layui-input" lay-affix="clear"/></div> <div class="layui-inline" style="width:250px;"><input type="text" name="user" placeholder="用户名,用户手机" autocomplete="off" class="layui-input" lay-affix="clear"/></div>
<div class="layui-inline" style="width:150px;"> <div class="layui-inline" style="width:150px;">
<select name="sh_status"> <select name="sh_status" id="statusselect-project">
<option value="">审核状态</option> <option value="">审核状态</option>
<option value="0">审核中</option> <option value="0" {php}if(input('sh_status') == 0){echo 'selected';}{/php}>审核中</option>
<option value="1">审核失败</option> <option value="1" {php}if(input('sh_status') == 1){echo 'selected';}{/php}>审核失败</option>
<option value="2">审核通过</option> <option value="2" {php}if(input('sh_status') == 2){echo 'selected';}{/php}>审核通过</option>
</select> </select>
</div> </div>
...@@ -150,7 +150,7 @@ ...@@ -150,7 +150,7 @@
/*初始渲染*/ /*初始渲染*/
/*==============左树结构END==============*/ /*==============左树结构END==============*/
var sh_status = $("#statusselect-project").val();
/*渲染数据*/ /*渲染数据*/
table.render({ table.render({
elem: '#project', elem: '#project',
...@@ -159,6 +159,7 @@ ...@@ -159,6 +159,7 @@
height: 'full-341', height: 'full-341',
url: app_root+"index?&do=json", url: app_root+"index?&do=json",
// css: 'td .layui-table-cell{height:80px;line-height:80px;padding:0 5px;}', // css: 'td .layui-table-cell{height:80px;line-height:80px;padding:0 5px;}',
where:{sh_status:sh_status},
cols: [[ cols: [[
{type:'checkbox',fixed:'left'}, {type:'checkbox',fixed:'left'},
{field:'id',width:50,unresize:true,align:'center',title:'ID',sort:!0}, {field:'id',width:50,unresize:true,align:'center',title:'ID',sort:!0},
......
...@@ -13,11 +13,11 @@ ...@@ -13,11 +13,11 @@
<div class="layui-inline" style="width:250px;"><input type="text" name="kw" placeholder="用户名,用户手机号" autocomplete="off" class="layui-input" lay-affix="clear"/></div> <div class="layui-inline" style="width:250px;"><input type="text" name="kw" placeholder="用户名,用户手机号" autocomplete="off" class="layui-input" lay-affix="clear"/></div>
<div class="layui-inline" style="width:250px;"><input type="text" name="business" placeholder="学校名称" autocomplete="off" class="layui-input" lay-affix="clear"/></div> <div class="layui-inline" style="width:250px;"><input type="text" name="business" placeholder="学校名称" autocomplete="off" class="layui-input" lay-affix="clear"/></div>
<div class="layui-inline" style="width:150px;"> <div class="layui-inline" style="width:150px;">
<select name="status"> <select name="status" id="statusselect-business">
<option value="-1">审核状态</option> <option value="-1">审核状态</option>
<option value="1">审核通过</option> <option value="1" {php}if(input('status') == 1){echo 'selected';}{/php}>审核通过</option>
<option value="2">审核失败</option> <option value="2" {php}if(input('status') == 2){echo 'selected';}{/php}>审核失败</option>
<option value="0">待审核</option> <option value="0" {php}if(input('status') == 0){echo 'selected';}{/php}>待审核</option>
</select> </select>
</div> </div>
...@@ -76,13 +76,14 @@ ...@@ -76,13 +76,14 @@
var layer = layui.layer,table=layui.table,form=layui.form,admin=layui.admin; var layer = layui.layer,table=layui.table,form=layui.form,admin=layui.admin;
var dropdown = layui.dropdown; var dropdown = layui.dropdown;
/*初始渲染*/ /*初始渲染*/
var status = $("#statusselect-business").val();
table.render({ table.render({
elem: '#business', elem: '#business',
page: true, page: true,
limit:{$limit}, limit:{$limit},
height: 'full-341', height: 'full-341',
url: app_root+"index?&do=json", url: app_root+"index?&do=json",
where:{status:status},
cols: [[ cols: [[
{type:'checkbox',fixed:'left'}, {type:'checkbox',fixed:'left'},
{field:'id',width:50,unresize:true,align:'center',title:'ID',sort:!0}, {field:'id',width:50,unresize:true,align:'center',title:'ID',sort:!0},
......
...@@ -13,11 +13,11 @@ ...@@ -13,11 +13,11 @@
<div class="layui-inline" style="width:250px;"><input type="text" name="kw" placeholder="用户名,用户手机号" autocomplete="off" class="layui-input" lay-affix="clear"/></div> <div class="layui-inline" style="width:250px;"><input type="text" name="kw" placeholder="用户名,用户手机号" autocomplete="off" class="layui-input" lay-affix="clear"/></div>
<div class="layui-inline" style="width:250px;"><input type="text" name="school" placeholder="学校名称" autocomplete="off" class="layui-input" lay-affix="clear"/></div> <div class="layui-inline" style="width:250px;"><input type="text" name="school" placeholder="学校名称" autocomplete="off" class="layui-input" lay-affix="clear"/></div>
<div class="layui-inline" style="width:150px;"> <div class="layui-inline" style="width:150px;">
<select name="status"> <select name="status" id="statusselect-school">
<option value="-1">审核状态</option> <option value="-1">审核状态</option>
<option value="1">审核通过</option> <option value="1" {php}if(input('status') == 1){echo 'selected';}{/php}>审核通过</option>
<option value="2">审核失败</option> <option value="2" {php}if(input('status') == 2){echo 'selected';}{/php}>审核失败</option>
<option value="0">待审核</option> <option value="0" {php}if(input('status') == 0){echo 'selected';}{/php}>待审核</option>
</select> </select>
</div> </div>
...@@ -80,7 +80,7 @@ ...@@ -80,7 +80,7 @@
/*渲染数据*/ /*渲染数据*/
var status = $("#statusselect-school").val();
table.render({ table.render({
elem: '#school', elem: '#school',
...@@ -88,6 +88,7 @@ ...@@ -88,6 +88,7 @@
limit:{$limit}, limit:{$limit},
height: 'full-341', height: 'full-341',
url: app_root+"index?&do=json", url: app_root+"index?&do=json",
where:{status:status},
cols: [[ cols: [[
{type:'checkbox',fixed:'left'}, {type:'checkbox',fixed:'left'},
{field:'id',width:50,unresize:true,align:'center',title:'ID',sort:!0}, {field:'id',width:50,unresize:true,align:'center',title:'ID',sort:!0},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment