作者 lihan

后台批次加入报名截止日期功能

前台列表页数据
详情页数据
评论功能
<?php
namespace app\activity\controller;
use cmf\controller\HomeBaseController;
use app\activity\model\ActivityModel;
use think\Db;
/**
* @title 活动模块
*/
class ActivityController extends HomeBaseController {
class ActivityController extends HomeBaseController
{
/**
* @title 接口返回参数说明
* @title 活动列表
* @description 默认访问接口
* @author sᴏᴜʟ ᴏғ ᴄɪɴᴅᴇʀ
* @url /activity/Activity/_list
* @method POST
*
* @return version:版本号
* @return code:错误码
*/
public function _list()
{
//首页轮播图
$banner = Db::name('slide_item')->field('image,url')->where(['slide_id' => 1])->order('list_order')->select();
//分类
$type = Db::name('type')->field('type_name,type_url,type_icon')->order('listorder')->select();
//活动
$model = new ActivityModel;
$activity = $model->activityList('', time(), session('user.id'));
$result = [
'banner' => $banner,
'type' => $type,
'activity' => $activity
];
//
echo json_encode(['data' => $result, 'code' => 20000]);
exit();
}
/**
* @title 活动详情
* @description 默认访问接口
* @author sᴏᴜʟ ᴏғ ᴄɪɴᴅᴇʀ
* @url /activity/Activity/detail
* @method POST
*
* @param name:id type:char require:1 default:lihan other: desc:活动id
* @param name:id type:int require:1 default:lihan other: desc:活动id
*/
public function detail()
{
$request = request();
if ($request->isPost()) {
$id = $request->param('id');
$activity = new ActivityModel;
$info = $activity->activityDetail($id);
if (!empty($info)) {
echo json_encode(['data' => $info, 'code' => 20000]);
exit();
} else {
echo json_encode(['msg' => '暂无数据', 'code' => 40000]);
exit();
}
}
}
/**
* @title 收藏
* @description 默认访问接口
* @author sᴏᴜʟ ᴏғ ᴄɪɴᴅᴇʀ
* @url /activity/Activity/collectDo
* @method POST
*
* @param name:id type:int require:1 default:2 other: desc:活动id
*/
public function collectDo()
{
$request = request();
if ($request->isPost()) {
$collect = new ActivityModel;
$activityId = $request->param('id');
$return = $collect->collect($activityId, session('user.id'));
echo $return;
exit();
} else {
echo json_encode(['msg' => '非法操作', 'code' => 40000]);
exit();
}
}
/**
* @title 活动评价
* @description 默认访问接口
* @author sᴏᴜʟ ᴏғ ᴄɪɴᴅᴇʀ
* @url /activity/Activity/comment
* @method POST
*
* @param name:activity_id type:int require:1 default:14 other: desc:活动id
* @param name:rank_synthetical type:int require:1 default:5 other: desc:综合评价等级
* @param name:rank_service type:int require:1 default:5 other: desc:服务评价等级
* @param name:rank_journey type:int require:1 default:5 other: desc:行程评价等级
* @param name:content type:text require:1 default:非常好 other: desc:评价内容
*/
public function detail() {
$request=request();
$id=$request->param('id');
$info=Db::name('activity')->where(['id'=>$id])->find();
$
public function comment()
{
$request = request();
if ($request->isPost()) {
$post = $request->param();
$post['user_id'] = session('user.id');
$post['comment_time'] = time();
if (Db::name('activity_comment')->insert($post)) {
echo json_encode(['msg' => '评价成功', 'code' => 20000]);
exit();
} else {
echo json_encode(['msg' => '评价失败', 'code' => 40000]);
exit();
}
} else {
echo json_encode(['msg' => '非法操作', 'code' => 40000]);
exit();
}
}
}
... ...
<?php
/**
* Created by PhpStorm.
* User: yhbr
* Date: 2018/9/4
* Time: 9:53
*/
namespace app\activity\model;
use think\Model;
use think\Db;
class ActivityModel extends Model
{
/**
* @param null $tId
* @param $nowTime
* @param $userId
* @return false|\PDOStatement|string|\think\Collection
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function activityList($tId = null, $nowTime, $userId)
{
$where = [];
if ($tId != null) {
$where['t_id'] = ['eq', $tId];
}
$res = Db::name('activity')->field('id,name,thumb')->where($where)->select()->toArray();
//只显示还未到报名日期活动最近的一条行程
foreach ($res as $key => $item) {
$item['is_collect'] = $this->isCollect($item['id'], $userId);
$item['schedule'] = $this->latestSchedule($item['id'], $nowTime);
$res[$key] = $item;
if (empty($item['schedule'])) {
unset($res[$key]);
}
}
return array_values($res);
}
public function activityDetail($activityId)
{
$info = Db::name('activity')->field('banner,name,is_down_payment,down_price,content,notice')->where(['id' => $activityId])->find();
if (!empty($info)) {
$arr = explode(',', $info['banner']);
$banner = [];
for ($i = 0; $i < count($arr); $i++) {
$banner[$i] = $arr[$i];
}
$info['banner'] = $banner;
$info['schedule'] = $this->allSchedule($activityId);
$info['comment_list'] = $this->getCommentListByActivityId($activityId);
return $info;
} else {
return null;
}
}
private function allSchedule($activityId)
{
$res = Db::name('activity_schedule')->field('start_time,end_time,price')->where(['activity_id' => $activityId])->select();
foreach ($res as $k => $v) {
$v['start_time'] = date('Y-m-d', $v['start_time']);
$v['end_time'] = date('Y-m-d', $v['end_time']);
$res[$k] = $v;
}
return $res;
}
/**
* 获取应显示的活动批次,距离当前最近的批次
* @param $activityId
* @param $nowTime
* @return array|false|\PDOStatement|string|Model
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
private function latestSchedule($activityId, $nowTime)
{
$where['activity_id'] = ['eq', $activityId];
$where['deadline'] = ['gt', $nowTime];
$schedule = Db::name('activity_schedule')->field('start_time,price,real_join_num,addition_join_num,maximum')->where($where)->order('deadline')->select()->toArray();
foreach ($schedule as $k => $v) {
$v['start_time'] = date('Y-m-d', $v['start_time']);
$v['sales_num'] = $v['real_join_num'] + $v['addition_join_num'];
$v['residue_num'] = $v['maximum'] - $v['sales_num'];
unset($v['real_join_num']);
unset($v['addition_join_num']);
unset($v['maximum']);
$schedule[$k] = $v;
}
if (!empty($schedule)) {
return $schedule[0];
} else {
return null;
}
}
/**
* 收藏活动
* @param $activityId
* @param $userId
* @return bool|string
* @throws \think\Exception
* @throws \think\exception\PDOException
*/
public function collect($activityId, $userId)
{
$where = [
'user_id' => $userId,
'activity_id' => $activityId
];
$isCollected = Db::name('collect')->where($where)->value('id');
if ($isCollected) {
if (Db::name('collect')->delete($isCollected)) {
return json_encode(['msg' => '取消收藏', 'status' => true]);
} else {
return false;
}
} else {
if (Db::name('collect')->insert(['user_id' => $userId, 'activity_id' => $activityId])) {
return json_encode(['msg' => '收藏成功', 'status' => true]);
} else {
return false;
}
}
}
/**
* 判断谁否收藏
* @param $activityId
* @param $userId
* @return int|string
*/
private function isCollect($activityId, $userId)
{
$isCollected = Db::name('collect')->where(['activity_id' => $activityId, 'user_id' => $userId])->count();
return $isCollected;
}
/**
* 活动评价列表
* @param $activityId
* @return false|\PDOStatement|string|\think\Collection
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
private function getCommentListByActivityId($activityId)
{
$res = Db::name('activity_comment')->alias('c')
->field('c.rank_synthetical,c.comment_time,c.content,u.user_nickname,avatar')
->join('user u', 'c.user_id=u.id')
->where(['c.activity_id' => $activityId])
->select();
foreach ($res as $k => $v) {
$v['comment_time'] = date('Y.m.d', $v['comment_time']);
$res[$k] = $v;
}
return $res;
}
}
\ No newline at end of file
... ...
... ... @@ -74,6 +74,7 @@ class ActivityController extends AdminBaseController {
'end_time' => strtotime($schedule[$i]['end_time']),
'price' => $schedule[$i]['price'],
'maximum' => $schedule[$i]['maximum'],
'deadline' => strtotime($schedule[$i]['deadline'])
];
}
if(Db::name('activity_schedule')->insertAll($data)) {
... ... @@ -145,6 +146,7 @@ class ActivityController extends AdminBaseController {
'end_time' => strtotime($schedule[$i]['end_time']),
'price' => $schedule[$i]['price'],
'maximum' => $schedule[$i]['maximum'],
'deadline' => strtotime($schedule[$i]['deadline'])
];
}
if(Db::name('activity_schedule')->insertAll($data)) {
... ...
... ... @@ -4,7 +4,7 @@ use cmf\controller\HomeBaseController;
use Think\Db;
/**
* @title 萨米户外
* @title 出行人模块
*/
class EscortController extends HomeBaseController
{
... ... @@ -13,8 +13,7 @@ class EscortController extends HomeBaseController
{
header("Access-Control-Allow-Origin: *"); // 允许任意域名发起的跨域请求
header('Access-Control-Allow-Headers: X-Requested-With,X_Requested_With');
$this->userId = (empty($_POST['user_id'])) ? null : $_POST['user_id'];
if (empty($this->userId)) {
if (empty(session('user.id'))) {
echo json_encode(['msg' => '登陆失败', 'code' => 40001]);
exit();
}
... ... @@ -26,7 +25,6 @@ class EscortController extends HomeBaseController
* @author sᴏᴜʟ ᴏғ ᴄɪɴᴅᴇʀ
* @url /escort/Escort/add
* @method POST
* @module 出行人模块
*
* @param name:name type:char require:1 default:lihan other: desc:出行人姓名
* @param name:sex type:tinyint require:1 default:0 other: 0 desc:出行人性别 0男 1女
... ... @@ -40,7 +38,7 @@ class EscortController extends HomeBaseController
{
$request = request();
if ($request->isPost()) {
$userId = $this->userId;
$userId = session('user.id');
if (!empty($userId)) {
$post = $request->param();
if (empty($post['name'])) {
... ... @@ -83,7 +81,6 @@ class EscortController extends HomeBaseController
* @author sᴏᴜʟ ᴏғ ᴄɪɴᴅᴇʀ
* @url /escort/Escort/edit
* @method POST
* @module 出行人模块
*
* @param name:id type:int require:1 default:2 desc:出行人id
* @param name:name type:char require:1 default:lihan other: desc:出行人姓名
... ... @@ -96,7 +93,7 @@ class EscortController extends HomeBaseController
{
$request = request();
if ($request->isPost()) {
$userId = $this->userId;
$userId = session('user.id');
if (!empty($userId)) {
$post = $request->param();
if (empty($post['name'])) {
... ... @@ -115,7 +112,6 @@ class EscortController extends HomeBaseController
echo json_encode(['msg' => '请填写出行人微信号', 'code' => 40000]);
exit();
}
$post['user_id'] = $userId;
if (Db::name('escort')->update($post)) {
echo json_encode(['msg' => '编辑成功', 'code' => 20000]);
exit();
... ... @@ -139,7 +135,6 @@ class EscortController extends HomeBaseController
* @author sᴏᴜʟ ᴏғ ᴄɪɴᴅᴇʀ
* @url /escort/Escort/del
* @method POST
* @module 出行人模块
*
* @param name:id type:int require:1 default:2 desc:出行人id
*/
... ... @@ -147,7 +142,7 @@ class EscortController extends HomeBaseController
{
$request = request();
if ($request->isPost()) {
$userId = $this->userId;
$userId = session('user.id');
if (!empty($userId)) {
if (Db::name('escort')->delete($request->param('id'))) {
echo json_encode(['msg' => '删除成功', 'code' => 20000]);
... ... @@ -172,9 +167,6 @@ class EscortController extends HomeBaseController
* @author sᴏᴜʟ ᴏғ ᴄɪɴᴅᴇʀ
* @url /escort/Escort/_list
* @method POST
* @module 出行人模块
*
* @param name:user_id type:int require:1 default:1 desc:用户id
*
* @return id:出行人id
* @return name:出行人姓名
... ... @@ -184,7 +176,7 @@ class EscortController extends HomeBaseController
public function _list()
{
$request = request();
$userId = $this->userId;
$userId = session('user.id');
if ($request->isPost()) {
$data = Db::name('escort')->field('id,name,tel,identity')->where(['user_id' => $userId])->select()->toArray();
if (!empty($data)) {
... ...
... ... @@ -9,28 +9,37 @@
namespace app\portal\controller;
use cmf\controller\HomeBaseController;
use think\Db;
use app\activity\model\ActivityModel;
use EasyWeChat\Foundation\Application;
/**
* @title 欢迎页
* @description 欢迎使用在线接口文档
*/
class IndexController extends HomeBaseController {
class IndexController extends HomeBaseController
{
function __construct()
{
session('user.id', 2);
}
/**
* @title 接口返回参数说明
* @description 默认访问接口
* @author sᴏᴜʟ ᴏғ ᴄɪɴᴅᴇʀ
* @url /portal/index/index
* @url /portal/index/api
* @method GET
*
* @return version:版本号
* @return code:错误码
*/
public function index()
public function api()
{
$data=[
$data = [
'version' => '1.0.0',
'code'=>[
'code' => [
'20000' => '默认成功返回码',
'40000' => '默认错误返回码',
'40001' => '未登录或登录失效',
... ... @@ -39,8 +48,14 @@ class IndexController extends HomeBaseController {
'40004' => '登录失败',
]
];
echo json_encode(['msg'=>$data]);
echo json_encode(['msg' => $data]);
exit();
}
}
public function index()
{
}
}
\ No newline at end of file
... ...
... ... @@ -85,7 +85,7 @@
<input id="B" type="button" value="新增" style="display: none;">
<div id="schedule" style="margin-bottom: 20px">
<li id="li_0">开始时间:<input required autocomplete="off" onclick="showDate()" class="form-control js-bootstrap-datetime detail" type="text" name="schedule[0][start_time]">&nbsp;&nbsp;结束时间:<input required autocomplete="off" onclick="showDate()" class="form-control js-bootstrap-datetime detail" type="text" name="schedule[0][end_time]">&nbsp;&nbsp;价格:<input required autocomplete="off" class="form-control detail" type="text" name="schedule[0][price]">&nbsp;&nbsp;允许参加人数:<input required autocomplete="off" class="form-control detail" type="text" name="schedule[0][maximum]">&nbsp;&nbsp;</li>
<li id="li_0">开始时间:<input required autocomplete="off" onclick="showDate()" class="form-control js-bootstrap-datetime detail" type="text" name="schedule[0][start_time]">&nbsp;&nbsp;结束时间:<input required autocomplete="off" onclick="showDate()" class="form-control js-bootstrap-datetime detail" type="text" name="schedule[0][end_time]">&nbsp;&nbsp;价格:<input required autocomplete="off" class="form-control detail" type="text" name="schedule[0][price]">&nbsp;&nbsp;允许参加人数:<input required autocomplete="off" class="form-control detail" type="text" name="schedule[0][maximum]">&nbsp;&nbsp;报名截止时间:<input required autocomplete="off" onclick="showDate()" class="form-control js-bootstrap-datetime detail" type="text" name="schedule[0][deadline]"></li>
</div>
<div class="form-group">
... ... @@ -221,7 +221,7 @@
}else {
$("#B").show();
}
var text='<li id="li_0">开始时间:<input required autocomplete="off" onclick="showDate()" class="form-control js-bootstrap-datetime detail" type="text" name="schedule[0][start_time]">&nbsp;&nbsp;结束时间:<input required autocomplete="off" onclick="showDate()" class="form-control js-bootstrap-datetime detail" type="text" name="schedule[0][end_time]">&nbsp;&nbsp;价格:<input required autocomplete="off" class="form-control detail" type="text" name="schedule[0][price]">&nbsp;&nbsp;允许参加人数:<input required autocomplete="off" class="form-control detail" type="text" name="schedule[0][maximum]">&nbsp;&nbsp;<input id="B" type="button" value="新增" style="display: none;"></li>'
var text='<li id="li_0">开始时间:<input required autocomplete="off" onclick="showDate()" class="form-control js-bootstrap-datetime detail" type="text" name="schedule[0][start_time]">&nbsp;&nbsp;结束时间:<input required autocomplete="off" onclick="showDate()" class="form-control js-bootstrap-datetime detail" type="text" name="schedule[0][end_time]">&nbsp;&nbsp;价格:<input required autocomplete="off" class="form-control detail" type="text" name="schedule[0][price]">&nbsp;&nbsp;允许参加人数:<input required autocomplete="off" class="form-control detail" type="text" name="schedule[0][maximum]">&nbsp;&nbsp;<input id="B" type="button" value="新增" style="display: none;">报名截止时间:<input required autocomplete="off" onclick="showDate()" class="form-control js-bootstrap-datetime detail" type="text" name="schedule[0][deadline]"></li>'
$("#schedule").html(text);
})
... ... @@ -243,7 +243,7 @@
$("#B").click(function () {
var length=$("#schedule li").length;
var html=$("#schedule").html();
var text='<li id="li_'+length+'">开始时间:<input required autocomplete="off" onclick="showDate()" class="form-control js-bootstrap-datetime detail" type="text" name="schedule['+length+'][start_time]">&nbsp;&nbsp;结束时间:<input required autocomplete="off" onclick="showDate()" class="form-control js-bootstrap-datetime detail" type="text" name="schedule['+length+'][end_time]">&nbsp;&nbsp;价格:<input required autocomplete="off" class="form-control detail" type="text" name="schedule['+length+'][price]">&nbsp;&nbsp;允许参加人数:<input required autocomplete="off" class="form-control detail" type="text" name="schedule['+length+'][maximum]">&nbsp;&nbsp;<input id="B" type="button" value="新增" style="display: none;"> <span><font color="red" onclick="clearHtml('+length+')">删除</font></span></li>'
var text='<li id="li_'+length+'">开始时间:<input required autocomplete="off" onclick="showDate()" class="form-control js-bootstrap-datetime detail" type="text" name="schedule['+length+'][start_time]">&nbsp;&nbsp;结束时间:<input required autocomplete="off" onclick="showDate()" class="form-control js-bootstrap-datetime detail" type="text" name="schedule['+length+'][end_time]">&nbsp;&nbsp;价格:<input required autocomplete="off" class="form-control detail" type="text" name="schedule['+length+'][price]">&nbsp;&nbsp;允许参加人数:<input required autocomplete="off" class="form-control detail" type="text" name="schedule['+length+'][maximum]">&nbsp;&nbsp;<input id="B" type="button" value="新增" style="display: none;">报名截止时间:<input required autocomplete="off" onclick="showDate()" class="form-control js-bootstrap-datetime detail" type="text" name="schedule['+length+'][deadline]">&nbsp;<span><font color="red" onclick="clearHtml('+length+')">删除</font></span></li>'
$("#schedule").html(html+text);
})
... ...
... ... @@ -104,7 +104,7 @@
<input id="B" type="button" value="新增" <if condition="$info['date_type'] eq '0'">style="display: none";</if>>
<div id="schedule" style="margin-bottom: 20px">
<foreach name="schedule" item="v" key="k">
<li id="li_{$k}">开始时间:<input value="{$v['start_time']|date='Y-m-d H:i:s', ###}" required autocomplete="off" onclick="showDate()" class="form-control js-bootstrap-datetime detail" type="text" name="schedule[{$k}][start_time]">&nbsp;&nbsp;结束时间:<input value="{$v['end_time']|date='Y-m-d H:i:s', ###}" required autocomplete="off" onclick="showDate()" class="form-control js-bootstrap-datetime detail" type="text" name="schedule[{$k}][end_time]">&nbsp;&nbsp;价格:<input value="{$v['price']}" required autocomplete="off" class="form-control detail" type="text" name="schedule[{$k}][price]">&nbsp;&nbsp;允许参加人数:<input value="{$v['maximum']}" required autocomplete="off" class="form-control detail" type="text" name="schedule[{$k}][maximum]">&nbsp;&nbsp;&nbsp;<font color="red" onclick="clearHtml({$k})">删除</font></li>
<li id="li_{$k}">开始时间:<input value="{$v['start_time']|date='Y-m-d H:i:s', ###}" required autocomplete="off" onclick="showDate()" class="form-control js-bootstrap-datetime detail" type="text" name="schedule[{$k}][start_time]">&nbsp;&nbsp;结束时间:<input value="{$v['end_time']|date='Y-m-d H:i:s', ###}" required autocomplete="off" onclick="showDate()" class="form-control js-bootstrap-datetime detail" type="text" name="schedule[{$k}][end_time]">&nbsp;&nbsp;价格:<input value="{$v['price']}" required autocomplete="off" class="form-control detail" type="text" name="schedule[{$k}][price]">&nbsp;&nbsp;允许参加人数:<input value="{$v['maximum']}" required autocomplete="off" class="form-control detail" type="text" name="schedule[{$k}][maximum]">&nbsp;&nbsp;报名截止时间:<input value="{$v.deadline|date='Y-m-d H:i:s', ###}" required autocomplete="off" onclick="showDate()" class="form-control js-bootstrap-datetime detail" type="text" name="schedule[{$k}][deadline]">&nbsp;&nbsp;<font color="red" onclick="clearHtml({$k})">删除</font></li>
</foreach>
</div>
... ... @@ -248,7 +248,7 @@
}else {
$("#B").show();
}
var text='<li id="li_0">开始时间:<input required autocomplete="off" onclick="showDate()" class="form-control js-bootstrap-datetime detail" type="text" name="schedule[0][start_time]">&nbsp;&nbsp;结束时间:<input required autocomplete="off" onclick="showDate()" class="form-control js-bootstrap-datetime detail" type="text" name="schedule[0][end_time]">&nbsp;&nbsp;价格:<input required autocomplete="off" class="form-control detail" type="text" name="schedule[0][price]">&nbsp;&nbsp;允许参加人数:<input required autocomplete="off" class="form-control detail" type="text" name="schedule[0][maximum]">&nbsp;&nbsp;<input id="B" type="button" value="新增" style="display: none;"></li>'
var text='<li id="li_0">开始时间:<input required autocomplete="off" onclick="showDate()" class="form-control js-bootstrap-datetime detail" type="text" name="schedule[0][start_time]">&nbsp;&nbsp;结束时间:<input required autocomplete="off" onclick="showDate()" class="form-control js-bootstrap-datetime detail" type="text" name="schedule[0][end_time]">&nbsp;&nbsp;价格:<input required autocomplete="off" class="form-control detail" type="text" name="schedule[0][price]">&nbsp;&nbsp;允许参加人数:<input required autocomplete="off" class="form-control detail" type="text" name="schedule[0][maximum]">&nbsp;&nbsp;报名截止时间:<input required autocomplete="off" onclick="showDate()" class="form-control js-bootstrap-datetime detail" type="text" name="schedule[0][deadline]"></li>'
$("#schedule").html(text);
})
... ... @@ -270,7 +270,7 @@
$("#B").click(function () {
var length=$("#schedule li").length;
var html=$("#schedule").html();
var text='<li id="li_'+length+'">开始时间:<input required autocomplete="off" onclick="showDate()" class="form-control js-bootstrap-datetime detail" type="text" name="schedule['+length+'][start_time]">&nbsp;&nbsp;结束时间:<input required autocomplete="off" onclick="showDate()" class="form-control js-bootstrap-datetime detail" type="text" name="schedule['+length+'][end_time]">&nbsp;&nbsp;价格:<input required autocomplete="off" class="form-control detail" type="text" name="schedule['+length+'][price]">&nbsp;&nbsp;允许参加人数:<input required autocomplete="off" class="form-control detail" type="text" name="schedule['+length+'][maximum]">&nbsp;&nbsp;<input id="B" type="button" value="新增" style="display: none;"> <span><font color="red" onclick="clearHtml('+length+')">删除</font></span></li>'
var text='<li id="li_'+length+'">开始时间:<input required autocomplete="off" onclick="showDate()" class="form-control js-bootstrap-datetime detail" type="text" name="schedule['+length+'][start_time]">&nbsp;&nbsp;结束时间:<input required autocomplete="off" onclick="showDate()" class="form-control js-bootstrap-datetime detail" type="text" name="schedule['+length+'][end_time]">&nbsp;&nbsp;价格:<input required autocomplete="off" class="form-control detail" type="text" name="schedule['+length+'][price]">&nbsp;&nbsp;允许参加人数:<input required autocomplete="off" class="form-control detail" type="text" name="schedule['+length+'][maximum]">&nbsp;&nbsp;报名截止时间:<input required autocomplete="off" onclick="showDate()" class="form-control js-bootstrap-datetime detail" type="text" name="schedule['+length+'][deadline]">&nbsp;&nbsp;<span><font color="red" onclick="clearHtml('+length+')">删除</font></span></li>'
$("#schedule").html(html+text);
})
... ...