Commit 36dc0447 authored by wangtao's avatar wangtao

学习资料

parent 91792091
......@@ -388,7 +388,7 @@ abstract class BaseController
$v = dround($v);
break;
case '*':
break;
if ($sub[2] == 'p') $must = is_md5($v) ? false : $must;
$tip = $sub[3];
if (isset($preg[$sub[2]])) {
......@@ -444,6 +444,7 @@ abstract class BaseController
return download('.' . $fileurl, $fileinfo['filename'])->force(true);
} else {
$fileinfo = get_upload_file($fileid, 'info');
if ($fileinfo['storage'] == 'local') {
//本地文件下载
$fileurl = strstr($fileinfo['fileurl'], '/static');
......
......@@ -205,8 +205,9 @@ class Withdrawal extends AdminBase
if (empty($list)) {
throw new \Exception('没有数据');
}
$exceldata[] = ['提现单号', '用户名', '用户手机', '提现金额', '提现手续费', '实际到账金额', '提现账号', '审核状态', '打款状态', '提现时间', '打款时间'];
foreach ($list as $k => $v) {
foreach ($list as $v) {
$exceldata[] = [
$v['sn'],
......@@ -219,9 +220,10 @@ class Withdrawal extends AdminBase
$v['sh_status_text'],
$v['dk_status_text'],
$v['createtime'],
$v['dk_time'] ? date('Y-m-d H:i:s', $v['dk_time']) : '',
$v['dk_time']
];
}
$excelid = PhpOffice::exportexcel($exceldata, '提现导出');
$data['url'] = '/admin/caiwu.withdrawal/downloadfile?excel=1&fileid=' . $excelid;
return $this->returnMsg('success', 1, $data);
......
......@@ -75,6 +75,9 @@ class CertFile extends AdminBase
try {
$file = array_shift($post['upload']);
if (!isset($file['fileid']) || empty($file['fileid'])) {
return $this->returnMsg("请上传附件");
}
$data['file_id'] = $file['fileid'];
$certfileinfo = $this->certfile->where('cert_order_id', $post['cert_order_id'])->find();
if ($certfileinfo) {
......
......@@ -11,6 +11,7 @@
namespace app\admin\controller\order;
use app\admin\controller\AdminBase;
use app\event\PhpOffice;
use think\App;
use think\facade\Db;
use app\model\Payment as PaymentModel;
......@@ -84,6 +85,50 @@ class Payment extends AdminBase
}
}
//导出excel
public function excelpayment()
{
$post = input();
$map = [];
$hasmap = [];
if (isset($post['kw']) && !empty($post['kw'])) {
$map[] = ['order_no', 'like', '%' . $post['kw'] . '%'];
}
if (isset($post['user']) && !empty($post['user'])) {
$hasmap[] = ['username|mobile', 'like', '%' . $post['user'] . '%'];
}
if (isset($post['pay_status']) && $post['pay_status'] > -1) {
$map[] = ['pay_status', '=', $post['pay_status']];
}
try {
$list = $this->payment->where($map)->hasWhere('getuserdata', $hasmap)->with(['getuserdata'])->append(['pay_status_text', 'pay_method_text', 'pay_time_text', 'order_name'])->order('createtime desc')->select()->toArray();
if (empty($list)) {
throw new \Exception('没有数据');
}
$exceldata[] = ['支付单号', '用户名', '用户手机', '支付详细', '支付金额', '支付状态', '支付类型', '支付时间', '创建时间'];
foreach ($list as $k => $v) {
$exceldata[] = [
$v['order_no'],
$v['getuserdata']['username'],
$v['getuserdata']['mobile'],
$v['order_name'],
$v['pay_amount'],
$v['pay_status_text'],
$v['pay_method_text'],
$v['pay_time_text'],
$v['createtime']
];
}
$excelid = PhpOffice::exportexcel($exceldata, '订单导出');
$data['url'] = '/admin/order.payment/downloadfile?excel=1&fileid=' . $excelid;
return $this->returnMsg('success', 1, $data);
} catch (\Exception $e) {
return $this->returnMsg($e->getMessage());
}
}
}
\ No newline at end of file
......@@ -36,7 +36,7 @@ class Business extends AdminBase
$map[] = ['business.status', '=', $post['status']];
}
$list = $this->business->hasWhere('getuserdata', $hasmap)->where($map)->with(['getuserdata'])->append(['addressxx', 'status_text'])->paginate($post['limit']);
$list = $this->business->hasWhere('getuserdata', $hasmap)->where($map)->with(['getuserdata'])->append(['addressxx', 'status_text'])->order('id desc')->paginate($post['limit']);
return $this->returnMsg($list);
}
......
......@@ -37,7 +37,7 @@ class School extends AdminBase
$map[] = ['school.status', '=', $post['status']];
}
$list = $this->school->hasWhere('getuserdata',$hasmap)->where($map)->with(['getuserdata'])->append(['addressxx','status_text'])->paginate($post['limit']);
$list = $this->school->hasWhere('getuserdata',$hasmap)->where($map)->with(['getuserdata'])->append(['addressxx','status_text'])->order('id desc')->paginate($post['limit']);
return $this->returnMsg($list);
}
......
......@@ -33,7 +33,7 @@ class Smrz extends AdminBase
$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']);
$list = $this->smrz->hasWhere('getuserdata',$hasmap)->where($map)->with(['getuserdata'])->append(['status_text','idcard_qurl','idcard_hurl'])->order('id desc')->paginate($post['limit']);
return $this->returnMsg($list);
}
......
......@@ -39,7 +39,7 @@ class User extends AdminBase
}
$list = $this->user->where($map)->append(['headericourl', 'sexdata', 'roletxt'])->paginate($post['limit']);
$list = $this->user->where($map)->append(['headericourl', 'sexdata', 'roletxt'])->order('id desc')->paginate($post['limit']);
return $this->returnMsg($list);
}
......
......@@ -30,7 +30,7 @@ class UserExpLog extends AdminBase
$hasmap[] = ['username|mobile', 'like', '%' . $post['kw'] . '%'];
}
$list = $this->userexplog->hasWhere('getuserdata', $hasmap)->with(['getuserdata', 'getruledata'])->paginate($post['limit']);
$list = $this->userexplog->hasWhere('getuserdata', $hasmap)->with(['getuserdata', 'getruledata'])->order('id desc')->paginate($post['limit']);
return $this->returnMsg($list);
}
......
......@@ -83,8 +83,8 @@
, elemList: $('#certuploadlist') //列表元素对象
, url: '/admin/system.upload/upfile?action=file' //此处用的是第三方的 http 请求演示,实际使用时改成您自己的上传接口即可。
, accept: 'file'
, multiple: true
, number: 1
// , multiple: false
// , number: 1
, auto: false
, bindAction: '#testListAction'
, choose: function (obj) {
......@@ -115,7 +115,8 @@
uploadListIns.config.elem.next()[0].value = ''; //清空 input file 值,以免删除后出现同名文件不可选
});
that.elemList.append(tr);
// that.elemList.append(tr);
that.elemList.html(tr);
element.render('progress'); //渲染新加的进度条组件
});
}
......@@ -123,6 +124,8 @@
var that = this;
//if(res.code == 0){ //上传成功
element.progress('progress-demo-' + index,'100%'); //执行进度条。n 即为返回的进度百分比
var tr = that.elemList.find('tr#upload-' + index)
, tds = tr.children();
that.elemList.find('tr#upload-' + index).append('<input type="hidden" name="upload[' + index + '][fileid]" value="' + res.data.fileid + '">');
......@@ -142,7 +145,12 @@
tds.eq(3).find('.demo-reload').removeClass('layui-hide'); //显示重传
}
, progress: function (n, elem, e, index) { //注意:index 参数为 layui 2.6.6 新增
element.progress('progress-demo-' + index, n + '%'); //执行进度条。n 即为返回的进度百分比
if(n >= 95){
element.progress('progress-demo-' + index,'95%'); //执行进度条。n 即为返回的进度百分比
}else{
element.progress('progress-demo-' + index, n + '%'); //执行进度条。n 即为返回的进度百分比
}
}
});
});
......
......@@ -30,6 +30,7 @@
<div class="layui-inline">
<div class="layui-btn-group">
<button class="layui-btn" lay-submit lay-filter="search-payment"><i class="layui-icon layui-icon-search"></i> 搜索</button>
<button class="layui-btn" lay-submit lay-filter="excel-payment"><i class="layui-icon layui-icon-download-circle"></i> 导出</button>
<a class="layui-btn" lay-submit lay-filter="search-payment-all" onclick="$('#payment-groupid').val('')"><i class="layui-icon layui-icon-light"></i>全部</a>
......@@ -104,6 +105,35 @@
},'post',{headersToken:true});
});
form.on('submit(excel-payment)', function(data){
var checkStatus = table.checkStatus('payment');
var checkRows = checkStatus.data;
var ids = checkRows.map(function(d){return d.id;});
var field = data.field; // 获得表单字段
field.ids = ids;
layer.load();
$.ajax({
method: "post",
url: app_root+'/excelpayment',
data: field,
dataType: "json",
success: function (res){
layer.closeAll();
if(res.code===1) {
window.location.href = res.data.url;
}else{
layer.msg(res.msg,{icon:2,shade:[0.4,'#000'],time:1500},function (){
});
}
}
});
return false; // 阻止默认 form 跳转
});
/*快编监听*/
table.on('edit(payment)',function(obj){
admin.req(app_root+"editup",{id:obj.data.id,av:obj.value,af:obj.field},function(res){
......
......@@ -140,7 +140,7 @@ class Course extends BaseController
// ->with(['getTeacher','getSections'=>['getCourseClass'],'getCourseClass'])
->getCourseDetail($data['course_id'],$userId);
CourseModel::where('id',$request->param('course_id'))->inc('click')->update([]);
event('Course', ['course_id' => $data['course_id'], 'tasktype' => 'course', 'action' => 'courseupdateclick']); //同步数据
return $this->returnMsg('success',1,$data);
}
......
......@@ -173,7 +173,7 @@ class CourseProgress extends BaseController
// 更新播放量
CourseModel::where('id', $courseId)->inc('tvclick')->update();
CourseClass::where('id', $class_id)->inc('tvclick')->update();
event('Course', ['course_id' => $courseId, 'tasktype' => 'course', 'action' => 'courseupdateclick']); //同步数据
//添加作业
// CourseProgressService::addUserWork($userId, $courseId);
......
......@@ -8,6 +8,7 @@ use app\api\validate\CourseUserWorkValidate;
use app\BaseController;
use app\model\CertTag;
use app\model\CourseUserWork as CourseUserWorkModel;
use app\model\system\SystemUploadFile;
use app\Request;
class CourseUserWork extends BaseController
......@@ -54,12 +55,29 @@ class CourseUserWork extends BaseController
return $vo;
}
$parm = $request->param();
$info = CourseUserWorkModel::where('id', $parm['user_work_id'])
$detail = CourseUserWorkModel::where('id', $parm['user_work_id'])
->with(['userprofile', 'course', 'courseWork'])
->append(['status_text', 'filelist'])
->find($parm['user_work_id']);
->find($parm['user_work_id'])
->toArray();
return $this->returnMsg('success', 1, $info);
// 处理 courseWork 文件 课程作业附件
if (!empty($detail['courseWork']['file_id_str'])) {
$fileIds = is_string($detail['courseWork']['file_id_str'])
? explode(',', $detail['courseWork']['file_id_str'])
: (array)$detail['courseWork']['file_id_str'];
$detail['courseWork']['file'] = SystemUploadFile::whereIn('fileid', $fileIds)
->field('fileurl,fileid,filename,filetype')
->select()
->toArray();
} else {
$detail['courseWork']['file'] = [];
}
return $this->returnMsg('success', 1, $detail);
}
//学员作业考核
......
......@@ -307,7 +307,9 @@ class Project extends BaseController
$data['sn'] = UtilService::generateCompactOrderNo(null, 'xm');
$data['user_id'] = $request->userId;
$data['put_end_time'] = strtotime($data['put_end_time']);
if(empty($data['thumb'])){
$data['thumb'] = vconfig('project_default_id');
}
try {
// 开启事务
Db::startTrans();
......
......@@ -30,7 +30,7 @@ class Cert extends BaseController
$query = CertOrder::where($where)
// ->append(['otherFileList'])
// ->with(['headImg','idcardQ','idcardH'])
->with(['certfiledata'=>['certfile']])
->alias('co')
->join('cert c', 'c.id = co.cert_id')
->field([
......
......@@ -22,6 +22,7 @@ define('VT_DS', DIRECTORY_SEPARATOR);
define('VT_DIR', '');
// 全局静态目录
define('VT_STATIC', VT_DIR . '/static/');
// 项目目录
define('ROOT_PATH', realpath(dirname(__DIR__)) . VT_DS);
// 站点目录
......
......@@ -146,10 +146,11 @@ class PhpOffice
$writer->save($tempFile);
// 设置路径
$fileurl = VT_STATIC . 'downexcel/' . date('Ymd') . '/';
$savePath = VT_PUBLIC . $fileurl;
$savePath = ROOT_PATH . 'public' . $fileurl;
// 创建目录
if (!is_dir($savePath)) {
mkdir($savePath, 0755, true);
mkdir($savePath, 0757, true);
}
// 设置文件名
$filename = uniqid() . '.xlsx';
......@@ -176,8 +177,10 @@ class PhpOffice
public static function ossdowntem($filePath)
{
//保存阿里云上面的地址
$filePath = str_replace(vconfig('aliyun_domain').'/', "", $filePath);
$domain = str_replace('https://' . vconfig('aliyun_bucket') . '.', "", vconfig('aliyun_domain'));
$domain_oss = strstr($filePath, '/public', true);
$filePath = str_replace($domain_oss . '/', "", $filePath);
$domain = str_replace('https://' . vconfig('aliyun_bucket') . '.', "", $domain_oss);
// $filePath = strstr($filePath, 'public/');
// 1. 初始化OSS客户端
......@@ -197,12 +200,17 @@ class PhpOffice
/*
* 从阿里云oss文件保存到本地
*/
public static function ossdownfile($filePath,$downpath='')
public static function ossdownfile($filePath, $downpath = '')
{
// $domain = vconfig('aliyun_domain_down');
// $filePath_domain = strstr($filePath, '/public', true);
// if ($filePath_domain != $domain) {
// $domain = vconfig('domain_down');
// }
$domain_oss = strstr($filePath, '/public', true);
//保存阿里云上面的地址
$filePath = str_replace(vconfig('aliyun_domain').'/', "", $filePath);
$domain = str_replace('https://' . vconfig('aliyun_bucket') . '.', "", vconfig('aliyun_domain'));
$filePath = str_replace($domain_oss . '/', "", $filePath);
$domain = str_replace('https://' . vconfig('aliyun_bucket') . '.', "", $domain_oss);
// $filePath = strstr($filePath, 'public/');
// 1. 初始化OSS客户端
$ossClient = new OssClient(vconfig('access_key_id'), vconfig('access_key_secret'), $domain);
......
......@@ -127,6 +127,8 @@ class Jobtask
//更新销量阅读量
$courseinfo = CourseModel::field('id,click,tvclick')->where('id', $data['course_id'])->find();
ShCourse::update($courseinfo);
}
......
......@@ -100,7 +100,7 @@ class ProjectPut extends Model
public function project()
{
return $this->belongsTo(Project::class, 'project_id', 'id')->field('id,sn,title,yusuan,user_id,zhouqi');
return $this->belongsTo(Project::class, 'project_id', 'id')->field('id,sn,title,yusuan,user_id,zhouqi,description,content');
}
}
\ No newline at end of file
......@@ -16,8 +16,6 @@ class UserWithdrawal extends Model
protected $autoWriteTimestamp = true;
protected $createTime = 'createtime';
protected $updateTime = false;
protected $dk_time = 'dk_time';
use SoftDelete;
......
......@@ -7,7 +7,7 @@ return [
// 默认日志记录通道
'default' => env('log.channel', 'file'),
// 日志记录级别
'level' => ['error','info','debug','notice','warning','sql'],
'level' => ['error','info'],
// 日志类型记录的通道 ['error'=>'email',...]
'type_channel' => [],
// 关闭全局日志写入
......
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