Commit 7c4b1db5 authored by wangtao's avatar wangtao

证书管理 会员管理 广告管理

parent fd62cef4
......@@ -4,4 +4,5 @@ namespace app;
// 应用请求对象类
class Request extends \think\Request
{
}
\ No newline at end of file
......@@ -77,12 +77,6 @@ class Cert extends AdminBase
$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("删除失败");
......
......@@ -36,7 +36,7 @@ class CertCategory extends AdminBase
{
if ($do == 'json') {
$list = $this->certcategory->where('is_del', 0)->select()->toArray();
$list = $this->certcategory->where('is_del', 0)->select()->append(['thumbpath'])->toArray();
return $this->returnMsg($list);
}
return $this->fetch('', '', false);
......
......@@ -73,12 +73,6 @@ class CertOrder extends AdminBase
$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("删除失败");
......
<?php
/**
* ===========================================================================
* Veitool 快捷开发框架系统
* Author: Niaho 26843818@qq.com
* Copyright (c)2019-2025 www.veitool.com All rights reserved.
* Licensed: 这不是一个自由软件,不允许对程序代码以任何形式任何目的的再发行
* ---------------------------------------------------------------------------
*/
namespace app\admin\controller\project;
use app\admin\controller\AdminBase;
use app\model\Project as ProjectModel;
use think\App;
use think\facade\Db;
use app\model\projectCategory;
/**
* 后台主控制器
*/
class Project extends AdminBase
{
protected $project;
public function __construct(App $app)
{
parent::__construct($app);
$this->project = new ProjectModel();
}
// 列表
public function index(string $do = '')
{
$limit = 10;
if ($do == 'json') {
$post = input();
$post['limit'] = isset($post['limit']) ? $post['limit'] : $limit;
$map = [];
$hasmap = [];
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']];
}
if (isset($post['sh_status']) && $post['sh_status'] > -1) {
$map[] = ['sh_status', '=', $post['sh_status']];
}
if (isset($post['status']) && $post['status'] > -1) {
$map[] = ['project.status', '=', $post['status']];
}
if (isset($post['user']) && !empty($post['user'])) {
$hasmap[] = ['username|mobile', 'like', '%' . $post['user'] . '%'];
}
$list = $this->project->where($map)->hasWhere('getuserdata', $hasmap)->with(['projectcatedata','getuserdata'])->append(['sh_status_text','status_text'])->order('createtime desc')->paginate($post['limit']);
return $this->returnMsg($list);
}
$category = projectCategory::field('*,pid as parentid')->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->project->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->project->destroy([$ids])) {
return $this->returnMsg("删除成功", 1);
} else {
return $this->returnMsg("删除失败");
}
}
//详情
public function detail()
{
$post = input();
$info = $this->project->where('id', $post['id'])->with(['projectcatedata','getuserdata'])->find()->append(['sh_status_text','status_text']);
$this->assign('info', $info);
return $this->fetch('', '', false);
}
//审核
public function shenheproject()
{
$post = input();
$errordesc = '';
$shstatus = 2;
if ($post['shstatus'] == 2) {
if (empty($post['errordesc'])) {
return $this->returnMsg("请输入失败原因");
}
$errordesc = $post['errordesc'];
$shstatus = 1;
$updatedata['status'] = 0;
}
$updatedata['sh_status'] = $shstatus;
$updatedata['sh_status_desc'] = $errordesc;
$result = $this->project->where('id', $post['id'])->update($updatedata);
if ($result) {
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\project;
use app\admin\controller\AdminBase;
use app\model\ProjectCategory as ProjectCategoryModel;
use think\App;
use think\facade\Db;
use think\facade\Validate;
use think\facade\Env;
/**
* 后台主控制器
*/
class ProjectCategory extends AdminBase
{
protected $projectcategory;
public function __construct(App $app)
{
parent::__construct($app);
$this->projectcategory = new ProjectCategoryModel();
}
//分类列表
public function index(string $do = '')
{
if ($do == 'json') {
$list = $this->projectcategory->select()->append(['thumbpath'])->toArray();
return $this->returnMsg($list);
}
return $this->fetch('', '', false);
}
//快速编辑
public function editup()
{
$post = input();
$this->projectcategory->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->projectcategory->update($post, ['id' => $post['id']]);
} else {
unset($post['id']);
$post['createtime'] = time();
$msg = '添加成功';
$this->projectcategory->save($post);
}
} catch (\Exception $e) {
return $this->returnMsg($e->getMessage(), 0);
}
return $this->returnMsg($msg, 1);
}
$data = Db::name('project_category')->where('id',$post['id'])->find();
$categorydata = $this->projectcategory->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->projectcategory->destroy([$ids])) {
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\project;
use app\admin\controller\AdminBase;
use app\model\ProjectPut as ProjectPutModel;
use think\App;
use think\facade\Db;
use app\model\projectCategory;
/**
* 后台主控制器
*/
class ProjectPut extends AdminBase
{
protected $projectput;
public function __construct(App $app)
{
parent::__construct($app);
$this->projectput = new ProjectPutModel();
}
// 列表
public function index(string $do = '')
{
$limit = 10;
if ($do == 'json') {
$post = input();
$post['limit'] = isset($post['limit']) ? $post['limit'] : $limit;
$map = [];
$map[] = ['project_id', '=', $post['project_id']];
$list = $this->projectput->where($map)->with(['getuserdata'])->append(['complete_status_text', 'status_text'])->order('createtime desc')->paginate($post['limit']);
return $this->returnMsg($list);
}
$this->assign('limit', $limit);
return $this->fetch('', '', false);
}
public function del()
{
$post = input();
$ids = is_array($post['id']) ? implode(',', $post['id']) : $post['id'];
if ($this->projectput->destroy([$ids])) {
return $this->returnMsg("删除成功", 1);
} else {
return $this->returnMsg("删除失败");
}
}
//详情
public function detail()
{
$post = input();
$info = $this->projectput->where('id', $post['id'])->find()->append(['file_id_str','complete_file_id_str']);
$this->assign('info', $info);
return $this->fetch('', '', false);
}
//审核
public function shenheproject()
{
$post = input();
$errordesc = '';
$shstatus = 2;
if ($post['shstatus'] == 2) {
if (empty($post['errordesc'])) {
return $this->returnMsg("请输入失败原因");
}
$errordesc = $post['errordesc'];
$shstatus = 1;
$updatedata['status'] = 0;
}
$updatedata['sh_status'] = $shstatus;
$updatedata['sh_status_desc'] = $errordesc;
$result = $this->projectput->where('id', $post['id'])->update($updatedata);
if ($result) {
return $this->returnMsg("操作成功", 1);
} else {
return $this->returnMsg("操作失败");
}
}
}
\ 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
......@@ -46,12 +46,12 @@
<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'}">
value="{$data.start_time ? $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'}">
value="{$data.end_time ? $data.end_time|date='Y-m-d' : ''}">
</div>
</div>
......
......@@ -208,7 +208,7 @@
'</video></div>'
});
}else if(obj.event === 'workdetail'){
alert(32);
courseOpen(data.id);
}
});/**/
......
{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.sn}</td>
<td class="widthtd"><strong>项目名称</strong></td>
<td>{$info.title}</td>
</tr>
<tr>
<td class="widthtd"><strong>发布者</strong></td>
<td>{$info.getuserdata.username}</td>
<td class="widthtd"><strong>类别</strong></td>
<td>{$info.projectcatedata.title}</td>
</tr>
<tr>
<td class="widthtd"><strong>项目标签</strong></td>
<td>{$info.tagstr}</td>
<td class="widthtd"><strong>预算</strong></td>
<td>{$info.yusuan}</td>
</tr>
<tr>
<td class="widthtd"><strong>周期</strong></td>
<td>{$info.zhouqi}天</td>
<td class="widthtd"><strong>创建时间</strong></td>
<td>{$info.createtime}</td>
</tr>
<tr>
<td class="widthtd"><strong>审核状态</strong></td>
<td >
{if $info.sh_status == 1}
{$info.sh_status_text} - {$info.sh_status_desc}
{else /}
{$info.sh_status_text}
{/if}
</td>
<td class="widthtd"><strong>项目状态</strong></td>
<td colspan="4">
{$info.status_text}
</td>
</tr>
<tr>
<td class="widthtd"><strong>项目简介</strong></td>
<td colspan="4">{$info.description}</td>
</tr>
</tbody>
</table>
<div class="layui-tab layui-tab-card" lay-filter="proputdemotest">
<ul class="layui-tab-title">
<li class="layui-this">项目内容</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="projectput" id="projectput"></table>
</div>
</div>
</div>
</div>
</div>
</div>
<script type="text/html" id="putstatus-demo">
{{# if (d.complete_status === 3) { }}
<a class="layui-btn layui-btn-xs layui-btn-normal" >{{=d.complete_status_text}}</a>
{{# } else { }}
{{# if(d.complete_status === 2) { }}
<a class="layui-btn layui-btn-xs layui-btn-danger" lay-event="statuserror">{{=d.complete_status_text}}</a>
{{# } else { }}
<a class="layui-btn layui-btn-xs">{{=d.complete_status_text}}</a>
{{# } }}
{{# } }}
</script>
<script type="text/html" id="put-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" >{{=d.status_text}}</a>
{{# } else { }}
<a class="layui-btn layui-btn-xs">{{=d.status_text}}</a>
{{# } }}
{{# } }}
</script>
{/block}
{block name="script"}
<script type="text/javascript">
var project_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: '#projectput',
page: true,
limit:20,
height: 'full-341',
url: map_root+"project.project_put/index?&do=json",
where:{project_id:project_id},
cols: [[
{field:'id',width:50,align:'center',title:'ID',sort:!0},
{field:'title',width:200,align:'center',title:'申请人',templet:'<div>{{= d.getuserdata.username}}</div>'},
{field:'mobile',width:120,align:'center',title:'申请人手机号',templet:'<div>{{= d.getuserdata.mobile}}</div>'},
{field:'createtime',width:150,align:'center',title:'申请日期'},
{field:'sh_status',width:100,align:'center',title:'审核状态',templet:'#put-demo'},
{field:'status',width:100,align:'center',title:'作品状态',templet:'#putstatus-demo'},
{field:'user_desc',width:300,align:'center',title:'个人介绍'},
{fixed:'right',width:130,align:'center',toolbar:'<div><a class="layui-btn layui-btn-xs" lay-event="fileclcik">查看附件</a></div>',title:'操作'}
]],
done: function(){
admin.vShow($('[lay-table-id="projectput"]'));
}
});
/*工具条监听*/
table.on('tool(projectput)', function(obj){
var data = obj.data;
if(obj.event === 'fileclcik'){
projectputOpen(data.id);
}
});/**/
//一些事件
element.on('tab(proputdemotest)', function(data){
if(data.index === 1){
table.reloadData('projectput');
}
});
});
$(".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 projectputOpen(id='',type=''){
layer.open({
type: 2,
area: ['800px', '600px'],
title: "查看附件",
btn: ['确定', '关闭'],
fixed: false, //不固定
content: '/admin/project.project_put/detail?id='+id,
yes: function(index, layero){
layer.close(index); // 关闭弹窗
},
});
}/**/
var callbackdata = function () {
};
</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="projectcategory-sz" data="1"><i class="layui-icon">&#xe624;</i>展开</a>
<a class="layui-btn" id="projectcategory-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="projectcategory" id="projectcategory"></table>
</div>
</div>
</div>
</div>
<!--JS部分-->
<script>
layui.use(['trTable','vinfo', 'buildItems'], function(){
var map_root = layui.cache.maps;
var app_root = map_root + 'project.project_category/';
var layer = layui.layer,table=layui.table,form=layui.form,admin=layui.admin,treeTable = layui.trTable;
/*渲染数据*/
var projectcategorycateTb = treeTable.render({
elem: '#projectcategory',
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="projectcategory"]')); }
});
/*展开或折叠*/
$('#projectcategory-sz').click(function(){
var ob = $(this),i,t;
if(ob.attr('data')==1){
projectcategorycateTb.expandAll();
i=0;t='<i class="layui-icon">&#xe67e;</i>折叠';
}else{
projectcategorycateTb.foldAll();
i=1;t='<i class="layui-icon">&#xe624;</i>展开';
}
ob.attr('data',i).html(t);
});/**/
/*快编监听*/
treeTable.on('edit(projectcategory)',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(projectcategory)', function(obj){
var data = obj.data;
var id = data.id;
if(obj.event === 'edit'){
projectcategoryOpen(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) projectcategorycateTb.refresh();
});
},'post',{headersToken:true});
});
}/**/
$('#projectcategory-add').on('click',function(){projectcategoryOpen();});/**/
/*弹出窗*/
function projectcategoryOpen(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);
projectcategorycateTb.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">
<table class="layui-table">
<tbody>
<tr>
<td class="widthtd"><strong>附件上传</strong></td>
<td>
<table class="layui-table">
<thead>
<tr>
<th>文件名称</th>
<th>大小</th>
<th>操作</th>
</tr>
</thead>
<tbody>
{volist name="info.file_id_str" id="data"}
<tr>
<td>{$data.filename}</td>
<td>{$data.filesize}KB</td>
<td >
{in name="data.fileext" value="jpg,png,jpeg"}
<img src="{$data.fileurl}" width="50" height="50" class="imgclick">
{else/}
<a class="layui-btn layui-btn-xs" href="/admin/course.course_work/downloadfile?fileid={$data.fileid}" target="_blank">下载</a>
{/in}
</td>
</tr>
{/volist}
</tbody>
</table>
</td>
</tr>
<tr>
<td class="widthtd"><strong>作品上传</strong></td>
<td>
<table class="layui-table">
<thead>
<tr>
<th>文件名称</th>
<th>大小</th>
<th>操作</th>
</tr>
</thead>
<tbody>
{volist name="info.complete_file_id_str" id="data"}
<tr>
<td>{$data.filename}</td>
<td>{$data.filesize}KB</td>
<td >
{in name="data.fileext" value="jpg,png,jpeg"}
<img src="{$data.fileurl}" width="50" height="50" class="imgclick">
{else/}
<a class="layui-btn layui-btn-xs" href="/admin/course.course_work/downloadfile?fileid={$data.fileid}" target="_blank">下载</a>
{/in}
</td>
</tr>
{/volist}
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</div>
{/block}
{block name="script"}
<script type="text/javascript">
var project_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;
/*解析顶部分组选项*/
});
$(".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 () {
};
</script>
{/block}
\ No newline at end of file
<?php
namespace app\api\controller\manage;
use app\api\middleware\Auth;
use app\BaseController;
use app\model\ShCourse as ShCourseModel;
use app\Request;
class ShCourse extends BaseController
{
protected $middleware = [
Auth::class,
];
//机构课程列表
public function getShCourseList(Request $request)
{
$parm = $request->param();
$where = ['is_del' => 0, 'user_id' => $request->userId];
$map = [];
if (isset($parm['searchKeyWords']) && $parm['searchKeyWords']) {
$map[] = ['title', 'like', '%' . $parm['searchKeyWords'] . '%'];
}
if (isset($parm['status']) && $parm['status']) {
$map[] = ['status', '=', $parm['status']];
}
if (isset($parm['cate_id']) && $parm['cate_id']) {
$map[] = ['cate_id', '=', $parm['cate_id']];
}
$page = $request->param('page', 1);
$pageSize = $request->param('pageSize', 10);
$list = ShCourseModel::where($where)->where($map)
->field('id,title,createtime,thumb,tag_ids,price,status,is_sell,is_del,tvclick,click,cate_id,teacher_id')
->order('createtime desc')
->append(['thumbpath','cate_name','tag_title','teacher_name','status_text'])
->paginate([
'page' => $page,
'list_rows' => $pageSize
]);
return $this->returnMsg('success', 1, $list);
}
}
\ No newline at end of file
......@@ -10,7 +10,7 @@ class TokenService
const TOKEN_PREFIX = 'user_token:';
// 过期时间(秒)
const EXPIRE = 7200; // 2小时
const EXPIRE = 72000; // 20小时
/**
* 生成用户Token
......
<?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 app\model\system\SystemUploadFile;
use think\facade\Db;
use think\Model;
use think\model\concern\SoftDelete;
/**
* 课程模型
*/
class Project extends Model
{
use SoftDelete;
protected $deleteTime = 'deletetime';
public function getCreatetimeAttr($value)
{
return date('Y-m-d H:i:s', $value);
}
public function projectcatedata()
{
return $this->hasOne(ProjectCategory::class, 'id', 'cate_id')
->field('id,title');
}
//用户信息
public function getuserdata()
{
return $this->belongsTo(User::class, 'user_id')
->field('username,mobile,id');
}
public function getShStatusTextAttr($value, $data)
{
switch ($data['sh_status']) {
case 1:
$statustxt = '审核失败';
break;
case 2:
$statustxt = '审核成功';
break;
default:
$statustxt = '待审核';
}
return $statustxt;
}
public function getStatusTextAttr($value, $data)
{
switch ($data['status']) {
case 1:
$statustxt = '招募中';
break;
case 2:
$statustxt = '进行中';
break;
case 3:
$statustxt = '待验收';
break;
case 4:
$statustxt = '已完成';
break;
case 5:
$statustxt = '已取消';
break;
default:
$statustxt = '等待审核';
}
return $statustxt;
}
}
\ 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 think\model\concern\SoftDelete;
use tool\Tree;
/**
* 模型公用类
*/
class ProjectCategory extends Model
{
use SoftDelete;
protected $deleteTime = 'deletetime';
public function catetree($cate_id = 0)
{
$category = $this->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 app\model\system\SystemUploadFile;
use think\facade\Db;
use think\Model;
/**
* 课程模型
*/
class ProjectPut extends Model
{
public function getCreatetimeAttr($value)
{
return date('Y-m-d H:i:s', $value);
}
public function getFileIdStrAttr($value, $data)
{
return get_upload_file($data['file_id_str'],'list');
}
public function getCompleteFileIdStrAttr($value, $data)
{
return get_upload_file($data['complete_file_id_str'],'list');
}
//用户信息
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 getCompleteStatusTextAttr($value, $data)
{
switch ($data['complete_status']) {
case 1:
$statustxt = '验收中';
break;
case 2:
$statustxt = '验收失败';
break;
case 3:
$statustxt = '验收成功';
break;
default:
$statustxt = '未上传';
}
return $statustxt;
}
}
\ 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