公众号消息提醒
This commit is contained in:
parent
8024023280
commit
92b948fe4e
@ -126,9 +126,9 @@ class SendMsgCronJobController extends BaseController
|
|||||||
* @param Request $request
|
* @param Request $request
|
||||||
* @return \support\Response
|
* @return \support\Response
|
||||||
*/
|
*/
|
||||||
public function studentScheduleConfirmNotifyTeacher(Request $request)
|
public function manualNotifyStudentScheduleAfterConfirm(Request $request)
|
||||||
{
|
{
|
||||||
$res = (new SendMsgCronJobService())->studentScheduleConfirmNotifyTeacher(84);
|
$res = (new SendMsgCronJobService())->manualNotifyStudentScheduleAfterConfirm(84);
|
||||||
|
|
||||||
return $this->json($res);
|
return $this->json($res);
|
||||||
}
|
}
|
||||||
@ -141,7 +141,7 @@ class SendMsgCronJobController extends BaseController
|
|||||||
*/
|
*/
|
||||||
public function alertTeacherSubmitFreeTime(Request $request)
|
public function alertTeacherSubmitFreeTime(Request $request)
|
||||||
{
|
{
|
||||||
$res = (new SendMsgCronJobService())->studentScheduleConfirmNotifyTeacher(84);
|
$res = (new SendMsgCronJobService())->alertTeacherSubmitFreeTime(1);
|
||||||
|
|
||||||
return $this->json($res);
|
return $this->json($res);
|
||||||
}
|
}
|
||||||
|
@ -7,6 +7,7 @@ use app\common\model\Student;
|
|||||||
use app\common\model\StudentHomework;
|
use app\common\model\StudentHomework;
|
||||||
use app\common\model\StudentSchedule;
|
use app\common\model\StudentSchedule;
|
||||||
use app\common\model\SubjectHomework;
|
use app\common\model\SubjectHomework;
|
||||||
|
use app\common\model\Teacher;
|
||||||
use app\common\model\TeacherScheduleTime;
|
use app\common\model\TeacherScheduleTime;
|
||||||
use app\constant\ResponseCode;
|
use app\constant\ResponseCode;
|
||||||
use think\Exception;
|
use think\Exception;
|
||||||
@ -563,9 +564,9 @@ class SendMsgCronJobService
|
|||||||
|
|
||||||
$send_teacher_data = [
|
$send_teacher_data = [
|
||||||
'touser' => 'olfLh6o4CG9xb6_tA3y29shOj_Bo',//@todo:发送人
|
'touser' => 'olfLh6o4CG9xb6_tA3y29shOj_Bo',//@todo:发送人
|
||||||
'template_id' => 'ng-vuuY_hHM3N2fR3VCGdjGldOrwmzVVQzebRgkW4uY',
|
'template_id' => 'IYIMurENbyxkQ_axIsrkjMJNb8i1AIX4qRgVUEzQX6I',
|
||||||
'data' => [
|
'data' => [
|
||||||
'thing6' => [//课程名称
|
'thing1' => [//所属课程
|
||||||
'value' => substr($subject_homework->english_name . '/' . date('m-d H:i', strtotime($subject_homework->start_time)), 0, 18) . '..',
|
'value' => substr($subject_homework->english_name . '/' . date('m-d H:i', strtotime($subject_homework->start_time)), 0, 18) . '..',
|
||||||
'color' => '#000000'
|
'color' => '#000000'
|
||||||
],
|
],
|
||||||
@ -573,11 +574,11 @@ class SendMsgCronJobService
|
|||||||
'value' => substr($subject_homework->english_name . '/' . date('m-d H:i', strtotime($subject_homework->start_time)), 0, 18) . '..',
|
'value' => substr($subject_homework->english_name . '/' . date('m-d H:i', strtotime($subject_homework->start_time)), 0, 18) . '..',
|
||||||
'color' => '#000000'
|
'color' => '#000000'
|
||||||
],
|
],
|
||||||
'thing5' => [//批改老师
|
'thing3' => [//批改老师
|
||||||
'value' => $subject_homework->teacher_name,
|
'value' => $subject_homework->teacher_name,
|
||||||
'color' => '#000000'
|
'color' => '#000000'
|
||||||
],
|
],
|
||||||
'time3' => [//作业截止时间
|
'time8' => [//机构名称
|
||||||
'value' => $next_time,
|
'value' => $next_time,
|
||||||
'color' => '#000000'
|
'color' => '#000000'
|
||||||
]
|
]
|
||||||
@ -703,7 +704,13 @@ class SendMsgCronJobService
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public function studentScheduleConfirmNotifyTeacher($student_schedule_id)
|
/**
|
||||||
|
* @desc 课程确定之后提醒学生上课
|
||||||
|
* @param $student_schedule_id
|
||||||
|
* @return array
|
||||||
|
* @throws \GuzzleHttp\Exception\GuzzleException
|
||||||
|
*/
|
||||||
|
public function manualNotifyStudentScheduleAfterConfirm($student_schedule_id)
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
$student_schedule = StudentSchedule::where(['id' => $student_schedule_id, 'is_publish' => 1])->with(['teacher', 'student', 'subject'])->findOrEmpty();
|
$student_schedule = StudentSchedule::where(['id' => $student_schedule_id, 'is_publish' => 1])->with(['teacher', 'student', 'subject'])->findOrEmpty();
|
||||||
@ -714,7 +721,6 @@ class SendMsgCronJobService
|
|||||||
|
|
||||||
|
|
||||||
//@todo:日志
|
//@todo:日志
|
||||||
|
|
||||||
$send_teacher_data = [
|
$send_teacher_data = [
|
||||||
'touser' => 'olfLh6o4CG9xb6_tA3y29shOj_Bo',//@todo:发送人
|
'touser' => 'olfLh6o4CG9xb6_tA3y29shOj_Bo',//@todo:发送人
|
||||||
'template_id' => '9zKhl4mYHNcz2jW8MGEtfZXU2M3slaIers9-NCpY4Xc',
|
'template_id' => '9zKhl4mYHNcz2jW8MGEtfZXU2M3slaIers9-NCpY4Xc',
|
||||||
@ -745,7 +751,6 @@ class SendMsgCronJobService
|
|||||||
|
|
||||||
$result = (new WechatSubscriptService())->sendMsg($send_teacher_data);
|
$result = (new WechatSubscriptService())->sendMsg($send_teacher_data);
|
||||||
|
|
||||||
//@todo:添加日志
|
|
||||||
|
|
||||||
return [
|
return [
|
||||||
'code' => ResponseCode::SUCCESS,
|
'code' => ResponseCode::SUCCESS,
|
||||||
@ -761,4 +766,60 @@ class SendMsgCronJobService
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @desc 提醒教师上传空闲时间
|
||||||
|
* @param $teacher
|
||||||
|
* @return array|void
|
||||||
|
* @throws \GuzzleHttp\Exception\GuzzleException
|
||||||
|
*/
|
||||||
|
public function alertTeacherSubmitFreeTime($teacher_id)
|
||||||
|
{
|
||||||
|
try {
|
||||||
|
$teacher = Teacher::where(['id' => $teacher_id])->findOrEmpty();
|
||||||
|
if($teacher->isEmpty()){
|
||||||
|
throw new Exception('未找到教师信息');
|
||||||
|
}
|
||||||
|
$send_teacher_data = [
|
||||||
|
'touser' => 'olfLh6o4CG9xb6_tA3y29shOj_Bo',//@todo:发送人
|
||||||
|
'template_id' => 'MGAdXtRAJ7qE8hRxFu3fWZvj8bBR-oNxx-1lenpCSAI',
|
||||||
|
'data' => [
|
||||||
|
'thing2' => [//课程名称
|
||||||
|
'value' => 'Submit free time',
|
||||||
|
'color' => '#000000'
|
||||||
|
],
|
||||||
|
'thing3' => [//任课教师
|
||||||
|
'value' => $teacher->teacher_name,
|
||||||
|
'color' => '#000000'
|
||||||
|
],
|
||||||
|
'const11' => [//上课老师
|
||||||
|
'value' => 'Submit class time!',
|
||||||
|
'color' => '#000000'
|
||||||
|
]
|
||||||
|
],
|
||||||
|
'miniprogram' => [
|
||||||
|
|
||||||
|
],
|
||||||
|
"lang" => "zh_CN",
|
||||||
|
];
|
||||||
|
|
||||||
|
$result = (new WechatSubscriptService())->sendMsg($send_teacher_data);
|
||||||
|
CronJob::create([
|
||||||
|
'msg_type' => self::ADMIN_NOTIFY_TEACHER_SUBMIT_FREE_TIME,
|
||||||
|
'teacher_id' => $teacher->id,
|
||||||
|
'send_role' => 'teacher',
|
||||||
|
'send_data' => json_encode($send_teacher_data, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES),
|
||||||
|
'msg_info' => json_encode($teacher->toArray(), JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES),
|
||||||
|
'send_result' => $result['code'] == ResponseCode::SUCCESS ? 1 : 0,
|
||||||
|
'send_result_msg' => $result['msg'],
|
||||||
|
]);
|
||||||
|
|
||||||
|
return $result;
|
||||||
|
}catch (Exception $e) {
|
||||||
|
return [
|
||||||
|
'code' => ResponseCode::FAIL,
|
||||||
|
'msg' => $e->getMessage()
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -21,7 +21,7 @@ class WechatUtil
|
|||||||
public static function getAccessToken()
|
public static function getAccessToken()
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
$str = '83_j5DK2vFkFW10x-ch2B224nQg8ham92nWB84lQ2g9H3mpnGNOt3y222t2bB1sYmHeTGg2rolyPFQ0VKeinV4vBJYiWbaxkZLHuntlpilWNDgVOR8zkr4wXev54ZoQVXeAFAHMO';
|
$str = '83_0jVm82U7ri-UENTGoTTFh2jowRpAN379ahJvK_3HpLPbdIheIr-ahgYhc5kkHv6dDYyaHklwqffKRQYOxURrQ-H8xq8kYvjoajYZQBNFhMCaBJs0VOU4PE5_-bYPUXfAAAXCF';
|
||||||
Cache::set(self::GENERAL_ACCESS_TOKEN, $str, 3500);
|
Cache::set(self::GENERAL_ACCESS_TOKEN, $str, 3500);
|
||||||
if (Cache::has(self::GENERAL_ACCESS_TOKEN)) {
|
if (Cache::has(self::GENERAL_ACCESS_TOKEN)) {
|
||||||
return Cache::get(self::GENERAL_ACCESS_TOKEN);
|
return Cache::get(self::GENERAL_ACCESS_TOKEN);
|
||||||
|
@ -2,11 +2,13 @@
|
|||||||
|
|
||||||
namespace plugin\admin\app\controller;
|
namespace plugin\admin\app\controller;
|
||||||
|
|
||||||
|
use app\constant\ResponseCode;
|
||||||
use support\Request;
|
use support\Request;
|
||||||
use support\Response;
|
use support\Response;
|
||||||
use plugin\admin\app\model\CronJob;
|
use plugin\admin\app\model\CronJob;
|
||||||
use plugin\admin\app\controller\Crud;
|
use plugin\admin\app\controller\Crud;
|
||||||
use support\exception\BusinessException;
|
use support\exception\BusinessException;
|
||||||
|
use think\Exception;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 消息任务结果
|
* 消息任务结果
|
||||||
@ -37,6 +39,47 @@ class CronJobController extends Crud
|
|||||||
return view('cron-job/index');
|
return view('cron-job/index');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function select(Request $request): Response
|
||||||
|
{
|
||||||
|
try {
|
||||||
|
$cron_job = \app\common\model\CronJob::order('id desc');
|
||||||
|
$data = $request->get();
|
||||||
|
if (isset($data['teacher_id']) && !empty($data['teacher_id'])) {
|
||||||
|
$cron_job->where('teacher_id', $data['teacher_id']);
|
||||||
|
}
|
||||||
|
if (isset($data['month']) && !empty($data['month'])) {
|
||||||
|
$cron_job->where('month', $data['month']);
|
||||||
|
}
|
||||||
|
if (isset($data['date']) && !empty($data['date'])) {
|
||||||
|
$cron_job->where('date', $data['date']);
|
||||||
|
}
|
||||||
|
|
||||||
|
$limit = (int)$request->get('limit', 10);
|
||||||
|
$limit = $limit <= 0 ? 10 : $limit;
|
||||||
|
$page = (int)$request->get('page');
|
||||||
|
$page = $page > 0 ? $page : 1;
|
||||||
|
$total = $cron_job->count();
|
||||||
|
$list = $cron_job->page($page, $limit)->select();
|
||||||
|
|
||||||
|
foreach ($list as &$item) {
|
||||||
|
$item['msg_info'] = json_decode($item['msg_info'], true);
|
||||||
|
}
|
||||||
|
|
||||||
|
return json([
|
||||||
|
'code' => ResponseCode::WEB_API_SUCCESS,
|
||||||
|
'data' => $list,
|
||||||
|
'count' => $total
|
||||||
|
]);
|
||||||
|
}catch(Exception $e){
|
||||||
|
return json([
|
||||||
|
'code' => ResponseCode::FAIL,
|
||||||
|
'msg' => $e->getMessage()
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 插入
|
* 插入
|
||||||
* @param Request $request
|
* @param Request $request
|
||||||
|
@ -152,7 +152,15 @@ class StudentScheduleController extends Crud
|
|||||||
public function update(Request $request): Response
|
public function update(Request $request): Response
|
||||||
{
|
{
|
||||||
if ($request->method() === 'POST') {
|
if ($request->method() === 'POST') {
|
||||||
return parent::update($request);
|
$result = parent::update($request);
|
||||||
|
|
||||||
|
$data = $request->post();
|
||||||
|
if (isset($data['is_publish']) && $data['is_publish']) {
|
||||||
|
$student_schedule = \app\common\model\StudentSchedule::where(['id' => $data['id']])->find();
|
||||||
|
(new SendMsgCronJobService())->teacherScheduleTimePublishMsgToStudent($student_schedule->teacher_schedule_time_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $result;
|
||||||
}
|
}
|
||||||
return view('student-schedule/update');
|
return view('student-schedule/update');
|
||||||
}
|
}
|
||||||
|
@ -197,7 +197,7 @@ class SubjectHomeworkController extends Crud
|
|||||||
'subject_file_version_url' => empty($subject_file_version_url) ? '' : json_encode($subject_file_version_url, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES),
|
'subject_file_version_url' => empty($subject_file_version_url) ? '' : json_encode($subject_file_version_url, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
if($subject_homework->homework_file_is_publish){
|
if($subject_homework->subject_file_version_is_publish){
|
||||||
//课程作业发布之后通知学生
|
//课程作业发布之后通知学生
|
||||||
(new SendMsgCronJobService())->uploadVersionSubjectHomeworkNotifyStudent($subject_homework->id);
|
(new SendMsgCronJobService())->uploadVersionSubjectHomeworkNotifyStudent($subject_homework->id);
|
||||||
}
|
}
|
||||||
|
@ -7,6 +7,7 @@ use app\common\model\StudentSchedule;
|
|||||||
use app\common\model\Subject;
|
use app\common\model\Subject;
|
||||||
use app\common\model\TeacherScheduleTime;
|
use app\common\model\TeacherScheduleTime;
|
||||||
use app\common\model\TimeZone;
|
use app\common\model\TimeZone;
|
||||||
|
use app\common\service\SendMsgCronJobService;
|
||||||
use app\constant\ResponseCode;
|
use app\constant\ResponseCode;
|
||||||
use PhpOffice\PhpSpreadsheet\Cell\Coordinate;
|
use PhpOffice\PhpSpreadsheet\Cell\Coordinate;
|
||||||
use PhpOffice\PhpSpreadsheet\IOFactory;
|
use PhpOffice\PhpSpreadsheet\IOFactory;
|
||||||
@ -476,4 +477,27 @@ class TeacherController extends Crud
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public function alterSubmitFreeTime(Request $request)
|
||||||
|
{
|
||||||
|
try {
|
||||||
|
|
||||||
|
$res = (new SendMsgCronJobService())->alertTeacherSubmitFreeTime($request->post('id'));
|
||||||
|
|
||||||
|
if($res['code'] == ResponseCode::FAIL){
|
||||||
|
throw new Exception($res['msg']);
|
||||||
|
}
|
||||||
|
|
||||||
|
return json([
|
||||||
|
'code' => ResponseCode::WEB_API_SUCCESS,
|
||||||
|
'msg' => '提醒一发送,请到【消息任务结果】查看状态'
|
||||||
|
]);
|
||||||
|
}catch (Exception $e){
|
||||||
|
return json([
|
||||||
|
'code' => ResponseCode::WEB_API_FAIL,
|
||||||
|
'msg' => $e->getMessage()
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -96,18 +96,116 @@
|
|||||||
|
|
||||||
<!-- 表格顶部工具栏 -->
|
<!-- 表格顶部工具栏 -->
|
||||||
<script type="text/html" id="table-toolbar">
|
<script type="text/html" id="table-toolbar">
|
||||||
<button class="pear-btn pear-btn-primary pear-btn-md" lay-event="add" permission="app.admin.cronjob.insert">
|
<!-- <button class="pear-btn pear-btn-primary pear-btn-md" lay-event="add" permission="app.admin.cronjob.insert">-->
|
||||||
<i class="layui-icon layui-icon-add-1"></i>新增
|
<!-- <i class="layui-icon layui-icon-add-1"></i>新增-->
|
||||||
</button>
|
<!-- </button>-->
|
||||||
<button class="pear-btn pear-btn-danger pear-btn-md" lay-event="batchRemove" permission="app.admin.cronjob.delete">
|
<!-- <button class="pear-btn pear-btn-danger pear-btn-md" lay-event="batchRemove" permission="app.admin.cronjob.delete">-->
|
||||||
<i class="layui-icon layui-icon-delete"></i>删除
|
<!-- <i class="layui-icon layui-icon-delete"></i>删除-->
|
||||||
</button>
|
<!-- </button>-->
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
||||||
|
<script type="text/html" id="msg_type">
|
||||||
|
<div>
|
||||||
|
|
||||||
|
{{# if(d.msg_type == 'teacher_schedule_time_publish_to_teacher'){ }}
|
||||||
|
<span class="layui-badge layui-bg-green">排课结果通知教师</span>
|
||||||
|
{{# }else if(d.msg_type == 'teacher_schedule_time_publish_to_student'){ }}
|
||||||
|
<span class="layui-badge layui-bg-blue">排课结果通知学生</span>
|
||||||
|
{{# }else if(d.msg_type == 'class_begin_notify_teacher'){ }}
|
||||||
|
<span class="layui-badge layui-bg-green">课程开始提醒教师</span>
|
||||||
|
{{# }else if(d.msg_type == 'subject_upload_notify_admin'){ }}
|
||||||
|
<span class="layui-badge layui-bg-red">课程作业上传提醒管理员</span>
|
||||||
|
{{# }else if(d.msg_type == 'subject_version_upload_notify_student'){ }}
|
||||||
|
<span class="layui-badge layui-bg-blue">课程报告上传提醒学生</span>
|
||||||
|
{{# }else if(d.msg_type == 'admin_notify_teacher_submit_free_time'){ }}
|
||||||
|
<span class="layui-badge layui-bg-green">教师空闲时间上传提醒</span>
|
||||||
|
{{# }else{ }}
|
||||||
|
<span class="layui-badge layui-bg-green">未知</span>
|
||||||
|
{{# } }}
|
||||||
|
</div>
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<script type="text/html" id="msg_role">
|
||||||
|
<div>
|
||||||
|
|
||||||
|
{{# if(d.send_role == 'teacher'){ }}
|
||||||
|
<span class="layui-badge layui-bg-green">教师</span>
|
||||||
|
{{# }else if(d.send_role == 'student'){ }}
|
||||||
|
<span class="layui-badge layui-bg-blue">学生</span>
|
||||||
|
{{# }else if(d.send_role == 'admin'){ }}
|
||||||
|
<span class="layui-badge layui-bg-red">管理员</span>
|
||||||
|
{{# }else{ }}
|
||||||
|
<span class="layui-badge layui-bg-red">未知</span>
|
||||||
|
{{# } }}
|
||||||
|
</div>
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<script type="text/html" id="send_result">
|
||||||
|
<div>
|
||||||
|
{{# if(d.send_result == 1){ }}
|
||||||
|
<span class="layui-badge layui-bg-green">成功</span>
|
||||||
|
{{# }else{ }}
|
||||||
|
<span class="layui-badge layui-bg-red">失败</span>
|
||||||
|
{{# } }}
|
||||||
|
</div>
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<script type="text/html" id="msg_info">
|
||||||
|
<div>
|
||||||
|
{{# if(d.msg_type == 'teacher_schedule_time_publish_to_teacher'){ }}
|
||||||
|
<div>
|
||||||
|
<span>教师:{{d.msg_info.teacher_name}}</span>
|
||||||
|
<span>课程:{{d.msg_info.english_name}}</span>
|
||||||
|
<span>本地时间:{{d.msg_info.date}} {{d.msg_info.en_time}}</span>
|
||||||
|
<span>本地时间:{{d.msg_info.date}} {{d.msg_info.en_time}}</span>
|
||||||
|
</div>
|
||||||
|
<!-- <span class="layui-badge layui-bg-orange">排课结果通知教师</span>-->
|
||||||
|
{{# }else if(d.msg_type == 'teacher_schedule_time_publish_to_student'){ }}
|
||||||
|
<div>
|
||||||
|
<span>教师:{{d.msg_info.teacherAttr.teacher_name}}</span>
|
||||||
|
<span>课程:{{d.msg_info.english_name}}</span>
|
||||||
|
<span>学生:{{d.msg_info.studentSchedule[0]['student_name']}}</span>
|
||||||
|
<span>本地时间:{{d.msg_info.date}} {{d.msg_info.en_time}}</span>
|
||||||
|
<span>本地时间:{{d.msg_info.date}} {{d.msg_info.en_time}}</span>
|
||||||
|
</div>
|
||||||
|
<!-- <span class="layui-badge layui-bg-green">排课结果通知学生</span>-->
|
||||||
|
{{# }else if(d.msg_type == 'class_begin_notify_teacher'){ }}
|
||||||
|
<div>
|
||||||
|
<span>教师:{{d.msg_info.teacher_name}}</span>
|
||||||
|
<span>课程:{{d.msg_info.english_name}}</span>
|
||||||
|
<span>本地时间:{{d.msg_info.date}} {{d.msg_info.en_time}}</span>
|
||||||
|
<span>本地时间:{{d.msg_info.date}} {{d.msg_info.en_time}}</span>
|
||||||
|
</div>
|
||||||
|
<!-- <span class="layui-badge layui-bg-green">课程开始提醒教师</span>-->
|
||||||
|
{{# }else if(d.msg_type == 'subject_upload_notify_admin'){ }}
|
||||||
|
<div>
|
||||||
|
<span>教师:{{d.msg_info.teacher_name}}</span>
|
||||||
|
<span>课程:{{d.msg_info.english_name}}</span>
|
||||||
|
<span>本地时间:{{d.msg_info.date}} {{d.msg_info.en_time}}</span>
|
||||||
|
<span>本地时间:{{d.msg_info.date}} {{d.msg_info.en_time}}</span>
|
||||||
|
</div>
|
||||||
|
<!-- <span class="layui-badge layui-bg-green">课程作业上传提醒管理员</span>-->
|
||||||
|
{{# }else if(d.msg_type == 'subject_version_upload_notify_student'){ }}
|
||||||
|
<div>
|
||||||
|
<span>教师:{{d.msg_info.teacher_name}}</span>
|
||||||
|
<span>课程:{{d.msg_info.english_name}}</span>
|
||||||
|
<span>本地时间:{{d.msg_info.date}} {{d.msg_info.en_time}}</span>
|
||||||
|
<span>本地时间:{{d.msg_info.date}} {{d.msg_info.en_time}}</span>
|
||||||
|
</div>
|
||||||
|
{{# }else if(d.msg_type == 'admin_notify_teacher_submit_free_time'){ }}
|
||||||
|
<span>教师姓名 {{d.msg_info.teacher_name}}</span>
|
||||||
|
{{# }else{ }}
|
||||||
|
<span class="layui-badge layui-bg-green">未知</span>
|
||||||
|
{{# } }}
|
||||||
|
</div>
|
||||||
|
</script>
|
||||||
|
|
||||||
|
|
||||||
<!-- 表格行工具栏 -->
|
<!-- 表格行工具栏 -->
|
||||||
<script type="text/html" id="table-bar">
|
<script type="text/html" id="table-bar">
|
||||||
<button class="pear-btn pear-btn-xs tool-btn" lay-event="edit" permission="app.admin.cronjob.update">编辑</button>
|
<button class="pear-btn pear-btn-xs tool-btn" lay-event="edit" permission="app.admin.cronjob.update">编辑</button>
|
||||||
<button class="pear-btn pear-btn-xs tool-btn" lay-event="remove" permission="app.admin.cronjob.delete">删除</button>
|
<!-- <button class="pear-btn pear-btn-xs tool-btn" lay-event="remove" permission="app.admin.cronjob.delete">删除</button>-->
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script src="/app/admin/component/layui/layui.js?v=2.8.12"></script>
|
<script src="/app/admin/component/layui/layui.js?v=2.8.12"></script>
|
||||||
@ -152,60 +250,77 @@
|
|||||||
},{
|
},{
|
||||||
title: "消息类型",align: "center",
|
title: "消息类型",align: "center",
|
||||||
field: "msg_type",
|
field: "msg_type",
|
||||||
|
templet:'#msg_type'
|
||||||
},{
|
},{
|
||||||
title: "教师",align: "center",
|
title: "教师",align: "center",
|
||||||
field: "teacher_id",
|
field: "teacher_id",
|
||||||
|
hide: true
|
||||||
},{
|
},{
|
||||||
title: "课程",align: "center",
|
title: "课程",align: "center",
|
||||||
field: "subject_id",
|
field: "subject_id",
|
||||||
|
hide: true
|
||||||
},{
|
},{
|
||||||
title: "学生",align: "center",
|
title: "学生",align: "center",
|
||||||
field: "student_id",
|
field: "student_id",
|
||||||
|
hide: true
|
||||||
},{
|
},{
|
||||||
title: "教师排课id",align: "center",
|
title: "教师排课id",align: "center",
|
||||||
field: "teacher_schedule_time_id",
|
field: "teacher_schedule_time_id",
|
||||||
|
hide: true
|
||||||
},{
|
},{
|
||||||
title: "时间段",align: "center",
|
title: "时间段",align: "center",
|
||||||
field: "time",
|
field: "time",
|
||||||
|
hide: true
|
||||||
},{
|
},{
|
||||||
title: "国外时间",align: "center",
|
title: "国外时间",align: "center",
|
||||||
field: "en_time",
|
field: "en_time",
|
||||||
|
hide: true
|
||||||
},{
|
},{
|
||||||
title: "课程开始时间",align: "center",
|
title: "课程开始时间",align: "center",
|
||||||
field: "start_time",
|
field: "start_time",
|
||||||
|
hide: true
|
||||||
},{
|
},{
|
||||||
title: "课程结束时间",align: "center",
|
title: "课程结束时间",align: "center",
|
||||||
field: "end_time",
|
field: "end_time",
|
||||||
|
hide: true
|
||||||
},{
|
},{
|
||||||
title: "国外课程开始时间",align: "center",
|
title: "国外课程开始时间",align: "center",
|
||||||
field: "en_start_time",
|
field: "en_start_time",
|
||||||
|
hide: true
|
||||||
},{
|
},{
|
||||||
title: "国外课程结束时间",align: "center",
|
title: "国外课程结束时间",align: "center",
|
||||||
field: "en_end_time",
|
field: "en_end_time",
|
||||||
|
hide: true
|
||||||
},{
|
},{
|
||||||
title: "发送角色",align: "center",
|
title: "发送角色",align: "center",
|
||||||
field: "send_role",
|
field: "send_role",
|
||||||
|
templet: '#msg_role'
|
||||||
},{
|
},{
|
||||||
title: "公众号发送数据",align: "center",
|
title: "公众号发送数据",align: "center",
|
||||||
field: "send_data",
|
field: "send_data",
|
||||||
|
hide: true
|
||||||
},{
|
},{
|
||||||
title: "发送消息信息",align: "center",
|
title: "消息内容",align: "center",
|
||||||
field: "msg_info",
|
field: "msg_info",
|
||||||
|
templet: '#msg_info'
|
||||||
},{
|
},{
|
||||||
title: "结果",align: "center",
|
title: "结果",align: "center",
|
||||||
field: "send_result",
|
field: "send_result",
|
||||||
|
templet: '#send_result'
|
||||||
},{
|
},{
|
||||||
title: "结果信息",align: "center",
|
title: "结果信息",align: "center",
|
||||||
field: "send_result_msg",
|
field: "send_result_msg",
|
||||||
},{
|
},{
|
||||||
title: "created_at",align: "center",
|
title: "发送时间",align: "center",
|
||||||
field: "created_at",
|
field: "created_at",
|
||||||
},{
|
},{
|
||||||
title: "updated_at",align: "center",
|
title: "updated_at",align: "center",
|
||||||
field: "updated_at",
|
field: "updated_at",
|
||||||
|
hide: true
|
||||||
},{
|
},{
|
||||||
title: "deleted_at",align: "center",
|
title: "deleted_at",align: "center",
|
||||||
field: "deleted_at",
|
field: "deleted_at",
|
||||||
|
hide: true
|
||||||
},{
|
},{
|
||||||
title: "操作",
|
title: "操作",
|
||||||
toolbar: "#table-bar",
|
toolbar: "#table-bar",
|
||||||
|
@ -94,8 +94,8 @@
|
|||||||
<!-- 表格行工具栏 -->
|
<!-- 表格行工具栏 -->
|
||||||
<script type="text/html" id="table-bar">
|
<script type="text/html" id="table-bar">
|
||||||
<button type="button" class="layui-btn layui-btn-xs" lay-event="edit" permission="app.admin.teacher.update">编辑</button>
|
<button type="button" class="layui-btn layui-btn-xs" lay-event="edit" permission="app.admin.teacher.update">编辑</button>
|
||||||
<!-- <button type="button" class="layui-btn layui-btn-xs layui-bg-orange" lay-event="check_schedule" permission="app.admin.teacher.update">查看排课</button>-->
|
|
||||||
<button type="button" class="layui-btn layui-btn-xs layui-bg-orange" lay-event="free_time_schedule" permission="app.admin.teacher.update">空闲时间</button>
|
<button type="button" class="layui-btn layui-btn-xs layui-bg-orange" lay-event="free_time_schedule" permission="app.admin.teacher.update">空闲时间</button>
|
||||||
|
<button type="button" class="layui-btn layui-btn-xs layui-bg-orange" lay-event="alert_notify" permission="app.admin.teacher.update">提醒空闲时间上传</button>
|
||||||
<button type="button" class="layui-btn layui-btn-xs layui-bg-blue" lay-event="rest_password" permission="app.admin.teacher.update">重置密码</button>
|
<button type="button" class="layui-btn layui-btn-xs layui-bg-blue" lay-event="rest_password" permission="app.admin.teacher.update">重置密码</button>
|
||||||
<button type="button" class="layui-btn layui-btn-xs layui-bg-red" lay-event="remove" permission="app.admin.teacher.delete">删除</button>
|
<button type="button" class="layui-btn layui-btn-xs layui-bg-red" lay-event="remove" permission="app.admin.teacher.delete">删除</button>
|
||||||
</script>
|
</script>
|
||||||
@ -190,7 +190,7 @@
|
|||||||
toolbar: "#table-bar",
|
toolbar: "#table-bar",
|
||||||
align: "center",
|
align: "center",
|
||||||
fixed: "right",
|
fixed: "right",
|
||||||
width: 265,
|
width: 390,
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
@ -223,6 +223,8 @@
|
|||||||
edit(obj);
|
edit(obj);
|
||||||
} else if (obj.event === "free_time_schedule") {
|
} else if (obj.event === "free_time_schedule") {
|
||||||
free_time_schedule(obj);
|
free_time_schedule(obj);
|
||||||
|
} else if (obj.event === "alert_notify") {
|
||||||
|
alert_notify(obj);
|
||||||
} else if (obj.event === "rest_password") {
|
} else if (obj.event === "rest_password") {
|
||||||
rest_password(obj);
|
rest_password(obj);
|
||||||
}
|
}
|
||||||
@ -321,6 +323,32 @@
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
// 表格编辑数据
|
// 表格编辑数据
|
||||||
|
let alert_notify = function(obj) {
|
||||||
|
let value = obj.data[PRIMARY_KEY];
|
||||||
|
let data = {};
|
||||||
|
data[PRIMARY_KEY] = obj.data[PRIMARY_KEY];
|
||||||
|
layer.confirm("确定给教师发送空闲时间上传提醒吗?", {
|
||||||
|
icon: 3,
|
||||||
|
title: "提示"
|
||||||
|
}, function(index) {
|
||||||
|
layer.close(index);
|
||||||
|
let loading = layer.load();
|
||||||
|
$.ajax({
|
||||||
|
url: '/app/admin/teacher/alterSubmitFreeTime',
|
||||||
|
data: data,
|
||||||
|
dataType: "json",
|
||||||
|
type: "post",
|
||||||
|
success: function(res) {
|
||||||
|
layer.close(loading);
|
||||||
|
if (res.code) {
|
||||||
|
return layui.popup.failure(res.msg);
|
||||||
|
}
|
||||||
|
return layui.popup.success("操作成功", refreshTable);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
});
|
||||||
|
}
|
||||||
|
// 表格编辑数据
|
||||||
let free_time_schedule = function(obj) {
|
let free_time_schedule = function(obj) {
|
||||||
let value = obj.data[PRIMARY_KEY];
|
let value = obj.data[PRIMARY_KEY];
|
||||||
let index = layer.open({
|
let index = layer.open({
|
||||||
|
Loading…
x
Reference in New Issue
Block a user