Commit e4b0da60 authored by wangtao's avatar wangtao

增加课程列表,上传接口

parent 22e405d0
......@@ -28,9 +28,7 @@ class Article extends AdminBase
public function __construct(App $app)
{
parent::__construct($app);
$this->article = new ArticleModel();
}
//文章列表
......
<?php
/**
* ===========================================================================
* Veitool 快捷开发框架系统
* Author: Niaho 26843818@qq.com
* Copyright (c)2019-2025 www.veitool.com All rights reserved.
* Licensed: 这不是一个自由软件,不允许对程序代码以任何形式任何目的的再发行
* ---------------------------------------------------------------------------
*/
namespace app\admin\controller\cert;
use app\admin\controller\AdminBase;
use app\admin\validate\CertValidate;
use app\model\Cert as CertModel;
use think\App;
use think\facade\Db;
use app\model\CertCategory;
/**
* 后台主控制器
*/
class Cert extends AdminBase
{
protected $cert;
public function __construct(App $app)
{
parent::__construct($app);
$this->cert = new CertModel();
}
// 列表
public function index(string $do = '')
{
$limit = 10;
if ($do == 'json') {
$post = input();
$post['limit'] = isset($post['limit']) ? $post['limit'] : $limit;
$map[] = ['is_del', '=', 0];
if (isset($post['kw']) && !empty($post['kw'])) {
$map[] = ['title', 'like', '%' . $post['kw'] . '%'];
}
if (isset($post['cate_id']) && !empty($post['cate_id'])) {
$map[] = ['cate_id', '=', $post['cate_id']];
}
$list = $this->cert->where($map)->with(['certcatedata'])->append(['thumbpath','starttimetxt','endtimetxt'])->order('createtime desc')->paginate($post['limit']);
return $this->returnMsg($list);
}
$category = CertCategory::field('*,pid as parentid')->where('is_del', 0)->order('sort desc')->select()->toArray();
$this->assign('category', json_encode($category));
$this->assign('limit', $limit);
return $this->fetch('', '', false);
}
//快速编辑
public function editup()
{
$post = input();
$result = $this->cert->update([$post['af'] => $post['av']], [['id', '=', $post['id']]]);
if($result){
return $this->returnMsg('修改成功',1);
}else{
return $this->returnMsg('修改成功');
}
}
public function del()
{
$post = input();
$ids = is_array($post['id']) ? implode(',', $post['id']) : $post['id'];
if ($this->cert->where("id IN(" . $ids . ")")->update(['is_del' => 1])) {
$cert_id_arr = $this->cert->where("id IN(" . $ids . ")")->column('id');
$cert_id_arr = array_unique($cert_id_arr);
foreach ($cert_id_arr as $cert_id) {
event('cert', ['cert_id' => $cert_id, 'tasktype' => 'cert', 'action' => 'shcertupdate']);
}
return $this->returnMsg("删除成功", 1);
} else {
return $this->returnMsg("删除失败");
}
}
//编辑新增
public function edit()
{
$post = input();
if ($this->request->isPost()) {
$check = (new CertValidate())->goCheck();
if ($check !== true) {
return $check;
}
try {
if ($post['id'] > 0) {
$msg = '更新成功';
$this->cert->update($post, ['id' => $post['id']]);
} else {
$post['createtime'] = time();
unset($post['id']);
$msg = '添加成功';
$this->cert->save($post);
}
} catch (\Exception $e) {
return $this->returnMsg($e->getMessage(), 0);
}
return $this->returnMsg($msg, 1);
}
$data = $this->cert->append(['starttimetxt','endtimetxt'])->where('id',$post['id'])->find();
$catemodel = new CertCategory();
$categorydata = $catemodel->catetree(isset($data['cate_id']) ? $data['cate_id'] : 0);
$this->assign('categorydata', $categorydata);
$this->assign('data', $data);
return $this->fetch('', '', false);
}
//详情
public function detail()
{
$post = input();
$info = $this->cert->where('id', $post['id'])->find();
$this->assign('info', $info);
return $this->fetch('', '', false);
}
}
\ No newline at end of file
<?php
/**
* ===========================================================================
* Veitool 快捷开发框架系统
* Author: Niaho 26843818@qq.com
* Copyright (c)2019-2025 www.veitool.com All rights reserved.
* Licensed: 这不是一个自由软件,不允许对程序代码以任何形式任何目的的再发行
* ---------------------------------------------------------------------------
*/
namespace app\admin\controller\cert;
use app\admin\controller\AdminBase;
use app\model\CertCategory as CertCategoryModel;
use think\App;
use think\facade\Db;
use think\facade\Validate;
use think\facade\Env;
/**
* 后台主控制器
*/
class CertCategory extends AdminBase
{
protected $certcategory;
public function __construct(App $app)
{
parent::__construct($app);
$this->certcategory = new CertCategoryModel();
}
//分类列表
public function index(string $do = '')
{
if ($do == 'json') {
$list = $this->certcategory->where('is_del', 0)->select()->toArray();
return $this->returnMsg($list);
}
return $this->fetch('', '', false);
}
//快速编辑
public function editup()
{
$post = input();
$this->certcategory->update([$post['af'] => $post['av']], [['id', '=', $post['id']]]);
return $this->returnMsg('修改成功');
}
//编辑新增分类
public function edit()
{
$post = input();
if ($this->request->isPost()) {
$validate = Validate::rule([
'title' => 'require'
])->message([
'title.require' => '分类名称不能为空',
]);
if(!$validate->check($post)) {
return $this->returnMsg($validate->getError(), 0);
}
try {
if ($post['id'] > 0) {
$msg = '更新成功';
$this->certcategory->update($post, ['id' => $post['id']]);
} else {
unset($post['id']);
$post['createtime'] = time();
$msg = '添加成功';
$this->certcategory->save($post);
}
} catch (\Exception $e) {
return $this->returnMsg($e->getMessage(), 0);
}
return $this->returnMsg($msg, 1);
}
$data = Db::name('cert_category')->where('id',$post['id'])->find();
$categorydata = $this->certcategory->catetree(isset($data['pid']) ? $data['pid'] : 0);
$this->assign('categorydata', $categorydata);
$this->assign('data', $data);
return $this->fetch('', '', false);
}
public function del()
{
$post = input();
$ids = is_array($post['id']) ? implode(',', $post['id']) : $post['id'];
if ($this->certcategory->where("id IN(" . $ids . ")")->update(['is_del' => 1])) {
return $this->returnMsg("删除成功", 1);
} else {
return $this->returnMsg("删除失败");
}
}
}
\ No newline at end of file
<?php
/**
* ===========================================================================
* Veitool 快捷开发框架系统
* Author: Niaho 26843818@qq.com
* Copyright (c)2019-2025 www.veitool.com All rights reserved.
* Licensed: 这不是一个自由软件,不允许对程序代码以任何形式任何目的的再发行
* ---------------------------------------------------------------------------
*/
namespace app\admin\controller\cert;
use app\admin\controller\AdminBase;
use app\model\CertOrder as CertOrderModel;
use think\App;
/**
* 后台主控制器
*/
class CertOrder extends AdminBase
{
protected $certorder;
public function __construct(App $app)
{
parent::__construct($app);
$this->certorder = new CertOrderModel();
}
// 列表
public function index(string $do = '')
{
$limit = 10;
if ($do == 'json') {
$post = input();
$post['limit'] = isset($post['limit']) ? $post['limit'] : $limit;
$map[] = ['is_del', '=', 0];
$map[] = ['status', '>', 0];
if (isset($post['kw']) && !empty($post['kw'])) {
$map[] = ['title', 'like', '%' . $post['kw'] . '%'];
}
if (isset($post['cate_id']) && !empty($post['cate_id'])) {
$map[] = ['cate_id', '=', $post['cate_id']];
}
$list = $this->certorder->where($map)->with(['certdata','userprofile'])->order('createtime desc')->paginate($post['limit']);
return $this->returnMsg($list);
}
$this->assign('limit', $limit);
return $this->fetch('', '', false);
}
//快速编辑
public function editup()
{
$post = input();
$result = $this->certorder->update([$post['af'] => $post['av']], [['id', '=', $post['id']]]);
if($result){
return $this->returnMsg('修改成功',1);
}else{
return $this->returnMsg('修改成功');
}
}
public function del()
{
$post = input();
$ids = is_array($post['id']) ? implode(',', $post['id']) : $post['id'];
if ($this->certorder->where("id IN(" . $ids . ")")->update(['is_del' => 1])) {
$cert_id_arr = $this->certorder->where("id IN(" . $ids . ")")->column('id');
$cert_id_arr = array_unique($cert_id_arr);
foreach ($cert_id_arr as $cert_id) {
event('cert', ['cert_id' => $cert_id, 'tasktype' => 'cert', 'action' => 'shcertupdate']);
}
return $this->returnMsg("删除成功", 1);
} else {
return $this->returnMsg("删除失败");
}
}
//详情
public function detail()
{
$post = input();
$info = $this->certorder->where('id', $post['id'])->find();
$this->assign('info', $info);
return $this->fetch('', '', false);
}
}
\ No newline at end of file
<?php
namespace app\admin\controller\users;
use app\admin\controller\AdminBase;
use app\model\project\Business as BusinessModel;
use think\App;
class Business extends AdminBase
{
protected $business;
public function __construct(App $app)
{
parent::__construct($app);
$this->business = new BusinessModel();
}
//会员列表
public function index(string $do = '')
{
$limit = 10;
if ($do == 'json') {
$post = input();
$post['limit'] = isset($post['limit']) ? $post['limit'] : $limit;
$hasmap[] = ['is_del', '=', 0];
$map = [];
if (isset($post['kw']) && !empty($post['kw'])) {
$hasmap[] = ['username|mobile', 'like', '%' . $post['kw'] . '%'];
}
if (isset($post['business']) && !empty($post['business'])) {
$map[] = ['name', 'like', '%' . $post['business'] . '%'];
}
if (isset($post['status']) && $post['status'] > -1) {
$map[] = ['business.status', '=', $post['status']];
}
$list = $this->business->hasWhere('getuserdata', $hasmap)->where($map)->with(['getuserdata'])->append(['addressxx', 'status_text'])->paginate($post['limit']);
return $this->returnMsg($list);
}
$this->assign('limit', $limit);
$this->assign('get', input());
return $this->fetch('', '', false);
}
//快速编辑
public function editup()
{
$post = input();
$result = $this->business->update([$post['af'] => $post['av']], [['id', '=', $post['id']]]);
if ($result) {
return $this->returnMsg('修改成功', 1);
} else {
return $this->returnMsg('修改失败');
}
}
//详情
public function detail()
{
$post = input();
$info = $this->business->with(['businessQualification', 'businessIndustry', 'businessPorject', 'businessMore', 'businessLogo'])->where('id', $post['id'])->find();
$this->assign('info', $info);
return $this->fetch('', '', false);
}
public function del()
{
$post = input();
$ids = is_array($post['id']) ? implode(',', $post['id']) : $post['id'];
if ($this->business->where("id IN(" . $ids . ")")->update(['is_del' => 1])) {
return $this->returnMsg("删除成功", 1);
} else {
return $this->returnMsg("删除失败");
}
}
//审核资料
public function shenhebusiness()
{
$post = input();
$errordesc = '';
$shstatus = 1;
if ($post['shstatus'] == 2) {
if (empty($post['errordesc'])) {
return $this->returnMsg("请输入失败原因");
}
$errordesc = $post['errordesc'];
$shstatus = 2;
}
$updatedata['status'] = $shstatus;
$updatedata['process_time'] = time();
$updatedata['status_desc'] = $errordesc;
$result = $this->business->where('id', $post['id'])->update($updatedata);
if ($result) {
return $this->returnMsg("操作成功", 1);
} else {
return $this->returnMsg("操作失败");
}
}
}
\ No newline at end of file
<?php
namespace app\admin\controller\users;
use app\admin\controller\AdminBase;
use app\model\project\School as SchoolModel;
use think\App;
class School extends AdminBase
{
protected $school;
public function __construct(App $app)
{
parent::__construct($app);
$this->school = new SchoolModel();
}
//会员列表
public function index(string $do = '')
{
$limit = 10;
if ($do == 'json') {
$post = input();
$post['limit'] = isset($post['limit']) ? $post['limit'] : $limit;
$hasmap[] = ['is_del', '=', 0];
$map = [];
if (isset($post['kw']) && !empty($post['kw'])) {
$hasmap[] = ['username|mobile', 'like', '%' . $post['kw'] . '%'];
}
if (isset($post['school']) && !empty($post['school'])) {
$map[] = ['name', 'like', '%' . $post['school'] . '%'];
}
if (isset($post['status']) && $post['status'] > -1) {
$map[] = ['school.status', '=', $post['status']];
}
$list = $this->school->hasWhere('getuserdata',$hasmap)->where($map)->with(['getuserdata'])->append(['addressxx','status_text'])->paginate($post['limit']);
return $this->returnMsg($list);
}
$this->assign('limit', $limit);
$this->assign('get', input());
return $this->fetch('', '', false);
}
//快速编辑
public function editup()
{
$post = input();
$result = $this->school->update([$post['af'] => $post['av']], [['id', '=', $post['id']]]);
if ($result) {
return $this->returnMsg('修改成功', 1);
} else {
return $this->returnMsg('修改失败');
}
}
//详情
public function detail()
{
$post = input();
$info = $this->school->with(['schoolQualification','teacherQualification','agreement','moreFile'])->where('id', $post['id'])->find();
$this->assign('info', $info);
return $this->fetch('', '', false);
}
public function del()
{
$post = input();
$ids = is_array($post['id']) ? implode(',', $post['id']) : $post['id'];
if ($this->school->where("id IN(" . $ids . ")")->update(['is_del' => 1])) {
return $this->returnMsg("删除成功", 1);
} else {
return $this->returnMsg("删除失败");
}
}
//审核资料
public function shenheschool()
{
$post = input();
$errordesc = '';
$shstatus = 1;
if ($post['shstatus'] == 2) {
if (empty($post['errordesc'])) {
return $this->returnMsg("请输入失败原因");
}
$errordesc = $post['errordesc'];
$shstatus = 2;
}
$updatedata['status'] = $shstatus;
$updatedata['process_time'] = time();
$updatedata['status_desc'] = $errordesc;
$result = $this->school->where('id', $post['id'])->update($updatedata);
if ($result) {
return $this->returnMsg("操作成功", 1);
} else {
return $this->returnMsg("操作失败");
}
}
}
\ No newline at end of file
<?php
namespace app\admin\controller\users;
use app\admin\controller\AdminBase;
use app\model\project\UserSmrz;
use think\App;
class Smrz extends AdminBase
{
protected $smrz;
public function __construct(App $app)
{
parent::__construct($app);
$this->smrz = new UserSmrz();
}
//列表
public function index(string $do = '')
{
$limit = 10;
if ($do == 'json') {
$post = input();
$post['limit'] = isset($post['limit']) ? $post['limit'] : $limit;
$hasmap[] = ['is_del', '=', 0];
$map[] = ['user_smrz.is_del', '=', 0];
if (isset($post['kw']) && !empty($post['kw'])) {
$hasmap[] = ['username|mobile', 'like', '%' . $post['kw'] . '%'];
}
if (isset($post['status']) && $post['status'] > -1) {
$map[] = ['user_smrz.status', '=', $post['status']];
}
$list = $this->smrz->hasWhere('getuserdata',$hasmap)->where($map)->with(['getuserdata'])->append(['status_text','idcard_qurl','idcard_hurl'])->paginate($post['limit']);
return $this->returnMsg($list);
}
$this->assign('limit', $limit);
$this->assign('get', input());
return $this->fetch('', '', false);
}
//快速编辑
public function editup()
{
$post = input();
$result = $this->smrz->update([$post['af'] => $post['av']], [['id', '=', $post['id']]]);
if ($result) {
return $this->returnMsg('修改成功', 1);
} else {
return $this->returnMsg('修改失败');
}
}
//详情
public function detail()
{
$post = input();
$info = $this->smrz->with(['smrzQualification','teacherQualification','agreement','moreFile'])->where('id', $post['id'])->find();
$this->assign('info', $info);
return $this->fetch('', '', false);
}
public function del()
{
$post = input();
$ids = is_array($post['id']) ? implode(',', $post['id']) : $post['id'];
if ($this->smrz->where("id IN(" . $ids . ")")->update(['is_del' => 1])) {
return $this->returnMsg("删除成功", 1);
} else {
return $this->returnMsg("删除失败");
}
}
//审核资料
public function shenhesmrz()
{
$post = input();
$errordesc = '';
$shstatus = 2;
if ($post['shstatus'] == 2) {
if (empty($post['errordesc'])) {
return $this->returnMsg("请输入失败原因");
}
$errordesc = $post['errordesc'];
$shstatus = 1;
}
$updatedata['status'] = $shstatus;
$updatedata['status_desc'] = $errordesc;
$result = $this->smrz->where('id', $post['id'])->update($updatedata);
if ($result) {
return $this->returnMsg("操作成功", 1);
} else {
return $this->returnMsg("操作失败");
}
}
}
\ No newline at end of file
<?php
namespace app\admin\controller;
namespace app\admin\controller\users;
use think\App;
use app\admin\controller\AdminBase;
use app\model\project\User as UserModel;
use app\model\project\UserSmrz;
use think\App;
class User extends AdminBase
{
......@@ -29,7 +31,7 @@ class User extends AdminBase
$map[] = ['username|mobile|realname', 'like', '%' . $post['kw'] . '%'];
}
$list = $this->user->where($map)->append(['headericourl','sexdata','roletxt'])->paginate($post['limit']);
$list = $this->user->where($map)->append(['headericourl', 'sexdata', 'roletxt'])->paginate($post['limit']);
return $this->returnMsg($list);
}
......@@ -49,12 +51,15 @@ class User extends AdminBase
return $this->returnMsg('修改失败');
}
}
//会员详情
public function detail()
{
$post = input();
$info = $this->user->where('id', $post['id'])->find();
$smrzinfo = UserSmrz::where(['user_id' => $post['id'], 'status' => 2])->find();
$this->assign('info', $info);
$this->assign('smrzinfo', $smrzinfo);
return $this->fetch('', '', false);
}
......@@ -70,5 +75,20 @@ class User extends AdminBase
}
}
//重置密码
public function resetpwd()
{
$post = input();
$user = $this->user->find($post['id']);
$pwd = md5('123456' . $user['salt']);
$result = $this->user->where('id', $post['id'])->update(['password' => $pwd]);
if ($result) {
return $this->returnMsg("成功", 1);
} else {
return $this->returnMsg("失败");
}
}
}
\ No newline at end of file
<?php
namespace app\admin\validate;
use think\Validate;
use app\model;
use app\api\validate\BaseValidate;
class CertValidate extends BaseValidate
{
protected $rule = [
'title' => 'require',
'cate_id' => 'require',
'thumb_id' => 'require',
'description' => 'require',
'price' => 'require|between:0.01,999999.99',
'start_time' => 'require',
'end_time' => 'require',
'content' => 'require',
];
protected $message = [
'title.require' => '文章标题不能为空',
'cate_id.require' => '请选择分类',
'thumb_id.require' => '请上传图片',
'description.require' => '请输入证书简介',
'price.require' => '请输入价格',
'price.between' => '价格格式不对',
'start_time.require' => '请输入报名开始时间',
'end_time.require' => '请输入报名结束时间',
'content.require' => '请输入内容',
];
}
\ No newline at end of file
{extend name="base/header" /}
{block name="body"}
<style>
.layui-table .widthtd{ width: 120px;}
</style>
<div style="margin: 0px 10px">
<table class="layui-table">
<tbody>
<tr>
<td class="widthtd"><strong>课程名称</strong></td>
<td>{$info.title}</td>
<td class="widthtd"><strong>课程分类</strong></td>
<td>{$info.cate_name}</td>
</tr>
<tr>
<td class="widthtd"><strong>发布者</strong></td>
<td>{$info.user_info.username}</td>
<td class="widthtd"><strong>发布时间</strong></td>
<td>{$info.createtime}</td>
</tr>
<tr>
<td class="widthtd"><strong>价格</strong></td>
<td>{$info.price}</td>
<td class="widthtd"><strong>讲师</strong></td>
<td>{$info.teacher_name}</td>
</tr>
<tr>
<td class="widthtd"><strong>标签</strong></td>
<td>{$info.tag_title}</td>
<td class="widthtd"><strong>上架状态</strong></td>
<td>{$info.is_sell_text}</td>
</tr>
<tr>
<td class="widthtd"><strong>浏览量</strong></td>
<td>{$info.click}</td>
<td class="widthtd"><strong>播放量</strong></td>
<td>{$info.tvclick}</td>
</tr>
<tr>
<td class="widthtd"><strong>封面图</strong></td>
<td><img width="50" height="50" src="{$info.thumbpath}" class="imgclick" /></td>
<td class="widthtd"><strong>详情图</strong></td>
<td><img width="50" height="50" src="{$info.thumbpath}" class="imgclick"/></td>
</tr>
<tr>
<td class="widthtd"><strong>审核状态</strong></td>
<td colspan="4">
{if $info.status == 2}
{$info.status_text} - {$info.sh_error_desc}
{else /}
{$info.status_text}
{/if}
</td>
</tr>
</tbody>
</table>
<div class="layui-tab layui-tab-card" lay-filter="demotest">
<ul class="layui-tab-title">
<li class="layui-this">课程内容</li>
<li>课时列表</li>
<li>章节列表</li>
<li>作业列表</li>
</ul>
<div class="layui-tab-content" >
<div class="layui-tab-item layui-show">
<div style="width: 95%; margin: 10px auto;">
{$info.content}
</div>
</div>
<div class="layui-tab-item">
<div class="layui-card-body" style=" padding: 0px 10px !important; ">
<div class="layui-card-box" >
<table lay-filter="courseclasstwo" id="courseclasstwo"></table>
</div>
</div>
</div>
<div class="layui-tab-item">
<div class="layui-card-body" style=" padding: 0px 10px !important; ">
<div class="layui-card-box" style="width: 950px;">
<table lay-filter="courseclasscategory" id="courseclasscategory"></table>
</div>
</div>
</div>
<div class="layui-tab-item">
<div class="layui-card-body" style=" padding: 0px 10px !important; ">
<div class="layui-card-box" style="width: 950px;">
<table lay-filter="coursework" id="coursework"></table>
</div>
</div>
</div>
</div>
</div>
</div>
{/block}
{block name="script"}
<script type="text/javascript">
var course_id = "{$info.id}";
layui.use(['buildItems', 'form', 'laydate', 'util','vinfo','element'], function () {
var layer = layui.layer,table=layui.table,form=layui.form,admin=layui.admin;
var element = layui.element;
/*解析顶部分组选项*/
var map_root = layui.cache.maps;
//章节列表
table.render({
elem: '#courseclasscategory',
page: true,
limit:20,
height: 'full-341',
url: map_root+"/course.course_class_category/index?&do=json",
where:{course_id:course_id},
cols: [[
{field:'id',width:50,align:'center',title:'ID',sort:!0},
{field:'title',align:'center',title:'章节名称'},
{field:'username',width:120,align:'center',title:'发布者',templet:'<div>{{d.user_info.username}}</div>'},
{field:'createtime',width:160,align:'center',title:'创建时间'},
]],
});
table.render({
elem: '#courseclasstwo',
page: true,
limit:20,
height: 'full-341',
url: map_root+"course.course_class/index?&do=json",
where:{course_id:course_id},
cols: [[
{field:'id',width:50,align:'center',title:'ID',sort:!0},
{field:'title',width:200,align:'center',title:'课时名称'},
{field:'course_class_cate',width:200,align:'center',title:'所属章节'},
{field:'course_title', width:200, align:'center',title:'所属课程'},
{field:'username',width:120,align:'center',title:'发布者',templet:'<div>{{d.user_info.username}}</div>'},
{field:'createtime',width:120,align:'center',title:'创建时间'},
{field:'issktext',width:120,align:'center',title:'是否试看'},
{fixed:'right',width:130,align:'center',toolbar:'<div><a class="layui-btn layui-btn-xs" lay-event="clicktv">查看视频</a></div>',title:'操作'}
]],
done: function(){
admin.vShow($('[lay-table-id="courseclasstwo"]'));
}
});
table.render({
elem: '#coursework',
page: true,
limit:20,
height: 'full-341',
url: map_root+"course.course_work/index?&do=json",
where:{course_id:course_id},
cols: [[
{field:'id',width:50,unresize:true,align:'center',title:'ID',sort:!0},
{field:'title',align:'center',title:'作业标题'},
{field:'course_title',align:'center',title:'所属课程'},
{field:'username',width:120,align:'center',title:'发布者',templet:'<div>{{d.user_info.username}}</div>'},
{field:'createtime',width:160,align:'center',title:'创建时间'},
{fixed:'right',width:130,align:'center',toolbar:'<div><a class="layui-btn layui-btn-xs" lay-event="workdetail">详情</a></div>',title:'操作'}
]],
done: function(){ admin.vShow($('[lay-table-id="coursework"]'));
}
});
//一些事件
element.on('tab(demotest)', function(data){
console.log(data);
if(data.index === 1){
table.reloadData('courseclasstwo');
}
});
/*工具条监听*/
table.on('tool(courseclasstwo)', function(obj){
var data = obj.data;
if(obj.event === 'clicktv'){
// 在此处输入 layer 的任意代码
layer.open({
type: 1, // page 层类型
area: ['500px', '450px'],
title: data.title,
shade: 0.6, // 遮罩透明度
shadeClose: true, // 点击遮罩区域,关闭弹层
maxmin: true, // 允许全屏最小化
anim: 0, // 0-6 的动画形式,-1 不开启
content: '<div style="text-align: center;"><video width="480" controls autoplay>\n' +
' <source src="'+data.tvfilepath+'" type="video/mp4">\n' +
'</video></div>'
});
}else if(obj.event === 'workdetail'){
alert(32);
courseOpen(data.id);
}
});/**/
/*工具条监听*/
table.on('tool(coursework)', function(obj){
var data = obj.data;
if(obj.event === 'workdetail'){
courseOpen(data.id);
}
});/**/
});
$(".imgclick").click(function (){
var src = $(this).attr('src'), alt = $(this).attr('alt');
layer.photos({photos:{data:[{alt:alt,src:src}],start:'0'},anim:5,shade:[0.4,'#000']});
});
/*弹出窗*/
function courseOpen(id='',type=''){
layer.open({
type: 2,
area: ['800px', '600px'],
title: "作业详情",
btn: ['确定', '关闭'],
fixed: false, //不固定
content: '/admin/course.course_work/detail?id='+id,
yes: function(index, layero){
layer.close(index); // 关闭弹窗
},
});
}/**/
var callbackdata = function () {
};
</script>
{/block}
\ No newline at end of file
{extend name="base/header" /}
{block name="body"}
<div style="margin: 0px 10px">
<form class="layui-form " style="margin-top: 20px;" id="fjfrom">
<div class="layui-form-item">
<label class="layui-form-label"> 选择分类 </label>
<div class="layui-input-block">
<select name="cate_id">
<option value="">请选择分类</option>
{:$categorydata}
</select>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">证书标题</label>
<div class="layui-input-block">
<input type="text" name="title" placeholder="证书标题" autocomplete="off" class="layui-input" value="{$data.title|default=''}">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">证书简介</label>
<div class="layui-input-block">
<textarea placeholder="请输入证书简介" name="description" class="layui-textarea">{$data.description|default=''}</textarea>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">证书图片</label>
<div class="layui-input-block" id="thumb_id">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">价格</label>
<div class="layui-input-block">
<input type="text" name="price" placeholder="请输入价格" autocomplete="off" class="layui-input"
value="{$data.price|default=''}">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">时间</label>
<div class="layui-input-inline">
<input type="text" name="start_time" id="start_time" placeholder="报名开始时间" autocomplete="off" class="layui-input"
value="{$data.start_time|date='Y-m-d'}">
</div>
<div class="layui-input-inline">
<input type="text" name="end_time" id="end_time" placeholder="报名结束时间" autocomplete="off" class="layui-input"
value="{$data.end_time|date='Y-m-d'}">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">适合人群</label>
<div class="layui-input-block">
<input type="text" name="shrq" placeholder="请输入适合人群" autocomplete="off" class="layui-input"
value="{$data.shrq|default=''}">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">发证机构</label>
<div class="layui-input-block">
<input type="text" name="fzjg" placeholder="请输入发证机构" autocomplete="off" class="layui-input"
value="{$data.fzjg|default=''}">
</div>
</div>
<div id="contentup">
</div>
<input type="hidden" name="id" value="{$data.id|default=0}">
</form>
</div>
{/block}
{block name="script"}
<script type="text/javascript">
layui.use(['buildItems', 'form', 'laydate', 'util'], function () {
var form = layui.form;
var laydate = layui.laydate;
// 渲染
laydate.render({
elem: '#start_time'
});
laydate.render({
elem: '#end_time'
});
/*解析顶部分组选项*/
var str = [{
"name": "thumb_id",
"title": "上传图片",
"value": "{$data.thumb_id|default=''|get_upload_file}",
"pathid": "{$data.thumb_id|default=''}",
"type": "imagewt"
}];
layui.buildItems.build({
fjbid:'fjfrom',
bid: 'thumb_id',
url: '',
map: layui.cache.maps + 'system.upload/',
gid: 1,
data: str
});
var str = [{
"name": "content",
"title": "文章内容",
"value": "{$data.content|default=''}",
"type": "ueditor",
"style": "height:500px",
}];
layui.buildItems.build({
fjbid:'fjfrom',
bid: 'contentup',
url: '',
map: layui.cache.maps + 'system.upload/',
gid: 1,
data: str
});
layui.buildItems.init();
form.render();
});
var callbackdata = function () {
var data = $(".layui-form").serialize();
return data;
};
</script>
{/block}
\ No newline at end of file
This diff is collapsed.
{extend name="base/header" /}
{block name="body"}
<div style="margin: 0px 10px">
<form class="layui-form " style="margin-top: 20px;" id="fjfrom">
<div class="layui-form-item">
<label class="layui-form-label"> 上级分类 </label>
<div class="layui-input-block">
<select name="pid">
<option value="">请选择分类</option>
{:$categorydata}
</select>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">分类名称</label>
<div class="layui-input-block">
<input type="text" name="title" placeholder="请输入分类名称" autocomplete="off" class="layui-input" value="{$data.title|default=''}">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">分类图片</label>
<div class="layui-input-block" id="thumbup">
</div>
</div>
<input type="hidden" name="id" value="{$data.id|default=0}">
</form>
</div>
{/block}
{block name="script"}
<script type="text/javascript">
layui.use(['buildItems', 'form', 'laydate', 'util'], function () {
var form = layui.form;
/*解析顶部分组选项*/
var str = [{
"name": "thumb",
"title": "上传图片",
"value": "{$data.thumb|default=''|get_upload_file}",
"pathid": "{$data.thumb|default=''}",
"type": "imagewt"
}];
layui.buildItems.build({
fjbid:'fjfrom',
bid: 'thumbup',
url: '',
map: layui.cache.maps + 'system.upload/',
gid: 1,
data: str
});
layui.buildItems.init();
form.render();
});
var callbackdata = function () {
var data = $(".layui-form").serialize();
return data;
};
</script>
{/block}
\ No newline at end of file
<div class="layui-fluid">
<style>
.files_itemw1{width:30px;height:30px;line-height:30px;cursor:pointer;padding:1px;background:#fff;display:-webkit-box;-moz-box-align:center;-webkit-box-align:center;-moz-box-pack:center;-webkit-box-pack:center;}
.files_itemw1 img{max-width:28px;max-height:28px;border:0}
</style>
<div class="layui-card">
<div class="layui-card-header">
<form class="layui-form render">
<div class="layui-form-item">
<div class="layui-inline">
<div class="layui-btn-group">
<a class="layui-btn" id="certcategory-sz" data="1"><i class="layui-icon">&#xe624;</i>展开</a>
<a class="layui-btn" id="certcategory-add" ><i class="layui-icon layui-icon-add-circle"></i> 添加</a>
</div>
</div>
</div>
</form>
</div>
<div class="layui-card-body">
<div class="layui-card-body">
<table lay-filter="certcategory" id="certcategory"></table>
</div>
</div>
</div>
</div>
<!--JS部分-->
<script>
layui.use(['trTable','vinfo', 'buildItems'], function(){
var map_root = layui.cache.maps;
var app_root = map_root + 'cert.cert_category/';
var layer = layui.layer,table=layui.table,form=layui.form,admin=layui.admin,treeTable = layui.trTable;
/*渲染数据*/
var certcategorycateTb = treeTable.render({
elem: '#certcategory',
checkdd: false,
url: app_root+"index?&do=json",
tree: {
iconIndex: 1,
isPidData: true,
idName: 'id',
pidName: 'pid',
arrowType: 'arrow2',
getIcon: 'v-tree-icon-style2'
},
cols: [[
{field:'id',width:50,align:'center',title:'ID'},
{field:'title',align:'left',title:'分类',edit:'text'},
{field:'thumb',width:50,align:'center',title:'缩略图',templet:'<div><div class="files_itemw1"><img src="{{d.thumbpath}}" lay-event="article-event-image" /></div></div>'},
{field:'sort',width:50,align:'center',title:'排序',edit:'text'},
{fixed:'right',width:130,align:'center',toolbar:'<div><a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a><a class="layui-btn layui-btn-xs layui-btn-danger" lay-event="del">删除</a></div>',title:'操作'}
]],
done: function(){ admin.vShow($('[lay-table-id="certcategory"]')); }
});
/*展开或折叠*/
$('#certcategory-sz').click(function(){
var ob = $(this),i,t;
if(ob.attr('data')==1){
certcategorycateTb.expandAll();
i=0;t='<i class="layui-icon">&#xe67e;</i>折叠';
}else{
certcategorycateTb.foldAll();
i=1;t='<i class="layui-icon">&#xe624;</i>展开';
}
ob.attr('data',i).html(t);
});/**/
/*快编监听*/
treeTable.on('edit(certcategory)',function(obj){
admin.req(app_root+"editup",{id:obj.data.id,av:obj.value,af:obj.field},function(res){
layer.msg(res.msg,{shade:[0.4,'#000'],time:500});
},'post',{headersToken:true});
});/**/
/*工具条监听*/
treeTable.on('tool(certcategory)', function(obj){
var data = obj.data;
var id = data.id;
if(obj.event === 'edit'){
certcategoryOpen(data.id);
}else if(obj.event === 'del'){
del(id);
}else if(obj.event === 'article-event-image'){
var src = $(this).attr('src'), alt = $(this).attr('alt');
layer.photos({photos:{data:[{alt:alt,src:src}],start:'0'},anim:5,shade:[0.4,'#000']});
}
});/**/
/*删除*/
function del(ids){
layer.confirm('确定要删除所选吗?', function(){
admin.req(app_root+"del",{id:ids},function(res){
layer.msg(res.msg,{shade:[0.4,'#000'],time:1500},function(){
if(res.code==1) certcategorycateTb.refresh();
});
},'post',{headersToken:true});
});
}/**/
$('#certcategory-add').on('click',function(){certcategoryOpen();});/**/
/*弹出窗*/
function certcategoryOpen(id=''){
if(id > 0){
var title = '编辑分类';
}else{
var title = '添加分类';
}
layer.open({
type: 2,
area: ['900px', '900px'],
title: title,
btn: ['确定', '关闭'],
fixed: false, //不固定
content: app_root+'edit?id='+id,
yes: function(index, layero){
var data = window["layui-layer-iframe" + index].callbackdata();
$.ajax({
method: "post",
url: app_root+'/edit',
data: data,
dataType: "json",
success: function (res){
if(res.code===1) {
layer.msg(res.msg,{icon:1,shade:[0.4,'#000'],time:1500},function (){
layer.close(index);
certcategorycateTb.refresh();
});
}else{
layer.msg(res.msg,{icon:2,shade:[0.4,'#000'],time:1500},function (){
});
}
// layer.closeAll();
}
});
},
});
}/**/
});
</script>
\ No newline at end of file
{extend name="base/header" /}
{block name="body"}
<style>
.layui-table .widthtd{ width: 120px;}
</style>
<div style="margin: 0px 10px;">
<p style="padding-top: 10px;">学校基本信息:</p>
<table class="layui-table">
<tbody>
<tr>
<td class="widthtd"><strong>学校名称</strong></td>
<td>{$info.name}</td>
<td class="widthtd"><strong>学校类型</strong></td>
<td>{$info.type}</td>
</tr>
<tr>
<td class="widthtd"><strong>详细地址</strong></td>
<td>{$info.addressxx}</td>
<td class="widthtd"><strong>学校官网</strong></td>
<td>{$info.web_url}</td>
</tr>
</tbody>
</table>
<p>联系人信息:</p>
<table class="layui-table">
<tbody>
<tr>
<td class="widthtd"><strong>联系人姓名</strong></td>
<td>{$info.contacts_name}</td>
<td class="widthtd"><strong>联系人职位</strong></td>
<td>{$info.job}</td>
</tr>
<tr>
<td class="widthtd"><strong>联系人手机号</strong></td>
<td>{$info.contacts_phone}</td>
<td class="widthtd"><strong>联系人邮箱</strong></td>
<td>{$info.contacts_email}</td>
</tr>
</tbody>
</table>
<p>资质证明材料:</p>
<table class="layui-table">
<tbody>
<tr>
<td class="widthtd"><strong>学校资质证明</strong></td>
<td>
{if $info.schoolQualification}
{in name="info.schoolQualification.fileext" value="jpg,png,jpeg"}
<img src="{$info.schoolQualification.fileurl}" width="100" height="100" class="imgclick">
{else/}
<a href="{$info.schoolQualification.fileurl}" target="_blank">{$info.schoolQualification.filename}</a>
{/in}
{/if}
</td>
<td class="widthtd"><strong>合作协议</strong></td>
<td>
{if $info.agreement}
{in name="info.agreement.fileext" value="jpg,png,jpeg"}
<img src="{$info.agreement.fileurl}" width="100" height="100" class="imgclick">
{else/}
<a href="{$info.agreement.fileurl}" target="_blank">{$info.agreement.filename}</a>
{/in}
{/if}
</td>
</tr>
<tr>
<td class="widthtd"><strong>导师资质证明</strong></td>
<td>
{if $info.teacherQualification}
{in name="info.teacherQualification.fileext" value="jpg,png,jpeg"}
<img src="{$info.teacherQualification.fileurl}" width="100" height="100" class="imgclick">
{else/}
<a href="{$info.teacherQualification.fileurl}" class="layui-font-green" target="_blank">{$info.teacherQualification.filename}</a>
{/in}
{/if}
</td>
<td class="widthtd"><strong>补充材料</strong></td>
<td>
{if $info.moreFile}
{in name="info.moreFile.fileext" value="jpg,png,jpeg"}
<img src="{$info.moreFile.fileurl}" width="100" height="100" class="imgclick">
{else/}
<a href="{$info.moreFile.fileurl}" target="_blank">{$info.moreFile.filename}</a>
{/in}
{/if}
</td>
</tr>
</tbody>
</table>
</div>
{/block}
{block name="script"}
<script type="text/javascript">
layui.use(['buildItems', 'form', 'laydate', 'util'], function () {
var form = layui.form;
/*解析顶部分组选项*/
var str = [{
"name": "cover_img_id",
"title": "上传图片",
"value": "{$data.cover_img_id|default=''|get_upload_file}",
"pathid": "{$data.cover_img_id|default=''}",
"type": "imagewt"
}];
layui.buildItems.build({
fjbid:'fjfrom',
bid: 'cover_img_id',
url: '',
map: layui.cache.maps + 'system.upload/',
gid: 1,
data: str
});
layui.buildItems.init();
form.render();
});
$(".imgclick").click(function (){
var src = $(this).attr('src'), alt = $(this).attr('alt');
layer.photos({photos:{data:[{alt:alt,src:src}],start:'0'},anim:5,shade:[0.4,'#000']});
});
var callbackdata = function () {
var data = $(".layui-form").serialize();
return data;
};
</script>
{/block}
\ No newline at end of file
<div class="layui-fluid">
<style>
.files_itemadv{width:30px;height:30px;line-height:30px;cursor:pointer;padding:1px;background:#fff;display:-webkit-box;-moz-box-align:center;-webkit-box-align:center;-moz-box-pack:center;-webkit-box-pack:center;}
.files_itemadv img{max-width:28px;max-height:28px;border:0}
</style>
<div class="layui-card">
<div class="layui-card-header">
<form class="layui-form render">
<input type="hidden" name="groupid" id="certorder-groupid" value=""/>
<div class="layui-form-item">
<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="certorder" placeholder="学校名称" autocomplete="off" class="layui-input" lay-affix="clear"/></div>
<div class="layui-inline" style="width:150px;">
<select name="status">
<option value="-1">审核状态</option>
<option value="1">审核通过</option>
<option value="2">审核失败</option>
<option value="0">待审核</option>
</select>
</div>
<div class="layui-inline">
<div class="layui-btn-group">
<button class="layui-btn" lay-submit lay-filter="search-certorder"><i class="layui-icon layui-icon-search"></i> 搜索</button>
<a class="layui-btn" lay-submit lay-filter="search-certorder-all" onclick="$('#certorder-groupid').val('')"><i class="layui-icon layui-icon-light"></i>全部</a>
</div>
</div>
</div>
</form>
</div>
<div class="layui-card-body">
<div class="layui-card-box">
<table lay-filter="certorder" id="certorder"></table>
</div>
</div>
</div>
</div>
<script type="text/html" id="certorderdemo">
<div class="layui-clear-space">
<a class="layui-btn layui-btn-xs" lay-event="detail">详情</a>
<a class="layui-btn layui-btn-xs" lay-event="shenhei">审核</a>
<!-- <a class="layui-btn layui-btn-xs" lay-event="more">-->
<!-- 更多-->
<!-- <i class="layui-icon layui-icon-down"></i>-->
<!-- </a>-->
</div>
</script>
<script type="text/html" id="certorderstatus-demo">
{{# if (d.status === 1) { }}
<a class="layui-btn layui-btn-xs layui-btn-normal" >{{=d.status_text}}</a>
{{# } else { }}
{{# if(d.status === 2) { }}
<a class="layui-btn layui-btn-xs layui-btn-danger" lay-event="statuserror">{{=d.status_text}}</a>
{{# } else { }}
<a class="layui-btn layui-btn-xs">{{=d.status_text}}</a>
{{# } }}
{{# } }}
</script>
<!--JS部分-->
<script>
layui.use(['vinfo', 'buildItems'], function(){
var map_root = layui.cache.maps;
var app_root = map_root + 'cert.cert_order/';
var layer = layui.layer,table=layui.table,form=layui.form,admin=layui.admin;
var dropdown = layui.dropdown;
/*初始渲染*/
/*==============左树结构END==============*/
/*渲染数据*/
table.render({
elem: '#certorder',
page: true,
limit:{$limit},
height: 'full-341',
url: app_root+"index?&do=json",
cols: [[
{type:'checkbox',fixed:'left'},
{field:'id',width:50,unresize:true,align:'center',title:'ID',sort:!0},
{field:'certordername',align:'center',width:160,title:'用户名',templet:'<div>{{d.userprofile.username}}</div>'},
{field:'mobile',align:'center',width:120,title:'用户手机号',templet:'<div>{{d.userprofile.mobile}}</div>'},
{field:'name',align:'center',title:'证书名称',templet:'<div>{{d.certdata.title}}</div>'},
{field:"status_text",width:100,align:'center',title:"状态",templet:'#certorderstatus-demo'},
{field:'name',align:'center',title:'报名姓名'},
{field:'idcard',align:'center',title:'报名身份证号码'},
{field:'mobile',align:'center',title:'报名手机号'},
{field:'email',align:'center',title:'报名邮箱'},
{field:'createtime',width:150,align:'center',title:'创建时间'},
{fixed:'right',width:120,align:'center', templet: '#certorderdemo',title:'操作'}
]],
done: function(){ admin.vShow($('[lay-table-id="certorder"]'));
}
});
// 状态 - 开关操作
form.on('switch(certorder-chang)', function(obj){
var json = JSON.parse(decodeURIComponent($(this).data('json')));
var av = obj.elem.checked ? 1 : 0;
admin.req(app_root+"editup",{id:json.id,av:av,af:obj.elem.name},function(res){
layer.tips(res.msg,obj.othis,{time:1000});
if(res.code === 0) obj.elem.checked = parseInt(obj.value);
},'post',{headersToken:true});
});
/*快编监听*/
table.on('edit(certorder)',function(obj){
admin.req(app_root+"editup",{id:obj.data.id,av:obj.value,af:obj.field},function(res){
layer.msg(res.msg,{shade:[0.4,'#000'],time:500});
},'post',{headersToken:true});
});/**/
/*工具条监听*/
table.on('tool(certorder)', function(obj){
var data = obj.data;
var id = data.id;
if(obj.event === 'detail'){
certorderOpen(id);
}else if(obj.event === 'del'){
del(id);
}else if(obj.event === 'certorder-event-image'){
var src = $(this).attr('src'), alt = $(this).attr('alt');
layer.photos({photos:{data:[{alt:alt,src:src}],start:'0'},anim:5,shade:[0.4,'#000']});
}else if(obj.event === 'more'){
}else if(obj.event === 'shenhei'){
layer.confirm('选择审核状态?', {
btn: ['审核通过', '审核不通过'],
btn1: function(index, layero, that){
shajax(data.id,1);
},
btn2: function(index, layero, that){
layer.prompt({
formType: 2,
value: '',
title: '请输入失败原因',
}, function(value, index, elem){
shajax(data.id,2,value);
});
},
});
}else if(obj.event === 'statuserror'){
layer.alert(data.status_desc,{title:'失败原因'});
}
});/**/
/*删除*/
function del(ids){
layer.confirm('确定要删除所选记录吗?', function(){
admin.req(app_root+"del",{id:ids},function(res){
layer.msg(res.msg,{shade:[0.4,'#000'],time:1500},function(){
if(res.code==1) table.reloadData('certorder');
});
},'post',{headersToken:true});
});
}/**/
/*弹出窗*/
function certorderOpen(id='',type=''){
layer.open({
type: 2,
area: ['900px', '900px'],
title: '资料详情',
btn: ['确定', '关闭'],
fixed: false, //不固定
content: '/admin/users.certorder/detail?id='+id+'&type='+type,
yes: function(index, layero){
layer.close(index);
},
});
}/**/
function shajax(id,shstatus,errordesc=''){
$.ajax({
method: "post",
url: layui.cache.maps+'/users.certorder/shenhecertorder',
data: {id:id,shstatus:shstatus,errordesc:errordesc},
dataType: "json",
success: function (res){
if(res.code===1) {
layer.msg(res.msg,{icon:1,shade:[0.4,'#000'],time:1500},function (){
layer.closeAll();
table.reloadData('certorder');
});
}else{
layer.msg(res.msg,{icon:2,shade:[0.4,'#000'],time:1500},function (){
});
}
}
});
}
});
</script>
\ No newline at end of file
......@@ -28,15 +28,10 @@
<div class="layui-form-item">
<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">
<div class="layui-btn-group">
<button class="layui-btn" lay-submit lay-filter="search-course"><i class="layui-icon layui-icon-search"></i> 搜索</button>
<a class="layui-btn" lay-submit lay-filter="search-course-all" onclick="$('#course-groupid').val('')"><i class="layui-icon layui-icon-light"></i>全部</a>
<a class="layui-btn" id="course-del"><i class="layui-icon layui-icon-delete"></i> 删除</a>
</div>
</div>
......@@ -162,7 +157,7 @@
}else if(obj.event === 'del'){
del(id);
}else if(obj.event === 'statuserror'){
layer.alert(data.sh_error_desc);
layer.alert(data.sh_error_desc,{title:'失败原因'});
}else if(obj.event === 'shenhei'){
layer.confirm('选择审核状态?', {
......
{extend name="base/header" /}
{block name="body"}
<style>
.layui-table .widthtd{ width: 120px;}
</style>
<div style="margin: 0px 10px;">
<p style="padding-top: 10px;">学校基本信息:</p>
<table class="layui-table">
<tbody>
<tr>
<td class="widthtd"><strong>企业名称</strong></td>
<td>{$info.name}</td>
<td class="widthtd"><strong>企业类型</strong></td>
<td>{$info.type}</td>
</tr>
<tr>
<td class="widthtd"><strong>企业规模</strong></td>
<td>{$info.scale}</td>
<td class="widthtd"><strong>成立年份</strong></td>
<td>{$info.established}</td>
</tr>
<tr>
<td class="widthtd"><strong>详细地址</strong></td>
<td>{$info.addressxx}</td>
<td class="widthtd"><strong>企业官网</strong></td>
<td>{$info.web_url}</td>
</tr>
<tr>
<td class="widthtd"><strong>主营业务</strong></td>
<td>{$info.main_business}</td>
<td class="widthtd"><strong>企业简介</strong></td>
<td>{$info.about_business}</td>
</tr>
</tbody>
</table>
<p>联系人信息:</p>
<table class="layui-table">
<tbody>
<tr>
<td class="widthtd"><strong>联系人姓名</strong></td>
<td>{$info.contacts_name}</td>
<td class="widthtd"><strong>联系人职位</strong></td>
<td>{$info.job}</td>
</tr>
<tr>
<td class="widthtd"><strong>联系人手机号</strong></td>
<td>{$info.contacts_phone}</td>
<td class="widthtd"><strong>联系人邮箱</strong></td>
<td>{$info.contacts_email}</td>
</tr>
</tbody>
</table>
<p>资质证明材料:</p>
<table class="layui-table">
<tbody>
<tr>
<td class="widthtd"><strong>企业资质证明</strong></td>
<td>
{in name="info.businessQualification.fileext" value="jpg,png,jpeg"}
<img src="{$info.businessQualification.fileurl}" width="100" height="100" class="imgclick">
{else/}
<a href="{$info.businessQualification.fileurl}" target="_blank">{$info.businessQualification.filename}</a>
{/in}
</td>
<td class="widthtd"><strong>行业认证证书</strong></td>
<td>
{if $info.businessIndustry}
{in name="info.businessIndustry.fileext" value="jpg,png,jpeg"}
<img src="{$info.businessIndustry.fileurl}" width="100" height="100" class="imgclick">
{else/}
<a href="{$info.businessIndustry.fileurl}" target="_blank">{$info.businessIndustry.filename}</a>
{/in}
{/if}
</td>
</tr>
<tr>
<td class="widthtd"><strong>项目案例展示</strong></td>
<td>
{if $info.businessPorject}
{in name="info.businessPorject.fileext" value="jpg,png,jpeg"}
<img src="{$info.businessPorject.fileurl}" width="100" height="100" class="imgclick">
{else/}
<a href="{$info.businessPorject.fileurl}" class="layui-font-green" target="_blank">{$info.businessPorject.filename}</a>
{/in}
{/if}
</td>
<td class="widthtd"><strong>企业logo</strong></td>
<td>
{if $info.businessPorject}
{in name="info.businessLogo.fileext" value="jpg,png,jpeg"}
<img src="{$info.businessLogo.fileurl}" width="100" height="100" class="imgclick">
{else/}
<a href="{$info.businessLogo.fileurl}" target="_blank">{$info.businessLogo.filename}</a>
{/in}
{/if}
</td>
</tr>
<tr>
<td class="widthtd"><strong>补充材料</strong></td>
<td>
{if $info.businessMore}
{in name="info.businessMore.fileext" value="jpg,png,jpeg"}
<img src="{$info.businessMore.fileurl}" width="100" height="100" class="imgclick">
{else/}
<a href="{$info.businessMore.fileurl}" class="layui-font-green" target="_blank">{$info.businessMore.filename}</a>
{/in}
{/if}
</td>
</tr>
</tbody>
</table>
</div>
{/block}
{block name="script"}
<script type="text/javascript">
layui.use(['buildItems', 'form', 'laydate', 'util'], function () {
var form = layui.form;
/*解析顶部分组选项*/
var str = [{
"name": "cover_img_id",
"title": "上传图片",
"value": "{$data.cover_img_id|default=''|get_upload_file}",
"pathid": "{$data.cover_img_id|default=''}",
"type": "imagewt"
}];
layui.buildItems.build({
fjbid:'fjfrom',
bid: 'cover_img_id',
url: '',
map: layui.cache.maps + 'system.upload/',
gid: 1,
data: str
});
layui.buildItems.init();
form.render();
});
$(".imgclick").click(function (){
var src = $(this).attr('src'), alt = $(this).attr('alt');
layer.photos({photos:{data:[{alt:alt,src:src}],start:'0'},anim:5,shade:[0.4,'#000']});
});
var callbackdata = function () {
var data = $(".layui-form").serialize();
return data;
};
</script>
{/block}
\ No newline at end of file
<div class="layui-fluid">
<style>
.files_itemadv{width:30px;height:30px;line-height:30px;cursor:pointer;padding:1px;background:#fff;display:-webkit-box;-moz-box-align:center;-webkit-box-align:center;-moz-box-pack:center;-webkit-box-pack:center;}
.files_itemadv img{max-width:28px;max-height:28px;border:0}
</style>
<div class="layui-card">
<div class="layui-card-header">
<form class="layui-form render">
<input type="hidden" name="groupid" id="business-groupid" value=""/>
<div class="layui-form-item">
<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:150px;">
<select name="status">
<option value="-1">审核状态</option>
<option value="1">审核通过</option>
<option value="2">审核失败</option>
<option value="0">待审核</option>
</select>
</div>
<div class="layui-inline">
<div class="layui-btn-group">
<button class="layui-btn" lay-submit lay-filter="search-business"><i class="layui-icon layui-icon-search"></i> 搜索</button>
<a class="layui-btn" lay-submit lay-filter="search-business-all" onclick="$('#business-groupid').val('')"><i class="layui-icon layui-icon-light"></i>全部</a>
</div>
</div>
</div>
</form>
</div>
<div class="layui-card-body">
<div class="layui-card-box">
<table lay-filter="business" id="business"></table>
</div>
</div>
</div>
</div>
<script type="text/html" id="businessdemo">
<div class="layui-clear-space">
<a class="layui-btn layui-btn-xs" lay-event="detail">详情</a>
<a class="layui-btn layui-btn-xs" lay-event="shenhei">审核</a>
<!-- <a class="layui-btn layui-btn-xs" lay-event="more">-->
<!-- 更多-->
<!-- <i class="layui-icon layui-icon-down"></i>-->
<!-- </a>-->
</div>
</script>
<script type="text/html" id="status-demo">
{{# if (d.status === 1) { }}
<a class="layui-btn layui-btn-xs layui-btn-normal" >{{=d.status_text}}</a>
{{# } else { }}
{{# if(d.status === 2) { }}
<a class="layui-btn layui-btn-xs layui-btn-danger" lay-event="statuserror">{{=d.status_text}}</a>
{{# } else { }}
<a class="layui-btn layui-btn-xs">{{=d.status_text}}</a>
{{# } }}
{{# } }}
</script>
<!--JS部分-->
<script>
layui.use(['vinfo', 'buildItems'], function(){
var map_root = layui.cache.maps;
var app_root = map_root + 'users.business/';
var layer = layui.layer,table=layui.table,form=layui.form,admin=layui.admin;
var dropdown = layui.dropdown;
/*初始渲染*/
table.render({
elem: '#business',
page: true,
limit:{$limit},
height: 'full-341',
url: app_root+"index?&do=json",
cols: [[
{type:'checkbox',fixed:'left'},
{field:'id',width:50,unresize:true,align:'center',title:'ID',sort:!0},
{field:'businessname',align:'center',width:160,title:'用户名',templet:'<div>{{d.getuserdata.username}}</div>'},
{field:'mobile',align:'center',width:120,title:'用户手机号',templet:'<div>{{d.getuserdata.mobile}}</div>'},
{field:'name',align:'center',title:'企业名称'},
{field:'type',align:'center',title:'类型'},
{field:'addressxx',align:'center',title:'详细地址'},
{field:"status_text",width:100,align:'center',title:"状态",templet:'#status-demo'},
{field:'contacts_name',align:'center',width:100,title:'联系人姓名'},
{field:'job',align:'center',width:100,title:'联系人职位'},
{field:'contacts_phone',align:'center',width:130,title:'联系人手机号'},
{field:'contacts_email',align:'center',width:150,title:'联系人邮箱'},
{field:'create_time',width:150,align:'center',title:'创建时间'},
{fixed:'right',width:120,align:'center', templet: '#businessdemo',title:'操作'}
]],
done: function(){ admin.vShow($('[lay-table-id="business"]'));
}
});
// 状态 - 开关操作
form.on('switch(business-chang)', function(obj){
var json = JSON.parse(decodeURIComponent($(this).data('json')));
var av = obj.elem.checked ? 1 : 0;
admin.req(app_root+"editup",{id:json.id,av:av,af:obj.elem.name},function(res){
layer.tips(res.msg,obj.othis,{time:1000});
if(res.code === 0) obj.elem.checked = parseInt(obj.value);
},'post',{headersToken:true});
});
/*快编监听*/
table.on('edit(business)',function(obj){
admin.req(app_root+"editup",{id:obj.data.id,av:obj.value,af:obj.field},function(res){
layer.msg(res.msg,{shade:[0.4,'#000'],time:500});
},'post',{headersToken:true});
});/**/
/*工具条监听*/
table.on('tool(business)', function(obj){
var data = obj.data;
var id = data.id;
if(obj.event === 'detail'){
businessOpen(id);
}else if(obj.event === 'del'){
del(id);
}else if(obj.event === 'business-event-image'){
var src = $(this).attr('src'), alt = $(this).attr('alt');
layer.photos({photos:{data:[{alt:alt,src:src}],start:'0'},anim:5,shade:[0.4,'#000']});
}else if(obj.event === 'more'){
}else if(obj.event === 'shenhei'){
layer.confirm('选择审核状态?', {
btn: ['审核通过', '审核不通过'],
btn1: function(index, layero, that){
shajax(data.id,1);
},
btn2: function(index, layero, that){
layer.prompt({
formType: 2,
value: '',
title: '请输入失败原因',
}, function(value, index, elem){
shajax(data.id,2,value);
});
},
});
}else if(obj.event === 'statuserror'){
layer.alert(data.status_desc,{title:'失败原因'});
}
});/**/
/*删除*/
function del(ids){
layer.confirm('确定要删除所选记录吗?', function(){
admin.req(app_root+"del",{id:ids},function(res){
layer.msg(res.msg,{shade:[0.4,'#000'],time:1500},function(){
if(res.code==1) table.reloadData('business');
});
},'post',{headersToken:true});
});
}/**/
/*弹出窗*/
function businessOpen(id='',type=''){
layer.open({
type: 2,
area: ['900px', '900px'],
title: '资料详情',
btn: ['确定', '关闭'],
fixed: false, //不固定
content: '/admin/users.business/detail?id='+id+'&type='+type,
yes: function(index, layero){
layer.close(index);
},
});
}/**/
function shajax(id,shstatus,errordesc=''){
$.ajax({
method: "post",
url: layui.cache.maps+'/users.business/shenhebusiness',
data: {id:id,shstatus:shstatus,errordesc:errordesc},
dataType: "json",
success: function (res){
if(res.code===1) {
layer.msg(res.msg,{icon:1,shade:[0.4,'#000'],time:1500},function (){
layer.closeAll();
table.reloadData('business');
});
}else{
layer.msg(res.msg,{icon:2,shade:[0.4,'#000'],time:1500},function (){
});
}
}
});
}
});
</script>
\ No newline at end of file
{extend name="base/header" /}
{block name="body"}
<style>
.layui-table .widthtd{ width: 120px;}
</style>
<div style="margin: 0px 10px;">
<p style="padding-top: 10px;">学校基本信息:</p>
<table class="layui-table">
<tbody>
<tr>
<td class="widthtd"><strong>学校名称</strong></td>
<td>{$info.name}</td>
<td class="widthtd"><strong>学校类型</strong></td>
<td>{$info.type}</td>
</tr>
<tr>
<td class="widthtd"><strong>详细地址</strong></td>
<td>{$info.addressxx}</td>
<td class="widthtd"><strong>学校官网</strong></td>
<td>{$info.web_url}</td>
</tr>
</tbody>
</table>
<p>联系人信息:</p>
<table class="layui-table">
<tbody>
<tr>
<td class="widthtd"><strong>联系人姓名</strong></td>
<td>{$info.contacts_name}</td>
<td class="widthtd"><strong>联系人职位</strong></td>
<td>{$info.job}</td>
</tr>
<tr>
<td class="widthtd"><strong>联系人手机号</strong></td>
<td>{$info.contacts_phone}</td>
<td class="widthtd"><strong>联系人邮箱</strong></td>
<td>{$info.contacts_email}</td>
</tr>
</tbody>
</table>
<p>资质证明材料:</p>
<table class="layui-table">
<tbody>
<tr>
<td class="widthtd"><strong>学校资质证明</strong></td>
<td>
{if $info.schoolQualification}
{in name="info.schoolQualification.fileext" value="jpg,png,jpeg"}
<img src="{$info.schoolQualification.fileurl}" width="100" height="100" class="imgclick">
{else/}
<a href="{$info.schoolQualification.fileurl}" target="_blank">{$info.schoolQualification.filename}</a>
{/in}
{/if}
</td>
<td class="widthtd"><strong>合作协议</strong></td>
<td>
{if $info.agreement}
{in name="info.agreement.fileext" value="jpg,png,jpeg"}
<img src="{$info.agreement.fileurl}" width="100" height="100" class="imgclick">
{else/}
<a href="{$info.agreement.fileurl}" target="_blank">{$info.agreement.filename}</a>
{/in}
{/if}
</td>
</tr>
<tr>
<td class="widthtd"><strong>导师资质证明</strong></td>
<td>
{if $info.teacherQualification}
{in name="info.teacherQualification.fileext" value="jpg,png,jpeg"}
<img src="{$info.teacherQualification.fileurl}" width="100" height="100" class="imgclick">
{else/}
<a href="{$info.teacherQualification.fileurl}" class="layui-font-green" target="_blank">{$info.teacherQualification.filename}</a>
{/in}
{/if}
</td>
<td class="widthtd"><strong>补充材料</strong></td>
<td>
{if $info.moreFile}
{in name="info.moreFile.fileext" value="jpg,png,jpeg"}
<img src="{$info.moreFile.fileurl}" width="100" height="100" class="imgclick">
{else/}
<a href="{$info.moreFile.fileurl}" target="_blank">{$info.moreFile.filename}</a>
{/in}
{/if}
</td>
</tr>
</tbody>
</table>
</div>
{/block}
{block name="script"}
<script type="text/javascript">
layui.use(['buildItems', 'form', 'laydate', 'util'], function () {
var form = layui.form;
/*解析顶部分组选项*/
var str = [{
"name": "cover_img_id",
"title": "上传图片",
"value": "{$data.cover_img_id|default=''|get_upload_file}",
"pathid": "{$data.cover_img_id|default=''}",
"type": "imagewt"
}];
layui.buildItems.build({
fjbid:'fjfrom',
bid: 'cover_img_id',
url: '',
map: layui.cache.maps + 'system.upload/',
gid: 1,
data: str
});
layui.buildItems.init();
form.render();
});
$(".imgclick").click(function (){
var src = $(this).attr('src'), alt = $(this).attr('alt');
layer.photos({photos:{data:[{alt:alt,src:src}],start:'0'},anim:5,shade:[0.4,'#000']});
});
var callbackdata = function () {
var data = $(".layui-form").serialize();
return data;
};
</script>
{/block}
\ No newline at end of file
<div class="layui-fluid">
<style>
.files_itemadv{width:30px;height:30px;line-height:30px;cursor:pointer;padding:1px;background:#fff;display:-webkit-box;-moz-box-align:center;-webkit-box-align:center;-moz-box-pack:center;-webkit-box-pack:center;}
.files_itemadv img{max-width:28px;max-height:28px;border:0}
</style>
<div class="layui-card">
<div class="layui-card-header">
<form class="layui-form render">
<input type="hidden" name="groupid" id="school-groupid" value=""/>
<div class="layui-form-item">
<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:150px;">
<select name="status">
<option value="-1">审核状态</option>
<option value="1">审核通过</option>
<option value="2">审核失败</option>
<option value="0">待审核</option>
</select>
</div>
<div class="layui-inline">
<div class="layui-btn-group">
<button class="layui-btn" lay-submit lay-filter="search-school"><i class="layui-icon layui-icon-search"></i> 搜索</button>
<a class="layui-btn" lay-submit lay-filter="search-school-all" onclick="$('#school-groupid').val('')"><i class="layui-icon layui-icon-light"></i>全部</a>
</div>
</div>
</div>
</form>
</div>
<div class="layui-card-body">
<div class="layui-card-box">
<table lay-filter="school" id="school"></table>
</div>
</div>
</div>
</div>
<script type="text/html" id="schooldemo">
<div class="layui-clear-space">
<a class="layui-btn layui-btn-xs" lay-event="detail">详情</a>
<a class="layui-btn layui-btn-xs" lay-event="shenhei">审核</a>
<!-- <a class="layui-btn layui-btn-xs" lay-event="more">-->
<!-- 更多-->
<!-- <i class="layui-icon layui-icon-down"></i>-->
<!-- </a>-->
</div>
</script>
<script type="text/html" id="status-demo">
{{# if (d.status === 1) { }}
<a class="layui-btn layui-btn-xs layui-btn-normal" >{{=d.status_text}}</a>
{{# } else { }}
{{# if(d.status === 2) { }}
<a class="layui-btn layui-btn-xs layui-btn-danger" lay-event="statuserror">{{=d.status_text}}</a>
{{# } else { }}
<a class="layui-btn layui-btn-xs">{{=d.status_text}}</a>
{{# } }}
{{# } }}
</script>
<!--JS部分-->
<script>
layui.use(['vinfo', 'buildItems'], function(){
var map_root = layui.cache.maps;
var app_root = map_root + 'users.school/';
var layer = layui.layer,table=layui.table,form=layui.form,admin=layui.admin;
var dropdown = layui.dropdown;
/*初始渲染*/
/*==============左树结构END==============*/
/*渲染数据*/
table.render({
elem: '#school',
page: true,
limit:{$limit},
height: 'full-341',
url: app_root+"index?&do=json",
cols: [[
{type:'checkbox',fixed:'left'},
{field:'id',width:50,unresize:true,align:'center',title:'ID',sort:!0},
{field:'schoolname',align:'center',width:160,title:'用户名',templet:'<div>{{d.getuserdata.username}}</div>'},
{field:'mobile',align:'center',width:120,title:'用户手机号',templet:'<div>{{d.getuserdata.mobile}}</div>'},
{field:'name',align:'center',title:'学校名称'},
{field:'addressxx',align:'center',title:'详细地址'},
{field:"status_text",width:100,align:'center',title:"状态",templet:'#status-demo'},
{field:'contacts_name',align:'center',width:100,title:'联系人姓名'},
{field:'job',align:'center',width:100,title:'联系人职位'},
{field:'contacts_phone',align:'center',width:130,title:'联系人手机号'},
{field:'contacts_email',align:'center',width:150,title:'联系人邮箱'},
{field:'create_time',width:150,align:'center',title:'创建时间'},
{fixed:'right',width:120,align:'center', templet: '#schooldemo',title:'操作'}
]],
done: function(){ admin.vShow($('[lay-table-id="school"]'));
}
});
// 状态 - 开关操作
form.on('switch(school-chang)', function(obj){
var json = JSON.parse(decodeURIComponent($(this).data('json')));
var av = obj.elem.checked ? 1 : 0;
admin.req(app_root+"editup",{id:json.id,av:av,af:obj.elem.name},function(res){
layer.tips(res.msg,obj.othis,{time:1000});
if(res.code === 0) obj.elem.checked = parseInt(obj.value);
},'post',{headersToken:true});
});
/*快编监听*/
table.on('edit(school)',function(obj){
admin.req(app_root+"editup",{id:obj.data.id,av:obj.value,af:obj.field},function(res){
layer.msg(res.msg,{shade:[0.4,'#000'],time:500});
},'post',{headersToken:true});
});/**/
/*工具条监听*/
table.on('tool(school)', function(obj){
var data = obj.data;
var id = data.id;
if(obj.event === 'detail'){
schoolOpen(id);
}else if(obj.event === 'del'){
del(id);
}else if(obj.event === 'school-event-image'){
var src = $(this).attr('src'), alt = $(this).attr('alt');
layer.photos({photos:{data:[{alt:alt,src:src}],start:'0'},anim:5,shade:[0.4,'#000']});
}else if(obj.event === 'more'){
}else if(obj.event === 'shenhei'){
layer.confirm('选择审核状态?', {
btn: ['审核通过', '审核不通过'],
btn1: function(index, layero, that){
shajax(data.id,1);
},
btn2: function(index, layero, that){
layer.prompt({
formType: 2,
value: '',
title: '请输入失败原因',
}, function(value, index, elem){
shajax(data.id,2,value);
});
},
});
}else if(obj.event === 'statuserror'){
layer.alert(data.status_desc,{title:'失败原因'});
}
});/**/
/*删除*/
function del(ids){
layer.confirm('确定要删除所选记录吗?', function(){
admin.req(app_root+"del",{id:ids},function(res){
layer.msg(res.msg,{shade:[0.4,'#000'],time:1500},function(){
if(res.code==1) table.reloadData('school');
});
},'post',{headersToken:true});
});
}/**/
/*弹出窗*/
function schoolOpen(id='',type=''){
layer.open({
type: 2,
area: ['900px', '900px'],
title: '资料详情',
btn: ['确定', '关闭'],
fixed: false, //不固定
content: '/admin/users.school/detail?id='+id+'&type='+type,
yes: function(index, layero){
layer.close(index);
},
});
}/**/
function shajax(id,shstatus,errordesc=''){
$.ajax({
method: "post",
url: layui.cache.maps+'/users.school/shenheschool',
data: {id:id,shstatus:shstatus,errordesc:errordesc},
dataType: "json",
success: function (res){
if(res.code===1) {
layer.msg(res.msg,{icon:1,shade:[0.4,'#000'],time:1500},function (){
layer.closeAll();
table.reloadData('school');
});
}else{
layer.msg(res.msg,{icon:2,shade:[0.4,'#000'],time:1500},function (){
});
}
}
});
}
});
</script>
\ No newline at end of file
<div class="layui-fluid">
<style>
.files_itemwsmrz{width:50px;height:50px;cursor:pointer; padding: 1px; background:#fff;display:-webkit-box;-moz-box-align:center;-webkit-box-align:center;-moz-box-pack:center;-webkit-box-pack:center;}
.files_itemwsmrz img{width:48px;height:48px;}
</style>
<div class="layui-card">
<div class="layui-card-header">
<form class="layui-form render">
<input type="hidden" name="groupid" id="smrz-groupid" value=""/>
<div class="layui-form-item">
<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;">
<select name="status">
<option value="-1">审核状态</option>
<option value="2">审核通过</option>
<option value="1">审核失败</option>
<option value="0">待审核</option>
</select>
</div>
<div class="layui-inline">
<div class="layui-btn-group">
<button class="layui-btn" lay-submit lay-filter="search-smrz"><i class="layui-icon layui-icon-search"></i> 搜索</button>
<a class="layui-btn" lay-submit lay-filter="search-smrz-all" onclick="$('#smrz-groupid').val('')"><i class="layui-icon layui-icon-light"></i>全部</a>
</div>
</div>
</div>
</form>
</div>
<div class="layui-card-body">
<div class="layui-card-box">
<table lay-filter="smrz" id="smrz"></table>
</div>
</div>
</div>
</div>
<script type="text/html" id="smrzdemo">
<div class="layui-clear-space">
<a class="layui-btn layui-btn-xs" lay-event="shenhei">审核</a>
<a class="layui-btn layui-btn-xs layui-btn-danger" lay-event="del">删除</a>
<!-- <a class="layui-btn layui-btn-xs" lay-event="more">-->
<!-- 更多-->
<!-- <i class="layui-icon layui-icon-down"></i>-->
<!-- </a>-->
</div>
</script>
<script type="text/html" id="smrzstatus-demo">
{{# if (d.status === 2) { }}
<a class="layui-btn layui-btn-xs layui-btn-normal" >{{=d.status_text}}</a>
{{# } else { }}
{{# if(d.status === 1) { }}
<a class="layui-btn layui-btn-xs layui-btn-danger" lay-event="statuserror">{{=d.status_text}}</a>
{{# } else { }}
<a class="layui-btn layui-btn-xs">{{=d.status_text}}</a>
{{# } }}
{{# } }}
</script>
<!--JS部分-->
<script>
layui.use(['vinfo', 'buildItems'], function(){
var map_root = layui.cache.maps;
var app_root = map_root + 'users.smrz/';
var layer = layui.layer,table=layui.table,form=layui.form,admin=layui.admin;
var dropdown = layui.dropdown;
/*初始渲染*/
/*==============左树结构END==============*/
/*渲染数据*/
table.render({
elem: '#smrz',
page: true,
limit:{$limit},
url: app_root+"index?&do=json",
css:".layui-table-cell{ height:auto;}",
cols: [[
{type:'checkbox',fixed:'left'},
{field:'id',width:50,unresize:true,align:'center',title:'ID',sort:!0},
{field:'smrzname',align:'center',width:160,title:'用户名',templet:'<div>{{d.getuserdata.username}}</div>'},
{field:'mobile',align:'center',width:120,title:'用户手机号',templet:'<div>{{d.getuserdata.mobile}}</div>'},
{field:'realname',align:'center',width:120,title:'姓名'},
{field:'idcard',align:'center',title:'身份证号码'},
{field:'idcard_q',width:150,align:'center',title:'身份证正面',templet:'<div class="files_itemwsmrz"><img src="{{d.idcard_qurl}}" lay-event="smrz-event-image" /></div>'},
{field:'idcard_h',width:150,align:'center',title:'身份证背面',templet:'<div class="files_itemwsmrz"><img src="{{d.idcard_hurl}}" lay-event="smrz-event-image" /></div>'},
{field:"status_text",width:100,align:'center',title:"状态",templet:'#smrzstatus-demo'},
{field:'create_time',width:150,align:'center',title:'创建时间'},
{fixed:'right',width:120,align:'center', templet: '#smrzdemo',title:'操作'}
]],
done: function(){ admin.vShow($('[lay-table-id="smrz"]'));
}
});
// 状态 - 开关操作
form.on('switch(smrz-chang)', function(obj){
var json = JSON.parse(decodeURIComponent($(this).data('json')));
var av = obj.elem.checked ? 1 : 0;
admin.req(app_root+"editup",{id:json.id,av:av,af:obj.elem.name},function(res){
layer.tips(res.msg,obj.othis,{time:1000});
if(res.code === 0) obj.elem.checked = parseInt(obj.value);
},'post',{headersToken:true});
});
/*快编监听*/
table.on('edit(smrz)',function(obj){
admin.req(app_root+"editup",{id:obj.data.id,av:obj.value,af:obj.field},function(res){
layer.msg(res.msg,{shade:[0.4,'#000'],time:500});
},'post',{headersToken:true});
});/**/
/*工具条监听*/
table.on('tool(smrz)', function(obj){
var data = obj.data;
var id = data.id;
if(obj.event === 'detail'){
smrzOpen(id);
}else if(obj.event === 'del'){
del(id);
}else if(obj.event === 'smrz-event-image'){
var src = $(this).attr('src'), alt = $(this).attr('alt');
layer.photos({photos:{data:[{alt:alt,src:src}],start:'0'},anim:5,shade:[0.4,'#000']});
}else if(obj.event === 'more'){
}else if(obj.event === 'shenhei'){
layer.confirm('选择审核状态?', {
btn: ['审核通过', '审核不通过'],
btn1: function(index, layero, that){
shajax(data.id,1);
},
btn2: function(index, layero, that){
layer.prompt({
formType: 2,
value: '',
title: '请输入失败原因',
}, function(value, index, elem){
shajax(data.id,2,value);
});
},
});
}else if(obj.event === 'statuserror'){
layer.alert(data.status_desc,{title:'失败原因'});
}
});/**/
/*删除*/
function del(ids){
layer.confirm('确定要删除所选记录吗?', function(){
admin.req(app_root+"del",{id:ids},function(res){
layer.msg(res.msg,{shade:[0.4,'#000'],time:1500},function(){
if(res.code==1) table.reloadData('smrz');
});
},'post',{headersToken:true});
});
}/**/
/*弹出窗*/
function smrzOpen(id='',type=''){
layer.open({
type: 2,
area: ['900px', '900px'],
title: '资料详情',
btn: ['确定', '关闭'],
fixed: false, //不固定
content: '/admin/users.smrz/detail?id='+id+'&type='+type,
yes: function(index, layero){
layer.close(index);
},
});
}/**/
function shajax(id,shstatus,errordesc=''){
$.ajax({
method: "post",
url: layui.cache.maps+'/users.smrz/shenhesmrz',
data: {id:id,shstatus:shstatus,errordesc:errordesc},
dataType: "json",
success: function (res){
if(res.code===1) {
layer.msg(res.msg,{icon:1,shade:[0.4,'#000'],time:1500},function (){
layer.closeAll();
table.reloadData('smrz');
});
}else{
layer.msg(res.msg,{icon:2,shade:[0.4,'#000'],time:1500},function (){
});
}
}
});
}
});
</script>
\ No newline at end of file
......@@ -4,9 +4,9 @@
.layui-table .widthtd{ width: 120px;}
</style>
<div style="margin: 0px 10px">
<div style="margin: 0px 10px;">
<p>基本信息:</p>
<p style="padding-top: 10px;">基本信息:</p>
<table class="layui-table">
<tbody>
<tr>
......@@ -53,22 +53,30 @@
</colgroup>
<thead>
<tr>
<th>人物</th>
<th>民族</th>
<th>格言</th>
<th>姓名</th>
<th>身份证</th>
<th>身份证正面</th>
<th>身份证背面</th>
</tr>
</thead>
<tbody>
{if (isset($smrzinfo.id))}
<tr>
<td>孔子</td>
<td>华夏</td>
<td>有朋自远方来,不亦乐乎</td>
<td>{$smrzinfo.realname}</td>
<td>{$smrzinfo.idcard}</td>
<td><img src="{$smrzinfo.idcard_q|get_upload_file}" width="100" height="100" class="imgclick"/></td>
<td><img src="{$smrzinfo.idcard_h|get_upload_file}" width="100" height="100" class="imgclick"/></td>
</tr>
{else /}
<tr>
<td>孟子</td>
<td>华夏</td>
<td>穷则独善其身,达则兼济天下</td>
<td colspan="4" align="center">未实名认证</td>
</tr>
{/if}
</tbody>
</table>
</div>
......@@ -102,6 +110,12 @@
});
$(".imgclick").click(function (){
var src = $(this).attr('src'), alt = $(this).attr('alt');
layer.photos({photos:{data:[{alt:alt,src:src}],start:'0'},anim:5,shade:[0.4,'#000']});
});
var callbackdata = function () {
var data = $(".layui-form").serialize();
return data;
......
......@@ -51,7 +51,7 @@
layui.use(['vinfo', 'buildItems'], function(){
var map_root = layui.cache.maps;
var app_root = map_root + 'user/';
var app_root = map_root + 'users.user/';
var layer = layui.layer,table=layui.table,form=layui.form,admin=layui.admin;
var dropdown = layui.dropdown;
/*初始渲染*/
......@@ -132,12 +132,29 @@
id: 'del'
}],
click: function(menudata){
if(menudata.id === 'keshi'){
window.location.href="#/course.course_class/index/kc="+ encodeURIComponent(data.title);
if(menudata.id === 'monelog'){
}else if(menudata.id === 'restpwd'){
window.location.href="#/course.course_class_category/index/kc="+ encodeURIComponent(data.title);
}else if(menudata.id === 'zuoye'){
window.location.href="#/course.course_work/index/kc="+ encodeURIComponent(data.title);
layer.confirm('确定要重置【'+data.username+'】的密码吗?', function(){
$.ajax({
method: "post",
url: layui.cache.maps+'/user/resetpwd',
data: {id:id},
dataType: "json",
success: function (res){
if(res.code===1) {
layer.msg(res.msg,{icon:1,shade:[0.4,'#000'],time:1500},function (){
});
}else{
layer.msg(res.msg,{icon:2,shade:[0.4,'#000'],time:1500},function (){
});
}
}
});
});
} else if(menudata.id === 'del'){
del(id);
}
......@@ -168,7 +185,7 @@
title: '会员详情',
btn: ['确定', '关闭'],
fixed: false, //不固定
content: '/admin/user/detail?id='+id+'&type='+type,
content: '/admin/users.user/detail?id='+id+'&type='+type,
yes: function(index, layero){
layer.close(index);
},
......
<?php
/**
* ===========================================================================
* Veitool 快捷开发框架系统
* Author: Niaho 26843818@qq.com
* Copyright (c)2019-2025 www.veitool.com All rights reserved.
* Licensed: 这不是一个自由软件,不允许对程序代码以任何形式任何目的的再发行
* ---------------------------------------------------------------------------
*/
namespace app\model;
use \app\model\CertCategory;
use app\model\system\SystemUploadFile;
use think\facade\Db;
use think\Model;
/**
* 课程模型
*/
class Cert extends Model
{
public function getCreatetimeAttr($value)
{
return date('Y-m-d H:i:s', $value);
}
public function getStarttimetxtAttr($value,$data)
{
return date('Y-m-d', $data['start_time']);
}
public function getEndtimetxtAttr($value,$data)
{
return date('Y-m-d', $data['end_time']);
}
public function getThumbpathAttr($value, $data)
{
return get_upload_file($data['thumb_id']);
}
public function setStartTimeAttr($value)
{
return strtotime($value);
}
public function setEndTimeAttr($value)
{
return strtotime($value);
}
public function certcatedata()
{
return $this->hasOne(CertCategory::class, 'id', 'cate_id')
->field('id,title');
}
}
\ No newline at end of file
<?php
/**
* ===========================================================================
* Veitool 快捷开发框架系统
* Author: Niaho 26843818@qq.com
* Copyright (c)2019-2025 www.veitool.com All rights reserved.
* Licensed: 这不是一个自由软件,不允许对程序代码以任何形式任何目的的再发行
* ---------------------------------------------------------------------------
*/
namespace app\model;
use think\facade\Db;
use think\Model;
use tool\Tree;
/**
* 模型公用类
*/
class CertCategory extends Model
{
public function catetree($cate_id = 0)
{
$map[] = ['is_del', '=', 0];
$category = $this->where($map)->order('sort desc')->select()->toArray();
$tree = new Tree();
$tree->icon = ['&nbsp;&nbsp;│ ', '&nbsp;&nbsp;├─ ', '&nbsp;&nbsp;└─ '];
$tree->nbsp = '&nbsp;&nbsp;';
$str = "<option value=@id @selected @disabled>@spacer @title</option>";
$tree->init($category);
$categorydata = $tree->getTree(0, $str, $cate_id);
return $categorydata;
}
public function getThumbpathAttr($value, $data)
{
return get_upload_file($data['thumb']);
}
}
\ No newline at end of file
<?php
/**
* ===========================================================================
* Veitool 快捷开发框架系统
* Author: Niaho 26843818@qq.com
* Copyright (c)2019-2025 www.veitool.com All rights reserved.
* Licensed: 这不是一个自由软件,不允许对程序代码以任何形式任何目的的再发行
* ---------------------------------------------------------------------------
*/
namespace app\model;
use app\model\project\User;
use think\Model;
/**
* 课程模型
*/
class CertOrder extends Model
{
public function certdata()
{
return $this->hasOne(Cert::class, 'id', 'cert_id')
->field('id,title');
}
public function userprofile()
{
return $this->belongsTo(User::class, 'user_id', 'id')
->field('id,username,mobile');
}
public function getCreatetimeAttr($value)
{
return date('Y-m-d H:i:s', $value);
}
}
\ No newline at end of file
......@@ -17,34 +17,68 @@ class Business extends Model
public function businessQualification()
{
return $this->hasOne(SystemUploadFile::class, 'fileid', 'business_qualification_url_id')
->field('fileid,filename,filesize,fileurl,filetype');
->where('isdel', 0)
->field('fileid,filename,filesize,fileurl,filetype,fileext');
}
//行业
public function businessIndustry()
{
return $this->hasOne(SystemUploadFile::class, 'fileid', 'business_industry_url_id')
->field('fileid,filename,filesize,fileurl,filetype');
->where('isdel', 0)
->field('fileid,filename,filesize,fileurl,filetype,fileext');
}
//项目
public function businessPorject()
{
return $this->hasOne(SystemUploadFile::class, 'fileid', 'business_project_url_id')
->field('fileid,filename,filesize,fileurl,filetype');
->where('isdel', 0)
->field('fileid,filename,filesize,fileurl,filetype,fileext');
}
//补充材料
public function businessMore()
{
return $this->hasOne(SystemUploadFile::class, 'fileid', 'more_url_id')
->field('fileid,filename,filesize,fileurl,filetype');
->where('isdel', 0)
->field('fileid,filename,filesize,fileurl,filetype,fileext');
}
//企业logo
public function businessLogo()
{
return $this->hasOne(SystemUploadFile::class, 'fileid', 'business_logo_url_id')
->field('fileid,filename,filesize,fileurl,filetype');
->where('isdel', 0)
->field('fileid,filename,filesize,fileurl,filetype,fileext');
}
//用户信息
public function getuserdata()
{
return $this->belongsTo(User::class, 'user_id')
->field('username,mobile,id');
}
//详细地址
public function getAddressxxAttr($value, $data)
{
return $data['province'].'-'.$data['city'].'-'.$data['area'];
}
public function getStatusTextAttr($value, $data)
{
switch ($data['status']) {
case 1:
$statustxt = '审核成功';
break;
case 2:
$statustxt = '审核失败';
break;
default:
$statustxt = '待审核';
}
return $statustxt;
}
}
\ No newline at end of file
......@@ -17,27 +17,61 @@ class School extends Model
public function schoolQualification()
{
return $this->hasOne(SystemUploadFile::class, 'fileid', 'school_qualification_url_id')
->field('fileid,filename,filesize,fileurl,filetype');
->where('isdel', 0)
->field('fileid,filename,filesize,fileurl,filetype,fileext');
}
//导师资质
public function teacherQualification()
{
return $this->hasOne(SystemUploadFile::class, 'fileid', 'teacher_qualification_url_id')
->field('fileid, filename, filesize, fileurl, filetype');
->where('isdel', 0)
->field('fileid, filename, filesize, fileurl, filetype,fileext');
}
//合作协议
public function agreement()
{
return $this->hasOne(SystemUploadFile::class, 'fileid', 'agreement_url_id')
->field('fileid, filename, filesize, fileurl, filetype');
->where('isdel', 0)
->field('fileid, filename, filesize, fileurl, filetype,fileext');
}
//补充材料
public function moreFile()
{
return $this->hasOne(SystemUploadFile::class, 'fileid', 'more_url_id')
->field('fileid, filename, filesize, fileurl, filetype');
->where('isdel', 0)
->field('fileid, filename, filesize, fileurl, filetype,fileext');
}
//用户信息
public function getuserdata()
{
return $this->belongsTo(User::class, 'user_id')
->field('username,mobile,id');
}
//详细地址
public function getAddressxxAttr($value, $data)
{
return $data['province'].'-'.$data['city'].'-'.$data['area'];
}
public function getStatusTextAttr($value, $data)
{
switch ($data['status']) {
case 1:
$statustxt = '审核成功';
break;
case 2:
$statustxt = '审核失败';
break;
default:
$statustxt = '待审核';
}
return $statustxt;
}
}
\ No newline at end of file
<?php
namespace app\model\project;
use think\Model;
use function Symfony\Component\Translation\t;
class UserSmrz extends Model
{
protected $autoWriteTimestamp = true;
protected $createTime = 'create_time';
//用户信息
public function getuserdata()
{
return $this->belongsTo(User::class, 'user_id')
->field('username,mobile,id');
}
public function getStatusTextAttr($value, $data)
{
switch ($data['status']) {
case 1:
$statustxt = '审核失败';
break;
case 2:
$statustxt = '审核成功';
break;
default:
$statustxt = '待审核';
}
return $statustxt;
}
public function getIdcardQurlAttr($value, $data){
return get_upload_file($data['idcard_q']);
}
public function getIdcardHurlAttr($value, $data){
return get_upload_file($data['idcard_h']);
}
}
\ No newline at end of file
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