多样青春夜校
1站内信扩展:支持头像和复杂时间查询 2后台和机构后台优化课时和课程在一起管理,优化录入效率 3修改课程表接口以适配最新的ui
This commit is contained in:
parent
4c5f3f4b38
commit
d744adc762
|
@ -56,7 +56,7 @@ class Message extends Backend
|
||||||
list($where, $sort, $order, $offset, $limit) = $this->buildparams();
|
list($where, $sort, $order, $offset, $limit) = $this->buildparams();
|
||||||
$as = $this->model->getWithAlisaName();
|
$as = $this->model->getWithAlisaName();
|
||||||
$list = $this->model
|
$list = $this->model
|
||||||
->with(['admin','user'])
|
->with(['admin','user','messageevent'])
|
||||||
->where($where)
|
->where($where)
|
||||||
// ->order($sort, $order)
|
// ->order($sort, $order)
|
||||||
->order("{$as}.weigh DESC,{$as}.id DESC")
|
->order("{$as}.weigh DESC,{$as}.id DESC")
|
||||||
|
@ -66,6 +66,7 @@ class Message extends Backend
|
||||||
|
|
||||||
$row->getRelation('admin')->visible(['nickname','avatar']);
|
$row->getRelation('admin')->visible(['nickname','avatar']);
|
||||||
$row->getRelation('user')->visible(['nickname','avatar']);
|
$row->getRelation('user')->visible(['nickname','avatar']);
|
||||||
|
$row->getRelation('messageevent')->visible(['logo_image']);
|
||||||
}
|
}
|
||||||
|
|
||||||
$result = array("total" => $list->total(), "rows" => $list->items());
|
$result = array("total" => $list->total(), "rows" => $list->items());
|
||||||
|
|
|
@ -0,0 +1,40 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace app\admin\controller\school;
|
||||||
|
|
||||||
|
use app\common\controller\Backend;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 系统事件消息配置
|
||||||
|
*
|
||||||
|
* @icon fa fa-circle-o
|
||||||
|
*/
|
||||||
|
class MessageConfig extends Backend
|
||||||
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* MessageConfig模型对象
|
||||||
|
* @var \app\admin\model\school\MessageConfig
|
||||||
|
*/
|
||||||
|
protected $model = null;
|
||||||
|
|
||||||
|
public function _initialize()
|
||||||
|
{
|
||||||
|
parent::_initialize();
|
||||||
|
$this->model = new \app\admin\model\school\MessageConfig;
|
||||||
|
$this->view->assign("statusList", $this->model->getStatusList());
|
||||||
|
$this->view->assign("wechatWapList", $this->model->getWechatWapList());
|
||||||
|
$this->view->assign("messageList", $this->model->getMessageList());
|
||||||
|
$this->view->assign("selfmailList", $this->model->getSelfmailList());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 默认生成的控制器所继承的父类中有index/add/edit/del/multi五个基础方法、destroy/restore/recyclebin三个回收站方法
|
||||||
|
* 因此在当前控制器中可不用编写增删改查的代码,除非需要自己控制这部分逻辑
|
||||||
|
* 需要将application/admin/library/traits/Backend.php中对应的方法复制到当前控制器,然后进行修改
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -216,7 +216,9 @@ class ClassesLib extends Backend
|
||||||
$classesLib->no_auth_fields = $this->no_auth_fields;
|
$classesLib->no_auth_fields = $this->no_auth_fields;
|
||||||
$classesLib->need_auth = $this->need_auth;
|
$classesLib->need_auth = $this->need_auth;
|
||||||
$classesLib->have_auth = $this->have_auth;
|
$classesLib->have_auth = $this->have_auth;
|
||||||
$classesLib->classesCheck($params,$shop_id=null,$row);
|
|
||||||
|
$classesLib->classesCheck($params,null,$row);
|
||||||
|
|
||||||
$this->need_auth = $classesLib->need_auth;
|
$this->need_auth = $classesLib->need_auth;
|
||||||
$this->have_auth = $classesLib->have_auth;
|
$this->have_auth = $classesLib->have_auth;
|
||||||
|
|
||||||
|
@ -349,8 +351,17 @@ class ClassesLib extends Backend
|
||||||
$this->model->validateFailException()->validate($validate);
|
$this->model->validateFailException()->validate($validate);
|
||||||
}
|
}
|
||||||
$this->update_check($params,$row=null);
|
$this->update_check($params,$row=null);
|
||||||
|
$spec = $params["spec"];
|
||||||
|
unset($params["spec"]);
|
||||||
$result = $this->model->allowField(true)->save($params);
|
$result = $this->model->allowField(true)->save($params);
|
||||||
\app\common\model\school\classes\ClassesLib::add_virtual_init($this->model["id"]);
|
\app\common\model\school\classes\ClassesLib::add_virtual_init($this->model["id"]);
|
||||||
|
|
||||||
|
//添加课程规格
|
||||||
|
foreach ($spec as $k=>$v){
|
||||||
|
$v["classes_lib_id"] = $this->model["id"];
|
||||||
|
\app\common\model\school\classes\ClassesSpec::create($v);
|
||||||
|
}
|
||||||
|
|
||||||
$this->update_classes($this->model["id"]);
|
$this->update_classes($this->model["id"]);
|
||||||
|
|
||||||
if($this->have_auth){
|
if($this->have_auth){
|
||||||
|
@ -405,6 +416,11 @@ class ClassesLib extends Backend
|
||||||
$this->error(__('You have no permission'));
|
$this->error(__('You have no permission'));
|
||||||
}
|
}
|
||||||
if (false === $this->request->isPost()) {
|
if (false === $this->request->isPost()) {
|
||||||
|
$spec = \app\common\model\school\classes\ClassesSpec::where("classes_lib_id",$row["id"])->field("id,classes_lib_id,name,start_time,end_time,limit_num,status,weigh")->order('weigh desc,id desc')->select();
|
||||||
|
foreach ($spec as $k=>&$v){
|
||||||
|
$v["time"] = date("Y/m/d H:i",$v["start_time"])." - ".date("Y/m/d H:i",$v["end_time"]);
|
||||||
|
}
|
||||||
|
$row["spec"] = json_encode($spec);
|
||||||
$this->view->assign('row', $row);
|
$this->view->assign('row', $row);
|
||||||
return $this->view->fetch();
|
return $this->view->fetch();
|
||||||
}
|
}
|
||||||
|
@ -422,8 +438,29 @@ class ClassesLib extends Backend
|
||||||
$validate = is_bool($this->modelValidate) ? ($this->modelSceneValidate ? $name . '.edit' : $name) : $this->modelValidate;
|
$validate = is_bool($this->modelValidate) ? ($this->modelSceneValidate ? $name . '.edit' : $name) : $this->modelValidate;
|
||||||
$row->validateFailException()->validate($validate);
|
$row->validateFailException()->validate($validate);
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->update_check($params,$row);
|
$this->update_check($params,$row);
|
||||||
|
$spec = $params["spec"] ?? [];
|
||||||
|
$delete_spec_ids = $params["delete_spec_ids"] ?? [];
|
||||||
|
unset($params["spec"]);
|
||||||
|
unset($params["delete_spec_ids"]);
|
||||||
$result = $row->allowField(true)->save($params);
|
$result = $row->allowField(true)->save($params);
|
||||||
|
//添加课程规格
|
||||||
|
foreach ($spec as $k=>$v){
|
||||||
|
$v["classes_lib_id"] = $row["id"];
|
||||||
|
//有id更新,否则新增
|
||||||
|
if(isset($v["id"]) && $v["id"]){
|
||||||
|
\app\common\model\school\classes\ClassesSpec::update((new \app\common\model\school\classes\ClassesSpec)->checkAssemblyParameters($v));
|
||||||
|
}else{
|
||||||
|
\app\common\model\school\classes\ClassesSpec::create((new \app\common\model\school\classes\ClassesSpec)->checkAssemblyParameters($v));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
//删除规格
|
||||||
|
foreach ($delete_spec_ids as $k=>$delete_spec){
|
||||||
|
$delete_spec->delete();
|
||||||
|
}
|
||||||
|
|
||||||
$this->update_classes($row["id"]);
|
$this->update_classes($row["id"]);
|
||||||
if($this->have_auth){
|
if($this->have_auth){
|
||||||
//调用通过事件
|
//调用通过事件
|
||||||
|
|
|
@ -135,14 +135,18 @@ class ClassesSpec extends Backend
|
||||||
{
|
{
|
||||||
//限定人数必须大于0
|
//限定人数必须大于0
|
||||||
try {
|
try {
|
||||||
(new \app\common\model\school\classes\ClassesSpec)->specCheck($params,$shop_id=null,$row);
|
|
||||||
}catch (\Exception $e){
|
|
||||||
$this->error($e->getMessage());
|
|
||||||
}
|
|
||||||
|
|
||||||
//修改
|
$classesLib = new \app\common\model\school\classes\ClassesSpec();
|
||||||
|
$classesLib->no_auth_fields = $this->no_auth_fields;
|
||||||
|
$classesLib->need_auth = $this->need_auth;
|
||||||
|
$classesLib->have_auth = $this->have_auth;
|
||||||
|
$classesLib->specCheck($params,$shop_id=null,$row);
|
||||||
|
$this->need_auth = $classesLib->need_auth;
|
||||||
|
$this->have_auth = $classesLib->have_auth;
|
||||||
|
|
||||||
|
//修改
|
||||||
if($row){
|
if($row){
|
||||||
$this->updateCheck($row->id,$params,$row);
|
$classesLib->updateCheck($row->id,$params,$row);
|
||||||
|
|
||||||
}else{
|
}else{
|
||||||
//新增
|
//新增
|
||||||
|
@ -150,6 +154,13 @@ class ClassesSpec extends Backend
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// (new \app\common\model\school\classes\ClassesSpec)->specCheck($params,$shop_id=null,$row);
|
||||||
|
}catch (\Exception $e){
|
||||||
|
$this->error($e->getMessage());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -5,6 +5,7 @@ return [
|
||||||
'Type 1' => '未读',
|
'Type 1' => '未读',
|
||||||
'Type 2' => '已读',
|
'Type 2' => '已读',
|
||||||
'Weigh' => '权重',
|
'Weigh' => '权重',
|
||||||
|
'Logo_image' => '事件消息logo',
|
||||||
'Platform' => '消息平台',
|
'Platform' => '消息平台',
|
||||||
'Platform admin' => '总后台',
|
'Platform admin' => '总后台',
|
||||||
'Platform user' => '用户端',
|
'Platform user' => '用户端',
|
||||||
|
|
|
@ -0,0 +1,30 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
return [
|
||||||
|
'Name' => '事件名',
|
||||||
|
'Event' => '事件标识',
|
||||||
|
'Logo_image' => '事件消息logo',
|
||||||
|
'Status' => '事件类型',
|
||||||
|
'Status 1' => '系统推送',
|
||||||
|
'Set status to 1' => '设为系统推送',
|
||||||
|
'Status 2' => '其他',
|
||||||
|
'Set status to 2' => '设为其他',
|
||||||
|
'Wechat_wap' => '微信公众号消息',
|
||||||
|
'Wechat_wap 1' => '开启',
|
||||||
|
'Wechat_wap 2' => '关闭',
|
||||||
|
'Message' => '短信消息',
|
||||||
|
'Message 1' => '开启',
|
||||||
|
'Message 2' => '关闭',
|
||||||
|
'Selfmail' => '站内行消息',
|
||||||
|
'Selfmail 1' => '开启',
|
||||||
|
'Selfmail 2' => '关闭',
|
||||||
|
'Message_id' => '短信模板id',
|
||||||
|
'Wechat_wap_id' => '公众号模板消息id',
|
||||||
|
'Selfmail_title' => '站内信标题',
|
||||||
|
'Selfmail_template_text' => '站内信模板',
|
||||||
|
'Configjson' => '可用的模板字段变量',
|
||||||
|
'Weigh' => '权重',
|
||||||
|
'Createtime' => '创建时间',
|
||||||
|
'Updatetime' => '修改时间',
|
||||||
|
'Deletetime' => '删除时间'
|
||||||
|
];
|
|
@ -144,4 +144,11 @@ class Message extends BaseModel
|
||||||
{
|
{
|
||||||
return $this->belongsTo('app\admin\model\User', 'to_id', 'id', [], 'LEFT')->setEagerlyType(0);
|
return $this->belongsTo('app\admin\model\User', 'to_id', 'id', [], 'LEFT')->setEagerlyType(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public function messageevent()
|
||||||
|
{
|
||||||
|
return $this->belongsTo(MessageConfig::class, 'event', 'event', [], 'LEFT')->setEagerlyType(0);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,101 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace app\admin\model\school;
|
||||||
|
|
||||||
|
use think\Model;
|
||||||
|
use traits\model\SoftDelete;
|
||||||
|
|
||||||
|
class MessageConfig extends Model
|
||||||
|
{
|
||||||
|
|
||||||
|
use SoftDelete;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// 表名
|
||||||
|
protected $name = 'school_message_config';
|
||||||
|
|
||||||
|
// 自动写入时间戳字段
|
||||||
|
protected $autoWriteTimestamp = 'integer';
|
||||||
|
|
||||||
|
// 定义时间戳字段名
|
||||||
|
protected $createTime = 'createtime';
|
||||||
|
protected $updateTime = 'updatetime';
|
||||||
|
protected $deleteTime = 'deletetime';
|
||||||
|
|
||||||
|
// 追加属性
|
||||||
|
protected $append = [
|
||||||
|
'status_text',
|
||||||
|
'wechat_wap_text',
|
||||||
|
'message_text',
|
||||||
|
'selfmail_text'
|
||||||
|
];
|
||||||
|
|
||||||
|
|
||||||
|
protected static function init()
|
||||||
|
{
|
||||||
|
self::afterInsert(function ($row) {
|
||||||
|
if (!$row['weigh']) {
|
||||||
|
$pk = $row->getPk();
|
||||||
|
$row->getQuery()->where($pk, $row[$pk])->update(['weigh' => $row[$pk]]);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public function getStatusList()
|
||||||
|
{
|
||||||
|
return ['1' => __('Status 1'), '2' => __('Status 2')];
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getWechatWapList()
|
||||||
|
{
|
||||||
|
return ['1' => __('Wechat_wap 1'), '2' => __('Wechat_wap 2')];
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getMessageList()
|
||||||
|
{
|
||||||
|
return ['1' => __('Message 1'), '2' => __('Message 2')];
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getSelfmailList()
|
||||||
|
{
|
||||||
|
return ['1' => __('Selfmail 1'), '2' => __('Selfmail 2')];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public function getStatusTextAttr($value, $data)
|
||||||
|
{
|
||||||
|
$value = $value ? $value : (isset($data['status']) ? $data['status'] : '');
|
||||||
|
$list = $this->getStatusList();
|
||||||
|
return isset($list[$value]) ? $list[$value] : '';
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public function getWechatWapTextAttr($value, $data)
|
||||||
|
{
|
||||||
|
$value = $value ? $value : (isset($data['wechat_wap']) ? $data['wechat_wap'] : '');
|
||||||
|
$list = $this->getWechatWapList();
|
||||||
|
return isset($list[$value]) ? $list[$value] : '';
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public function getMessageTextAttr($value, $data)
|
||||||
|
{
|
||||||
|
$value = $value ? $value : (isset($data['message']) ? $data['message'] : '');
|
||||||
|
$list = $this->getMessageList();
|
||||||
|
return isset($list[$value]) ? $list[$value] : '';
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public function getSelfmailTextAttr($value, $data)
|
||||||
|
{
|
||||||
|
$value = $value ? $value : (isset($data['selfmail']) ? $data['selfmail'] : '');
|
||||||
|
$list = $this->getSelfmailList();
|
||||||
|
return isset($list[$value]) ? $list[$value] : '';
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,27 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace app\admin\validate\school;
|
||||||
|
|
||||||
|
use think\Validate;
|
||||||
|
|
||||||
|
class MessageConfig extends Validate
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 验证规则
|
||||||
|
*/
|
||||||
|
protected $rule = [
|
||||||
|
];
|
||||||
|
/**
|
||||||
|
* 提示消息
|
||||||
|
*/
|
||||||
|
protected $message = [
|
||||||
|
];
|
||||||
|
/**
|
||||||
|
* 验证场景
|
||||||
|
*/
|
||||||
|
protected $scene = [
|
||||||
|
'add' => [],
|
||||||
|
'edit' => [],
|
||||||
|
];
|
||||||
|
|
||||||
|
}
|
|
@ -169,9 +169,9 @@
|
||||||
<!--定义模板-->
|
<!--定义模板-->
|
||||||
<script type="text/html" id="testtpl">
|
<script type="text/html" id="testtpl">
|
||||||
<tr class="form-inline">
|
<tr class="form-inline">
|
||||||
<td><input type="text" name="row[<%=name%>][<%=index%>][name]" data-rule="required" class="form-control" value="<%=row['name']%>" size="20" placeholder="课时名"></td>
|
<td><input type="text" name="row[<%=name%>][<%=index%>][name]" data-rule="required" class="form-control" value="<%=row['name']%>" size="25" placeholder="课时名"></td>
|
||||||
<td>
|
<td>
|
||||||
<input type="text" name="row[<%=name%>][<%=index%>][time]" data-rule="required" class="form-control datetimerange" data-time-picker="true" data-locale='{"format":"YYYY/MM/DD HH:mm"}' placeholder="指定开始结束时间" value="<%=row['time']%>" size="20" />
|
<input type="text" name="row[<%=name%>][<%=index%>][time]" data-rule="required" class="form-control datetimerange" data-time-picker="true" data-locale='{"format":"YYYY/MM/DD HH:mm"}' placeholder="指定开始结束时间" value="<%=row['time']%>" size="35" />
|
||||||
<!--<input type="text" class="form-control datetimerange" name="updatetime" value="" placeholder="修改时间" id="updatetime" data-index="49" autocomplete="off">-->
|
<!--<input type="text" class="form-control datetimerange" name="updatetime" value="" placeholder="修改时间" id="updatetime" data-index="49" autocomplete="off">-->
|
||||||
|
|
||||||
</td>
|
</td>
|
||||||
|
|
|
@ -186,6 +186,60 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2">{:__('课时规格信息')}:</label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
<table class="table table-responsive fieldlist" data-name="row[spec]" data-template="testtpl" data-tag="tr">
|
||||||
|
<tr>
|
||||||
|
<td>规格名</td>
|
||||||
|
<td>开始结束时间</td>
|
||||||
|
<td>限定人数</td>
|
||||||
|
<!-- <td>权重</td>-->
|
||||||
|
<td>上架状态</td>
|
||||||
|
<td></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td colspan="5"><a href="javascript:;" class="btn btn-sm btn-success btn-append"><i class="fa fa-plus"></i> 追加</a></td>
|
||||||
|
</tr>
|
||||||
|
<textarea name="row[spec]" id="spec" class="form-control hide" cols="30" rows="5">
|
||||||
|
{$row["spec"]}
|
||||||
|
</textarea>
|
||||||
|
|
||||||
|
</table>
|
||||||
|
<span style="color: red">(每个课时规格为当前课程的一节课,课程总共多少节课就需要上多少个课时规格,每个课时的开始和结束时间不能有重叠,后续有变更将触发审核机制!)</span>
|
||||||
|
<!--定义模板-->
|
||||||
|
<script type="text/html" id="testtpl">
|
||||||
|
<tr class="form-inline">
|
||||||
|
<td>
|
||||||
|
<input type="hidden" name="row[<%=name%>][<%=index%>][id]" class="form-control" value="<%=row['id']%>" size="20" >
|
||||||
|
<input type="text" name="row[<%=name%>][<%=index%>][name]" data-rule="required" class="form-control" value="<%=row['name']%>" size="25" placeholder="课时名"></td>
|
||||||
|
<td>
|
||||||
|
<input type="text" name="row[<%=name%>][<%=index%>][time]" data-rule="required" class="form-control datetimerange" data-time-picker="true" data-locale='{"format":"YYYY/MM/DD HH:mm"}' placeholder="指定开始结束时间" value="<%=row['time']%>" size="35" />
|
||||||
|
<!--<input type="text" class="form-control datetimerange" name="updatetime" value="" placeholder="修改时间" id="updatetime" data-index="49" autocomplete="off">-->
|
||||||
|
|
||||||
|
</td>
|
||||||
|
<td><input type="text" name="row[<%=name%>][<%=index%>][limit_num]" data-rule="required" class="form-control" value="<%=row['limit_num']%>" placeholder="课时限制人数" size="2" onkeyup="this.value=this.value.replace(/[^0-9]/g,'')" onafterpaste="this.value=this.value.replace(/[^0-9]/g,'')"></td>
|
||||||
|
<!-- <td><input type="text" name="row[<%=name%>][<%=index%>][weigh]" data-rule="required" class="form-control" value="<%=row['weigh']%>" size="2" placeholder="课时排序权重" onkeyup="this.value=this.value.replace(/[^0-9]/g,'')" onafterpaste="this.value=this.value.replace(/[^0-9]/g,'')"></td>-->
|
||||||
|
<td>
|
||||||
|
<select id="c-status" class="form-control" name="row[<%=name%>][<%=index%>][status]">
|
||||||
|
{foreach name="specStatusList" item="vo"}
|
||||||
|
<option value="{$key}" <%if(row.status=={$key}){%> selected <%}%> >{$vo}</option>
|
||||||
|
{/foreach}
|
||||||
|
</select>
|
||||||
|
</td>
|
||||||
|
<td><span class="btn btn-sm btn-danger btn-remove"><i class="fa fa-times"></i></span> <span class="btn btn-sm btn-primary btn-dragsort"><i class="fa fa-arrows"></i></span></td>
|
||||||
|
</tr>
|
||||||
|
</script>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="control-label col-xs-12 col-sm-2">{:__('Address_type')}:</label>
|
<label class="control-label col-xs-12 col-sm-2">{:__('Address_type')}:</label>
|
||||||
<div class="col-xs-12 col-sm-8">
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
@ -376,7 +430,7 @@
|
||||||
<label class="control-label col-xs-12 col-sm-2"></label>
|
<label class="control-label col-xs-12 col-sm-2"></label>
|
||||||
<div class="col-xs-12 col-sm-8">
|
<div class="col-xs-12 col-sm-8">
|
||||||
<button type="submit" class="btn btn-primary btn-embossed disabled">{:__('OK')}</button>
|
<button type="submit" class="btn btn-primary btn-embossed disabled">{:__('OK')}</button>
|
||||||
<button type="button" data-url="school/classes/classes_spec/index?classes_lib_id={$row.id}" class="btn btn-success btn-changeuser {:$auth->check('school/classes/classes_spec/index')?'':'hide'}" title="{:__('设置课时')}" ><i class="fa fa-plus"></i> {:__('设置课时')}</button>
|
<!-- <button type="button" data-url="school/classes/classes_spec/index?classes_lib_id={$row.id}" class="btn btn-success btn-changeuser {:$auth->check('school/classes/classes_spec/index')?'':'hide'}" title="{:__('查看和设置课时')}" ><i class="fa fa-plus"></i> {:__('查看和设置课时')}</button>-->
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -20,10 +20,10 @@
|
||||||
|
|
||||||
|
|
||||||
<a href="javascript:;" class="btn btn-primary btn-refresh" title="{:__('Refresh')}" ><i class="fa fa-refresh"></i> </a>
|
<a href="javascript:;" class="btn btn-primary btn-refresh" title="{:__('Refresh')}" ><i class="fa fa-refresh"></i> </a>
|
||||||
<a href="javascript:;" class="btn btn-success btn-add {:$auth->check('school/classes/classes_lib/add')?'':'hide'}" title="{:__('Add')}" ><i class="fa fa-plus"></i> {:__('Add')}</a>
|
<!-- <a href="javascript:;" class="btn btn-success btn-add {:$auth->check('school/classes/classes_lib/add')?'':'hide'}" title="{:__('Add')}" ><i class="fa fa-plus"></i> {:__('Add')}</a>-->
|
||||||
|
|
||||||
|
|
||||||
<a href="javascript:;" data-url="school/classes/classes_lib/addnew" class="btn btn-success btn-changeuser {:$auth->check('school/classes/classes_lib/addnew')?'':'hide'}" title="{:__('新版添加')}" ><i class="fa fa-plus"></i> {:__('新版添加')}(开发中)</a>
|
<a href="javascript:;" data-url="school/classes/classes_lib/addnew" class="btn btn-success btn-changeuser {:$auth->check('school/classes/classes_lib/addnew')?'':'hide'}" title="{:__('Add')}" ><i class="fa fa-plus"></i> {:__('Add')}</a>
|
||||||
|
|
||||||
<a href="javascript:;" class="btn btn-success btn-edit btn-disabled disabled {:$auth->check('school/classes/classes_lib/edit')?'':'hide'}" title="{:__('Edit')}" ><i class="fa fa-pencil"></i> {:__('Edit')}</a>
|
<a href="javascript:;" class="btn btn-success btn-edit btn-disabled disabled {:$auth->check('school/classes/classes_lib/edit')?'':'hide'}" title="{:__('Edit')}" ><i class="fa fa-pencil"></i> {:__('Edit')}</a>
|
||||||
<a href="javascript:;" class="btn btn-danger btn-del btn-disabled disabled {:$auth->check('school/classes/classes_lib/del')?'':'hide'}" title="{:__('Delete')}" ><i class="fa fa-trash"></i> {:__('Delete')}</a>
|
<a href="javascript:;" class="btn btn-danger btn-del btn-disabled disabled {:$auth->check('school/classes/classes_lib/del')?'':'hide'}" title="{:__('Delete')}" ><i class="fa fa-trash"></i> {:__('Delete')}</a>
|
||||||
|
|
|
@ -84,6 +84,14 @@
|
||||||
<input id="c-desc" data-rule="required" class="form-control" name="row[desc]" type="text">
|
<input id="c-desc" data-rule="required" class="form-control" name="row[desc]" type="text">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2">{:__('Event')}:</label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
<input id="c-event" data-rule="required" disabled class="form-control" name="row[event]" type="text" value="system">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="control-label col-xs-12 col-sm-2">{:__('Params')}:</label>
|
<label class="control-label col-xs-12 col-sm-2">{:__('Params')}:</label>
|
||||||
<div class="col-xs-12 col-sm-8">
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
@ -91,6 +99,9 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="control-label col-xs-12 col-sm-2">{:__('Weigh')}:</label>
|
<label class="control-label col-xs-12 col-sm-2">{:__('Weigh')}:</label>
|
||||||
<div class="col-xs-12 col-sm-8">
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
|
|
@ -84,6 +84,14 @@
|
||||||
<input id="c-desc" data-rule="required" class="form-control" name="row[desc]" type="text" value="{$row.desc|htmlentities}">
|
<input id="c-desc" data-rule="required" class="form-control" name="row[desc]" type="text" value="{$row.desc|htmlentities}">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2">{:__('Event')}:</label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
<input id="c-event" data-rule="required" class="form-control" disabled name="row[event]" type="text" value="{$row.event|htmlentities}">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="control-label col-xs-12 col-sm-2">{:__('Params')}:</label>
|
<label class="control-label col-xs-12 col-sm-2">{:__('Params')}:</label>
|
||||||
<div class="col-xs-12 col-sm-8">
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
|
|
@ -0,0 +1,129 @@
|
||||||
|
<form id="add-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2">{:__('Name')}:</label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
<input id="c-name" data-rule="required" class="form-control" name="row[name]" type="text">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2">{:__('Event')}:</label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
<input id="c-event" data-rule="required" class="form-control" name="row[event]" type="text">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2">{:__('Logo_image')}:</label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
<div class="input-group">
|
||||||
|
<input id="c-logo_image" data-rule="required" class="form-control" size="50" name="row[logo_image]" type="text">
|
||||||
|
<div class="input-group-addon no-border no-padding">
|
||||||
|
<span><button type="button" id="faupload-logo_image" class="btn btn-danger faupload" data-input-id="c-logo_image" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp,image/webp" data-multiple="false" data-preview-id="p-logo_image"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
|
||||||
|
<span><button type="button" id="fachoose-logo_image" class="btn btn-primary fachoose" data-input-id="c-logo_image" data-mimetype="image/*" data-multiple="false"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
|
||||||
|
</div>
|
||||||
|
<span class="msg-box n-right" for="c-logo_image"></span>
|
||||||
|
</div>
|
||||||
|
<ul class="row list-inline faupload-preview" id="p-logo_image"></ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2">{:__('Status')}:</label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
|
||||||
|
<div class="radio">
|
||||||
|
{foreach name="statusList" item="vo"}
|
||||||
|
<label for="row[status]-{$key}"><input id="row[status]-{$key}" name="row[status]" type="radio" value="{$key}" {in name="key" value="1"}checked{/in} /> {$vo}</label>
|
||||||
|
{/foreach}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2">{:__('Wechat_wap')}:</label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
|
||||||
|
<select id="c-wechat_wap" data-rule="required" class="form-control selectpicker" name="row[wechat_wap]">
|
||||||
|
{foreach name="wechatWapList" item="vo"}
|
||||||
|
<option value="{$key}" {in name="key" value="1"}selected{/in}>{$vo}</option>
|
||||||
|
{/foreach}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2">{:__('Message')}:</label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
|
||||||
|
<select id="c-message" data-rule="required" class="form-control selectpicker" name="row[message]">
|
||||||
|
{foreach name="messageList" item="vo"}
|
||||||
|
<option value="{$key}" {in name="key" value="1"}selected{/in}>{$vo}</option>
|
||||||
|
{/foreach}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2">{:__('Selfmail')}:</label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
|
||||||
|
<select id="c-selfmail" data-rule="required" class="form-control selectpicker" name="row[selfmail]">
|
||||||
|
{foreach name="selfmailList" item="vo"}
|
||||||
|
<option value="{$key}" {in name="key" value="1"}selected{/in}>{$vo}</option>
|
||||||
|
{/foreach}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2">{:__('Message_id')}:</label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
<input id="c-message_id" class="form-control" name="row[message_id]" type="text" value="">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2">{:__('Wechat_wap_id')}:</label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
<input id="c-wechat_wap_id" class="form-control" name="row[wechat_wap_id]" type="text" value="">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2">{:__('Selfmail_title')}:</label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
<input id="c-selfmail_title" class="form-control" name="row[selfmail_title]" type="text">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2">{:__('Selfmail_template_text')}:</label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
<textarea id="c-selfmail_template_text" class="form-control " rows="5" name="row[selfmail_template_text]" cols="50"></textarea>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2">{:__('Configjson')}:</label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
|
||||||
|
<dl class="fieldlist" data-name="row[configjson]">
|
||||||
|
<dd>
|
||||||
|
<ins>{:__('Key')}</ins>
|
||||||
|
<ins>{:__('Value')}</ins>
|
||||||
|
</dd>
|
||||||
|
<dd><a href="javascript:;" class="btn btn-sm btn-success btn-append"><i class="fa fa-plus"></i> {:__('Append')}</a></dd>
|
||||||
|
<textarea name="row[configjson]" class="form-control hide" cols="30" rows="5"></textarea>
|
||||||
|
</dl>
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2">{:__('Weigh')}:</label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
<input id="c-weigh" class="form-control" name="row[weigh]" type="number" value="0">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group layer-footer">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2"></label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
<button type="submit" class="btn btn-primary btn-embossed disabled">{:__('OK')}</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
|
@ -0,0 +1,129 @@
|
||||||
|
<form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2">{:__('Name')}:</label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
<input id="c-name" data-rule="required" class="form-control" name="row[name]" type="text" value="{$row.name|htmlentities}">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2">{:__('Event')}:</label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
<input id="c-event" data-rule="required" class="form-control" name="row[event]" type="text" value="{$row.event|htmlentities}">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2">{:__('Logo_image')}:</label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
<div class="input-group">
|
||||||
|
<input id="c-logo_image" data-rule="required" class="form-control" size="50" name="row[logo_image]" type="text" value="{$row.logo_image|htmlentities}">
|
||||||
|
<div class="input-group-addon no-border no-padding">
|
||||||
|
<span><button type="button" id="faupload-logo_image" class="btn btn-danger faupload" data-input-id="c-logo_image" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp,image/webp" data-multiple="false" data-preview-id="p-logo_image"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
|
||||||
|
<span><button type="button" id="fachoose-logo_image" class="btn btn-primary fachoose" data-input-id="c-logo_image" data-mimetype="image/*" data-multiple="false"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
|
||||||
|
</div>
|
||||||
|
<span class="msg-box n-right" for="c-logo_image"></span>
|
||||||
|
</div>
|
||||||
|
<ul class="row list-inline faupload-preview" id="p-logo_image"></ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2">{:__('Status')}:</label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
|
||||||
|
<div class="radio">
|
||||||
|
{foreach name="statusList" item="vo"}
|
||||||
|
<label for="row[status]-{$key}"><input id="row[status]-{$key}" name="row[status]" type="radio" value="{$key}" {in name="key" value="$row.status"}checked{/in} /> {$vo}</label>
|
||||||
|
{/foreach}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2">{:__('Wechat_wap')}:</label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
|
||||||
|
<select id="c-wechat_wap" data-rule="required" class="form-control selectpicker" name="row[wechat_wap]">
|
||||||
|
{foreach name="wechatWapList" item="vo"}
|
||||||
|
<option value="{$key}" {in name="key" value="$row.wechat_wap"}selected{/in}>{$vo}</option>
|
||||||
|
{/foreach}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2">{:__('Message')}:</label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
|
||||||
|
<select id="c-message" data-rule="required" class="form-control selectpicker" name="row[message]">
|
||||||
|
{foreach name="messageList" item="vo"}
|
||||||
|
<option value="{$key}" {in name="key" value="$row.message"}selected{/in}>{$vo}</option>
|
||||||
|
{/foreach}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2">{:__('Selfmail')}:</label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
|
||||||
|
<select id="c-selfmail" data-rule="required" class="form-control selectpicker" name="row[selfmail]">
|
||||||
|
{foreach name="selfmailList" item="vo"}
|
||||||
|
<option value="{$key}" {in name="key" value="$row.selfmail"}selected{/in}>{$vo}</option>
|
||||||
|
{/foreach}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2">{:__('Message_id')}:</label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
<input id="c-message_id" class="form-control" name="row[message_id]" type="text" value="{$row.message_id|htmlentities}">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2">{:__('Wechat_wap_id')}:</label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
<input id="c-wechat_wap_id" class="form-control" name="row[wechat_wap_id]" type="text" value="{$row.wechat_wap_id|htmlentities}">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2">{:__('Selfmail_title')}:</label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
<input id="c-selfmail_title" class="form-control" name="row[selfmail_title]" type="text" value="{$row.selfmail_title|htmlentities}">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2">{:__('Selfmail_template_text')}:</label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
<textarea id="c-selfmail_template_text" class="form-control " rows="5" name="row[selfmail_template_text]" cols="50">{$row.selfmail_template_text|htmlentities}</textarea>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2">{:__('Configjson')}:</label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
|
||||||
|
<dl class="fieldlist" data-name="row[configjson]">
|
||||||
|
<dd>
|
||||||
|
<ins>{:__('Key')}</ins>
|
||||||
|
<ins>{:__('Value')}</ins>
|
||||||
|
</dd>
|
||||||
|
<dd><a href="javascript:;" class="btn btn-sm btn-success btn-append"><i class="fa fa-plus"></i> {:__('Append')}</a></dd>
|
||||||
|
<textarea name="row[configjson]" class="form-control hide" cols="30" rows="5">{$row.configjson|htmlentities}</textarea>
|
||||||
|
</dl>
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2">{:__('Weigh')}:</label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
<input id="c-weigh" class="form-control" name="row[weigh]" type="number" value="{$row.weigh|htmlentities}">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group layer-footer">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2"></label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
<button type="submit" class="btn btn-primary btn-embossed disabled">{:__('OK')}</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
|
@ -0,0 +1,46 @@
|
||||||
|
<div class="panel panel-default panel-intro">
|
||||||
|
|
||||||
|
<div class="panel-heading">
|
||||||
|
{:build_heading(null,FALSE)}
|
||||||
|
<ul class="nav nav-tabs" data-field="status">
|
||||||
|
<li class="{:$Think.get.status === null ? 'active' : ''}"><a href="#t-all" data-value="" data-toggle="tab">{:__('All')}</a></li>
|
||||||
|
{foreach name="statusList" item="vo"}
|
||||||
|
<li class="{:$Think.get.status === (string)$key ? 'active' : ''}"><a href="#t-{$key}" data-value="{$key}" data-toggle="tab">{$vo}</a></li>
|
||||||
|
{/foreach}
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="panel-body">
|
||||||
|
<div id="myTabContent" class="tab-content">
|
||||||
|
<div class="tab-pane fade active in" id="one">
|
||||||
|
<div class="widget-body no-padding">
|
||||||
|
<div id="toolbar" class="toolbar">
|
||||||
|
<a href="javascript:;" class="btn btn-primary btn-refresh" title="{:__('Refresh')}" ><i class="fa fa-refresh"></i> </a>
|
||||||
|
<a href="javascript:;" class="btn btn-success btn-add {:$auth->check('school/message_config/add')?'':'hide'}" title="{:__('Add')}" ><i class="fa fa-plus"></i> {:__('Add')}</a>
|
||||||
|
<a href="javascript:;" class="btn btn-success btn-edit btn-disabled disabled {:$auth->check('school/message_config/edit')?'':'hide'}" title="{:__('Edit')}" ><i class="fa fa-pencil"></i> {:__('Edit')}</a>
|
||||||
|
<a href="javascript:;" class="btn btn-danger btn-del btn-disabled disabled {:$auth->check('school/message_config/del')?'':'hide'}" title="{:__('Delete')}" ><i class="fa fa-trash"></i> {:__('Delete')}</a>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="dropdown btn-group {:$auth->check('school/message_config/multi')?'':'hide'}">
|
||||||
|
<a class="btn btn-primary btn-more dropdown-toggle btn-disabled disabled" data-toggle="dropdown"><i class="fa fa-cog"></i> {:__('More')}</a>
|
||||||
|
<ul class="dropdown-menu text-left" role="menu">
|
||||||
|
{foreach name="statusList" item="vo"}
|
||||||
|
<li><a class="btn btn-link btn-multi btn-disabled disabled" href="javascript:" data-params="status={$key}">{:__('Set status to ' . $key)}</a></li>
|
||||||
|
{/foreach}
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<a class="btn btn-success btn-recyclebin btn-dialog {:$auth->check('school/message_config/recyclebin')?'':'hide'}" href="school/message_config/recyclebin" title="{:__('Recycle bin')}"><i class="fa fa-recycle"></i> {:__('Recycle bin')}</a>
|
||||||
|
</div>
|
||||||
|
<table id="table" class="table table-striped table-bordered table-hover table-nowrap"
|
||||||
|
data-operate-edit="{:$auth->check('school/message_config/edit')}"
|
||||||
|
data-operate-del="{:$auth->check('school/message_config/del')}"
|
||||||
|
width="100%">
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
|
@ -0,0 +1,25 @@
|
||||||
|
<div class="panel panel-default panel-intro">
|
||||||
|
{:build_heading()}
|
||||||
|
|
||||||
|
<div class="panel-body">
|
||||||
|
<div id="myTabContent" class="tab-content">
|
||||||
|
<div class="tab-pane fade active in" id="one">
|
||||||
|
<div class="widget-body no-padding">
|
||||||
|
<div id="toolbar" class="toolbar">
|
||||||
|
{:build_toolbar('refresh')}
|
||||||
|
<a class="btn btn-info btn-multi btn-disabled disabled {:$auth->check('school/message_config/restore')?'':'hide'}" href="javascript:;" data-url="school/message_config/restore" data-action="restore"><i class="fa fa-rotate-left"></i> {:__('Restore')}</a>
|
||||||
|
<a class="btn btn-danger btn-multi btn-disabled disabled {:$auth->check('school/message_config/destroy')?'':'hide'}" href="javascript:;" data-url="school/message_config/destroy" data-action="destroy"><i class="fa fa-times"></i> {:__('Destroy')}</a>
|
||||||
|
<a class="btn btn-success btn-restoreall {:$auth->check('school/message_config/restore')?'':'hide'}" href="javascript:;" data-url="school/message_config/restore" title="{:__('Restore all')}"><i class="fa fa-rotate-left"></i> {:__('Restore all')}</a>
|
||||||
|
<a class="btn btn-danger btn-destroyall {:$auth->check('school/message_config/destroy')?'':'hide'}" href="javascript:;" data-url="school/message_config/destroy" title="{:__('Destroy all')}"><i class="fa fa-times"></i> {:__('Destroy all')}</a>
|
||||||
|
</div>
|
||||||
|
<table id="table" class="table table-striped table-bordered table-hover"
|
||||||
|
data-operate-restore="{:$auth->check('school/message_config/restore')}"
|
||||||
|
data-operate-destroy="{:$auth->check('school/message_config/destroy')}"
|
||||||
|
width="100%">
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
|
@ -69,7 +69,8 @@ class Message extends Base
|
||||||
* @ApiParams(name = "limit", type = "string",required=true,description = "条数")
|
* @ApiParams(name = "limit", type = "string",required=true,description = "条数")
|
||||||
* @ApiParams(name = "status", type = "string",required=false,description = "消息总类型:system=系统消息,classes=课程消息,order=订单消息")
|
* @ApiParams(name = "status", type = "string",required=false,description = "消息总类型:system=系统消息,classes=课程消息,order=订单消息")
|
||||||
* @ApiParams(name = "mini_type", type = "string",required=false,description = "小消息类型:order_notice=课程订单通知,classes_auth=课程报名审核,classes_apply=课程上新审核,shop_apply=机构审核,classes_order_notice=课时预约,user_auth=机构授权用户信息,aftercare=售后服务,other=其他")
|
* @ApiParams(name = "mini_type", type = "string",required=false,description = "小消息类型:order_notice=课程订单通知,classes_auth=课程报名审核,classes_apply=课程上新审核,shop_apply=机构审核,classes_order_notice=课时预约,user_auth=机构授权用户信息,aftercare=售后服务,other=其他")
|
||||||
*@ApiParams(name = "type", type = "string",required=false,description = "已读状态:1=未读,2=已读")
|
* @ApiParams(name = "type", type = "string",required=false,description = "已读状态:1=未读,2=已读")
|
||||||
|
* @ApiParams(name = "time", type = "string",required=false,description = "复合时间查询:today今天,week本周,month本月,year本年,yesterday昨天,last year上一年,last week上周,last month上個月,lately7最近7天 , lately30最近30天,按开始时间区间查传值格式:Y/m/d H:M:S-Y/m/d H:M:S")
|
||||||
*
|
*
|
||||||
* @ApiReturn({
|
* @ApiReturn({
|
||||||
*
|
*
|
||||||
|
@ -86,11 +87,12 @@ class Message extends Base
|
||||||
$status = $this->request->get('status/s', ''); //搜索关键字
|
$status = $this->request->get('status/s', ''); //搜索关键字
|
||||||
$mini_type = $this->request->get('mini_type/s', ''); //搜索关键字
|
$mini_type = $this->request->get('mini_type/s', ''); //搜索关键字
|
||||||
$type = $this->request->get('type/s', ''); //搜索关键字
|
$type = $this->request->get('type/s', ''); //搜索关键字
|
||||||
|
$time = $this->request->get('time/s', ''); //时间
|
||||||
// $type = $this->request->get('type/s', ''); //筛选学员和教练单
|
// $type = $this->request->get('type/s', ''); //筛选学员和教练单
|
||||||
$to_id = $user_id;
|
$to_id = $user_id;
|
||||||
try{
|
try{
|
||||||
//当前申请状态
|
//当前申请状态
|
||||||
$res = $this->model::messageList($page, $limit,$to_id,$keywords,$status,$mini_type,$type);
|
$res = $this->model::messageList($page, $limit,$to_id,$keywords,$status,$mini_type,$type,$time);
|
||||||
// if($user_id =='670153'){
|
// if($user_id =='670153'){
|
||||||
// file_put_contents("ceshi66.txt",(new AppointmentOrder())->getLastSql());
|
// file_put_contents("ceshi66.txt",(new AppointmentOrder())->getLastSql());
|
||||||
// }
|
// }
|
||||||
|
|
|
@ -118,6 +118,7 @@ class Backend extends Controller
|
||||||
|
|
||||||
|
|
||||||
protected $have_auth = false;
|
protected $have_auth = false;
|
||||||
|
protected $need_auth = false;
|
||||||
protected $no_auth_fields = [];
|
protected $no_auth_fields = [];
|
||||||
|
|
||||||
protected function no_auth_fields_check($params,$row){
|
protected function no_auth_fields_check($params,$row){
|
||||||
|
|
|
@ -123,6 +123,7 @@ class ManystoreBase extends Controller
|
||||||
|
|
||||||
|
|
||||||
protected $have_auth = false;
|
protected $have_auth = false;
|
||||||
|
protected $need_auth = false;
|
||||||
protected $no_auth_fields = [];
|
protected $no_auth_fields = [];
|
||||||
|
|
||||||
protected function no_auth_fields_check($params,$row){
|
protected function no_auth_fields_check($params,$row){
|
||||||
|
|
|
@ -27,6 +27,7 @@ class ClassesHook
|
||||||
"event"=>"classes_auth_need_after",
|
"event"=>"classes_auth_need_after",
|
||||||
"classes_lib_id"=>$classes["id"],
|
"classes_lib_id"=>$classes["id"],
|
||||||
];
|
];
|
||||||
|
Message::$event_name = $params["event"];
|
||||||
Message::send($title,$desc,$mini_type,$to_id,$to_type,$status,$platform,$params,$oper_id,$oper_type);
|
Message::send($title,$desc,$mini_type,$to_id,$to_type,$status,$platform,$params,$oper_id,$oper_type);
|
||||||
|
|
||||||
|
|
||||||
|
@ -54,6 +55,7 @@ class ClassesHook
|
||||||
"event"=>"classes_auth_success_after",
|
"event"=>"classes_auth_success_after",
|
||||||
"classes_lib_id"=>$classes["id"],
|
"classes_lib_id"=>$classes["id"],
|
||||||
];
|
];
|
||||||
|
Message::$event_name = $params["event"];
|
||||||
Message::send($title,$desc,$mini_type,$to_id,$to_type,$status,$platform,$params,$oper_id,$oper_type);
|
Message::send($title,$desc,$mini_type,$to_id,$to_type,$status,$platform,$params,$oper_id,$oper_type);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -79,6 +81,7 @@ class ClassesHook
|
||||||
"event"=>"classes_auth_success_after",
|
"event"=>"classes_auth_success_after",
|
||||||
"classes_lib_id"=>$classes["id"],
|
"classes_lib_id"=>$classes["id"],
|
||||||
];
|
];
|
||||||
|
Message::$event_name = $params["event"];
|
||||||
Message::send($title,$desc,$mini_type,$to_id,$to_type,$status,$platform,$params,$oper_id,$oper_type);
|
Message::send($title,$desc,$mini_type,$to_id,$to_type,$status,$platform,$params,$oper_id,$oper_type);
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -40,6 +40,7 @@ class OrderHook
|
||||||
"order_id"=>$order["id"],
|
"order_id"=>$order["id"],
|
||||||
"order_no"=>$order["order_no"],
|
"order_no"=>$order["order_no"],
|
||||||
];
|
];
|
||||||
|
Message::$event_name = $params["event"];
|
||||||
Message::send($title,$desc,$mini_type,$to_id,$to_type,$status,$platform,$params,$oper_id,$oper_type);
|
Message::send($title,$desc,$mini_type,$to_id,$to_type,$status,$platform,$params,$oper_id,$oper_type);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -70,6 +71,7 @@ class OrderHook
|
||||||
"order_id"=>$order["id"],
|
"order_id"=>$order["id"],
|
||||||
"order_no"=>$order["order_no"],
|
"order_no"=>$order["order_no"],
|
||||||
];
|
];
|
||||||
|
Message::$event_name = $params["event"];
|
||||||
Message::send($title,$desc,$mini_type,$to_id,$to_type,$status,$platform,$params,$oper_id,$oper_type);
|
Message::send($title,$desc,$mini_type,$to_id,$to_type,$status,$platform,$params,$oper_id,$oper_type);
|
||||||
|
|
||||||
|
|
||||||
|
@ -104,6 +106,7 @@ class OrderHook
|
||||||
"order_id"=>$order["id"],
|
"order_id"=>$order["id"],
|
||||||
"order_no"=>$order["order_no"],
|
"order_no"=>$order["order_no"],
|
||||||
];
|
];
|
||||||
|
Message::$event_name = $params["event"];
|
||||||
Message::send($title,$desc,$mini_type,$to_id,$to_type,$status,$platform,$params,$oper_id,$oper_type);
|
Message::send($title,$desc,$mini_type,$to_id,$to_type,$status,$platform,$params,$oper_id,$oper_type);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -135,6 +138,7 @@ class OrderHook
|
||||||
"order_no"=>$order["order_no"],
|
"order_no"=>$order["order_no"],
|
||||||
"reason"=>$order['reason']
|
"reason"=>$order['reason']
|
||||||
];
|
];
|
||||||
|
Message::$event_name = $params["event"];
|
||||||
Message::send($title,$desc,$mini_type,$to_id,$to_type,$status,$platform,$params,$oper_id,$oper_type);
|
Message::send($title,$desc,$mini_type,$to_id,$to_type,$status,$platform,$params,$oper_id,$oper_type);
|
||||||
|
|
||||||
|
|
||||||
|
@ -166,6 +170,7 @@ class OrderHook
|
||||||
"order_id"=>$order["id"],
|
"order_id"=>$order["id"],
|
||||||
"order_no"=>$order["order_no"],
|
"order_no"=>$order["order_no"],
|
||||||
];
|
];
|
||||||
|
Message::$event_name = $params["event"];
|
||||||
Message::send($title,$desc,$mini_type,$to_id,$to_type,$status,$platform,$params,$oper_id,$oper_type);
|
Message::send($title,$desc,$mini_type,$to_id,$to_type,$status,$platform,$params,$oper_id,$oper_type);
|
||||||
|
|
||||||
|
|
||||||
|
@ -199,6 +204,7 @@ class OrderHook
|
||||||
"order_id"=>$order["id"],
|
"order_id"=>$order["id"],
|
||||||
"order_no"=>$order["order_no"],
|
"order_no"=>$order["order_no"],
|
||||||
];
|
];
|
||||||
|
Message::$event_name = $params["event"];
|
||||||
Message::send($title,$desc,$mini_type,$to_id,$to_type,$status,$platform,$params,$oper_id,$oper_type);
|
Message::send($title,$desc,$mini_type,$to_id,$to_type,$status,$platform,$params,$oper_id,$oper_type);
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -34,6 +34,7 @@ class OrderHook
|
||||||
"order_id"=>$order["id"],
|
"order_id"=>$order["id"],
|
||||||
"order_no"=>$order["order_no"],
|
"order_no"=>$order["order_no"],
|
||||||
];
|
];
|
||||||
|
Message::$event_name = $params["event"];
|
||||||
Message::send($title,$desc,$mini_type,$to_id,$to_type,$status,$platform,$params,$oper_id,$oper_type);
|
Message::send($title,$desc,$mini_type,$to_id,$to_type,$status,$platform,$params,$oper_id,$oper_type);
|
||||||
|
|
||||||
|
|
||||||
|
@ -64,6 +65,7 @@ class OrderHook
|
||||||
"order_no"=>$order["order_no"],
|
"order_no"=>$order["order_no"],
|
||||||
"classes_lib_id"=>$order["classes_lib_id"],
|
"classes_lib_id"=>$order["classes_lib_id"],
|
||||||
];
|
];
|
||||||
|
Message::$event_name = $params["event"];
|
||||||
Message::send($title,$desc,$mini_type,$to_id,$to_type,$status,$platform,$params,$oper_id,$oper_type);
|
Message::send($title,$desc,$mini_type,$to_id,$to_type,$status,$platform,$params,$oper_id,$oper_type);
|
||||||
|
|
||||||
|
|
||||||
|
@ -94,6 +96,7 @@ class OrderHook
|
||||||
"order_id"=>$order["id"],
|
"order_id"=>$order["id"],
|
||||||
"order_no"=>$order["order_no"],
|
"order_no"=>$order["order_no"],
|
||||||
];
|
];
|
||||||
|
Message::$event_name = $params["event"];
|
||||||
Message::send($title,$desc,$mini_type,$to_id,$to_type,$status,$platform,$params,$oper_id,$oper_type);
|
Message::send($title,$desc,$mini_type,$to_id,$to_type,$status,$platform,$params,$oper_id,$oper_type);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -122,6 +125,7 @@ class OrderHook
|
||||||
"order_no"=>$order["order_no"],
|
"order_no"=>$order["order_no"],
|
||||||
"classes_lib_id"=>$order["classes_lib_id"],
|
"classes_lib_id"=>$order["classes_lib_id"],
|
||||||
];
|
];
|
||||||
|
Message::$event_name = $params["event"];
|
||||||
Message::send($title,$desc,$mini_type,$to_id,$to_type,$status,$platform,$params,$oper_id,$oper_type);
|
Message::send($title,$desc,$mini_type,$to_id,$to_type,$status,$platform,$params,$oper_id,$oper_type);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -67,6 +67,7 @@ class ShopHook
|
||||||
"shop_id"=>$shop["id"],
|
"shop_id"=>$shop["id"],
|
||||||
"desc"=>$shop["desc"],
|
"desc"=>$shop["desc"],
|
||||||
];
|
];
|
||||||
|
Message::$event_name = $params["event"];
|
||||||
Message::send($title,$desc,$mini_type,$to_id,$to_type,$status,$platform,$params,$oper_id,$oper_type);
|
Message::send($title,$desc,$mini_type,$to_id,$to_type,$status,$platform,$params,$oper_id,$oper_type);
|
||||||
|
|
||||||
|
|
||||||
|
@ -102,6 +103,7 @@ class ShopHook
|
||||||
"shop_id"=>$shop["id"],
|
"shop_id"=>$shop["id"],
|
||||||
"desc"=>$shop["desc"],
|
"desc"=>$shop["desc"],
|
||||||
];
|
];
|
||||||
|
Message::$event_name = $params["event"];
|
||||||
Message::send($title,$desc,$mini_type,$to_id,$to_type,$status,$platform,$params,$oper_id,$oper_type);
|
Message::send($title,$desc,$mini_type,$to_id,$to_type,$status,$platform,$params,$oper_id,$oper_type);
|
||||||
|
|
||||||
|
|
||||||
|
@ -131,6 +133,7 @@ class ShopHook
|
||||||
"shop_id"=>$shop["id"],
|
"shop_id"=>$shop["id"],
|
||||||
"desc"=>$shop["desc"],
|
"desc"=>$shop["desc"],
|
||||||
];
|
];
|
||||||
|
Message::$event_name = $params["event"];
|
||||||
Message::send($title,$desc,$mini_type,$to_id,$to_type,$status,$platform,$params,$oper_id,$oper_type);
|
Message::send($title,$desc,$mini_type,$to_id,$to_type,$status,$platform,$params,$oper_id,$oper_type);
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -77,7 +77,8 @@ class BaseModel extends Model
|
||||||
|
|
||||||
|
|
||||||
public function no_auth_fields_check($params,$row){
|
public function no_auth_fields_check($params,$row){
|
||||||
|
$this->getTableFields();
|
||||||
|
$params = $this->checkAssemblyParameters($params);
|
||||||
foreach ($params as $k=>$v){
|
foreach ($params as $k=>$v){
|
||||||
|
|
||||||
//说明数值有变动
|
//说明数值有变动
|
||||||
|
@ -87,7 +88,7 @@ class BaseModel extends Model
|
||||||
if($row[$k]!=$params[$k]){
|
if($row[$k]!=$params[$k]){
|
||||||
//当修改参数不在允许修改的字段中
|
//当修改参数不在允许修改的字段中
|
||||||
if(!in_array($k,$this->no_auth_fields)){
|
if(!in_array($k,$this->no_auth_fields)){
|
||||||
|
// var_dump($row[$k],$params[$k]);
|
||||||
$this->have_auth = true;break;
|
$this->have_auth = true;break;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -131,6 +131,16 @@ class Message extends BaseModel
|
||||||
return $this->belongsTo('app\admin\model\User', 'to_id', 'id', [], 'LEFT')->setEagerlyType(0);
|
return $this->belongsTo('app\admin\model\User', 'to_id', 'id', [], 'LEFT')->setEagerlyType(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public function messageevent()
|
||||||
|
{
|
||||||
|
return $this->belongsTo(MessageConfig::class, 'event', 'event', [], 'LEFT')->setEagerlyType(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public static $event_name = "";
|
||||||
|
|
||||||
/** 发送站内信
|
/** 发送站内信
|
||||||
* @param $title 站内信标题
|
* @param $title 站内信标题
|
||||||
* @param $desc 内容
|
* @param $desc 内容
|
||||||
|
@ -156,6 +166,7 @@ class Message extends BaseModel
|
||||||
'to_type' => $to_type,
|
'to_type' => $to_type,
|
||||||
'status' => $status,
|
'status' => $status,
|
||||||
'mini_type' => $mini_type,
|
'mini_type' => $mini_type,
|
||||||
|
"event" =>self::$event_name ?? "",
|
||||||
];
|
];
|
||||||
$message = new self();
|
$message = new self();
|
||||||
$message->save($data);
|
$message->save($data);
|
||||||
|
@ -196,6 +207,8 @@ class Message extends BaseModel
|
||||||
$data->save();
|
$data->save();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
$data->messageevent;
|
||||||
// //加载订单详情
|
// //加载订单详情
|
||||||
// $data->detail->teacher;
|
// $data->detail->teacher;
|
||||||
// //订单用户
|
// //订单用户
|
||||||
|
@ -247,7 +260,7 @@ class Message extends BaseModel
|
||||||
if (isset($whereData['not_status'])) $model = $model->where("{$alisa}status", 'not in', $whereData['not_status']);
|
if (isset($whereData['not_status'])) $model = $model->where("{$alisa}status", 'not in', $whereData['not_status']);
|
||||||
if (isset($whereData['keywords'])&&$whereData['keywords']) $model = $model->where("{$alisa}id|{$alisa}title|{$alisa}desc", '=', $whereData['keywords']);
|
if (isset($whereData['keywords'])&&$whereData['keywords']) $model = $model->where("{$alisa}id|{$alisa}title|{$alisa}desc", '=', $whereData['keywords']);
|
||||||
if (isset($whereData['time'])&&$whereData['time']){
|
if (isset($whereData['time'])&&$whereData['time']){
|
||||||
$model = $model->time($whereData['time']);
|
$model = $model->time(['createtime',$whereData['time']]);
|
||||||
}
|
}
|
||||||
if (isset($whereData['user_id']) && $whereData['user_id']) $model = $model->where("{$alisa}to_id", '=', $whereData['user_id']);
|
if (isset($whereData['user_id']) && $whereData['user_id']) $model = $model->where("{$alisa}to_id", '=', $whereData['user_id']);
|
||||||
|
|
||||||
|
@ -268,7 +281,6 @@ class Message extends BaseModel
|
||||||
$query->where("{$alisa}to_id", $whereData['to_id'])
|
$query->where("{$alisa}to_id", $whereData['to_id'])
|
||||||
->whereOr("{$alisa}to_id", '=', 0);
|
->whereOr("{$alisa}to_id", '=', 0);
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -305,9 +317,10 @@ class Message extends BaseModel
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public static function messageList($page, $limit,$to_id,$keywords,$status,$mini_type,$type){
|
public static function messageList($page, $limit,$to_id,$keywords,$status,$mini_type,$type,$time=null){
|
||||||
$with_field = [
|
$with_field = [
|
||||||
'user'=>['nickname','mobile','avatar','realname'],
|
'user'=>['nickname','mobile','avatar','realname'],
|
||||||
|
'messageevent'=>['event','logo_image'],
|
||||||
'base'=>['*'],
|
'base'=>['*'],
|
||||||
// 'shop'=>['*'],
|
// 'shop'=>['*'],
|
||||||
// 'detail'=>['*'],
|
// 'detail'=>['*'],
|
||||||
|
@ -316,7 +329,7 @@ class Message extends BaseModel
|
||||||
$alisa = (new self)->getWithAlisaName();
|
$alisa = (new self)->getWithAlisaName();
|
||||||
$sort = "{$alisa}.weigh desc,{$alisa}.id desc";
|
$sort = "{$alisa}.weigh desc,{$alisa}.id desc";
|
||||||
// $sort = "field({$alisa}.type,'1','2') asc,{$alisa}.weigh desc,{$alisa}.id desc";
|
// $sort = "field({$alisa}.type,'1','2') asc,{$alisa}.weigh desc,{$alisa}.id desc";
|
||||||
$serch_where = ["to_id"=>$to_id,'platform'=>"user",'status'=>$status,'keywords'=>$keywords,"mini_type"=>$mini_type,"type"=>$type];
|
$serch_where = ["to_id"=>$to_id,'platform'=>"user",'status'=>$status,'keywords'=>$keywords,"mini_type"=>$mini_type,"type"=>$type,"time"=>$time];
|
||||||
// if($type)$serch_where['type'] = $type;
|
// if($type)$serch_where['type'] = $type;
|
||||||
return (new self)->getBaseList($serch_where, $page, $limit,$sort,$with_field);
|
return (new self)->getBaseList($serch_where, $page, $limit,$sort,$with_field);
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,107 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace app\common\model\school;
|
||||||
|
|
||||||
|
use think\Model;
|
||||||
|
use traits\model\SoftDelete;
|
||||||
|
|
||||||
|
class MessageConfig extends Model
|
||||||
|
{
|
||||||
|
|
||||||
|
use SoftDelete;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// 表名
|
||||||
|
protected $name = 'school_message_config';
|
||||||
|
|
||||||
|
// 自动写入时间戳字段
|
||||||
|
protected $autoWriteTimestamp = 'integer';
|
||||||
|
|
||||||
|
// 定义时间戳字段名
|
||||||
|
protected $createTime = 'createtime';
|
||||||
|
protected $updateTime = 'updatetime';
|
||||||
|
protected $deleteTime = 'deletetime';
|
||||||
|
|
||||||
|
// 追加属性
|
||||||
|
protected $append = [
|
||||||
|
'status_text',
|
||||||
|
'wechat_wap_text',
|
||||||
|
'message_text',
|
||||||
|
'selfmail_text'
|
||||||
|
];
|
||||||
|
|
||||||
|
|
||||||
|
protected static function init()
|
||||||
|
{
|
||||||
|
self::afterInsert(function ($row) {
|
||||||
|
if (!$row['weigh']) {
|
||||||
|
$pk = $row->getPk();
|
||||||
|
$row->getQuery()->where($pk, $row[$pk])->update(['weigh' => $row[$pk]]);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public function getStatusList()
|
||||||
|
{
|
||||||
|
return ['1' => __('Status 1'), '2' => __('Status 2')];
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getWechatWapList()
|
||||||
|
{
|
||||||
|
return ['1' => __('Wechat_wap 1'), '2' => __('Wechat_wap 2')];
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getMessageList()
|
||||||
|
{
|
||||||
|
return ['1' => __('Message 1'), '2' => __('Message 2')];
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getSelfmailList()
|
||||||
|
{
|
||||||
|
return ['1' => __('Selfmail 1'), '2' => __('Selfmail 2')];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public function getStatusTextAttr($value, $data)
|
||||||
|
{
|
||||||
|
$value = $value ? $value : (isset($data['status']) ? $data['status'] : '');
|
||||||
|
$list = $this->getStatusList();
|
||||||
|
return isset($list[$value]) ? $list[$value] : '';
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public function getWechatWapTextAttr($value, $data)
|
||||||
|
{
|
||||||
|
$value = $value ? $value : (isset($data['wechat_wap']) ? $data['wechat_wap'] : '');
|
||||||
|
$list = $this->getWechatWapList();
|
||||||
|
return isset($list[$value]) ? $list[$value] : '';
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public function getMessageTextAttr($value, $data)
|
||||||
|
{
|
||||||
|
$value = $value ? $value : (isset($data['message']) ? $data['message'] : '');
|
||||||
|
$list = $this->getMessageList();
|
||||||
|
return isset($list[$value]) ? $list[$value] : '';
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public function getSelfmailTextAttr($value, $data)
|
||||||
|
{
|
||||||
|
$value = $value ? $value : (isset($data['selfmail']) ? $data['selfmail'] : '');
|
||||||
|
$list = $this->getSelfmailList();
|
||||||
|
return isset($list[$value]) ? $list[$value] : '';
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public function getLogoImageAttr($value, $data)
|
||||||
|
{
|
||||||
|
if (!empty($value)) return cdnurl($value, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -872,6 +872,7 @@ $user_unpaid_order = $user_paid_order =null;
|
||||||
if(!$this->no_auth_fields_check($params,$row)){
|
if(!$this->no_auth_fields_check($params,$row)){
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 课程存在未完成订单则不允许操作
|
// 课程存在未完成订单则不允许操作
|
||||||
|
@ -891,7 +892,7 @@ $user_unpaid_order = $user_paid_order =null;
|
||||||
{
|
{
|
||||||
$params["auth_status"] = $params["auth_status"] ?? '0';
|
$params["auth_status"] = $params["auth_status"] ?? '0';
|
||||||
$params["status"] = $params["status"] ?? '3';
|
$params["status"] = $params["status"] ?? '3';
|
||||||
|
if(!$shop_id)$shop_id = $params["shop_id"] ?? 0;
|
||||||
|
|
||||||
|
|
||||||
$manystore = Manystore::where("shop_id",$shop_id)->find();
|
$manystore = Manystore::where("shop_id",$shop_id)->find();
|
||||||
|
@ -1008,23 +1009,77 @@ $user_unpaid_order = $user_paid_order =null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//如果存在课程规格,验证每个课时规格的合法性
|
||||||
|
if(isset($params["spec"])){
|
||||||
|
//如果存在"的HTML转义字符,先反转义再解析json
|
||||||
|
$params["spec"] = html_entity_decode($params["spec"]);
|
||||||
|
$spec = json_decode($params["spec"],true);
|
||||||
|
if(empty($spec))throw new \Exception("请至少添加一个课时规格");
|
||||||
|
|
||||||
|
foreach ($spec as $k=>&$v){
|
||||||
|
$v["classes_lib_id"] = $row->id;
|
||||||
|
(new ClassesSpec)->specCheck($v,$shop_id,empty($v["id"])? null : ClassesSpec::get($v["id"]));
|
||||||
|
|
||||||
|
}
|
||||||
|
$params["spec"] = $spec;
|
||||||
|
}
|
||||||
|
|
||||||
}else{
|
}else{
|
||||||
//新增
|
//新增
|
||||||
|
|
||||||
//名称title不能重复
|
//名称title不能重复
|
||||||
$check_title = $this->model->where('title',$params["title"])->find();
|
$check_title = self::where('title',$params["title"])->find();
|
||||||
if($check_title){
|
if($check_title){
|
||||||
throw new \Exception("课程名称已存在或被其他机构占用,请更改!");
|
throw new \Exception("课程名称已存在或被其他机构占用,请更改!");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//如果存在课程规格,验证每个课时规格的合法性
|
||||||
|
if(isset($params["spec"])){
|
||||||
|
|
||||||
|
$spec = json_decode($params["spec"],true);
|
||||||
|
if(empty($spec))throw new \Exception("请至少添加一个课时规格");
|
||||||
|
|
||||||
|
foreach ($spec as $k=>&$v){
|
||||||
|
$v["classes_lib_id"] = 0;
|
||||||
|
(new ClassesSpec)->specCheck($v,$shop_id,null);
|
||||||
|
}
|
||||||
|
$params["spec"] = $spec;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
$params["delete_spec_ids"] = [];
|
||||||
|
//按前端顺序分配显示权重
|
||||||
|
if(isset($params["spec"]) && $params["spec"]){
|
||||||
|
//数组倒过来
|
||||||
|
$params["spec"] = array_reverse($params["spec"]);
|
||||||
|
$insert_spec = [];
|
||||||
|
foreach ($params["spec"] as $k=>&$v){
|
||||||
|
$v["weigh"] = $k;
|
||||||
|
if(!empty($v["id"]))$insert_spec[] = $v["id"];
|
||||||
|
}
|
||||||
|
if($insert_spec && $row){
|
||||||
|
$params["delete_spec_ids"] = ClassesSpec::where("classes_lib_id",$row->id)->where("id","not in",$insert_spec)->column("id");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//存在需要删除的规格则判断规格是否能删除
|
||||||
|
if($params["delete_spec_ids"] && $row){
|
||||||
|
$check_spec = \app\common\model\school\classes\ClassesSpec::where("classes_lib_id",$row->id)->where("id","in",$params["delete_spec_ids"])->select();
|
||||||
|
foreach ($check_spec as $k=>$vv){
|
||||||
|
(new \app\common\model\school\classes\ClassesSpec)->updateCheck($vv->id);
|
||||||
|
}
|
||||||
|
$params["delete_spec_ids"] = $check_spec;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//如果是上架,判断是否拥有课时规格,没有则无法上架
|
//如果是上架,判断是否拥有课时规格,没有则无法上架
|
||||||
if($params["status"]=="1" && empty($params["spec"])){
|
if(empty($params["spec"])){
|
||||||
if(!$row)throw new \Exception("新添加的课程请先至少添加一个课时规格后再上架!");
|
if(!$row)throw new \Exception("新添加的课程请先至少添加一个课时规格后再上架!");
|
||||||
//判断是否拥有课时规格,没有则无法上架
|
//判断是否拥有课时规格,没有则无法上架
|
||||||
$check_spec = \app\common\model\school\classes\ClassesSpec::where("classes_lib_id",$row->id)->count();
|
$check_spec = \app\common\model\school\classes\ClassesSpec::where("classes_lib_id",$row->id)->count();
|
||||||
if(!$check_spec)throw new \Exception("新添加的课程请先至少添加一个课时规格后再上架!");
|
if(!$check_spec)throw new \Exception("新添加的课程请先至少添加一个课时规格后再上架!");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,11 +31,11 @@ class ClassesSpec extends BaseModel
|
||||||
'status_text'
|
'status_text'
|
||||||
];
|
];
|
||||||
|
|
||||||
|
public $no_auth_fields = ['name','limit_num','status','weigh'];
|
||||||
protected static function init()
|
protected static function init()
|
||||||
{
|
{
|
||||||
self::afterInsert(function ($row) {
|
self::afterInsert(function ($row) {
|
||||||
if (!$row['weigh']) {
|
if (empty($row['weigh'])) {
|
||||||
$pk = $row->getPk();
|
$pk = $row->getPk();
|
||||||
$row->getQuery()->where($pk, $row[$pk])->update(['weigh' => $row[$pk]]);
|
$row->getQuery()->where($pk, $row[$pk])->update(['weigh' => $row[$pk]]);
|
||||||
}
|
}
|
||||||
|
@ -87,9 +87,9 @@ class ClassesSpec extends BaseModel
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
protected function specupdateCheck($id,$params=[],$row=null){
|
public function updateCheck($id,$params=[],$row=null){
|
||||||
if($params && $row){
|
if($params && $row){
|
||||||
|
// var_dump($this->no_auth_fields_check($params,$row));
|
||||||
if(!$this->no_auth_fields_check($params,$row)){
|
if(!$this->no_auth_fields_check($params,$row)){
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -117,7 +117,7 @@ class ClassesSpec extends BaseModel
|
||||||
if(empty($time))throw new \Exception("请选择开始和结束时间");
|
if(empty($time))throw new \Exception("请选择开始和结束时间");
|
||||||
$split_line = " - ";
|
$split_line = " - ";
|
||||||
$time_arr = explode($split_line,$time);
|
$time_arr = explode($split_line,$time);
|
||||||
$params["start_time"] = $time_arr[0];
|
$params["start_time"] = $time_arr[0] ;
|
||||||
$params["end_time"] = $time_arr[1];
|
$params["end_time"] = $time_arr[1];
|
||||||
unset($params["time"]);
|
unset($params["time"]);
|
||||||
|
|
||||||
|
@ -138,14 +138,21 @@ class ClassesSpec extends BaseModel
|
||||||
//结束时间不能是已经过去的时间
|
//结束时间不能是已经过去的时间
|
||||||
$now_time = time();
|
$now_time = time();
|
||||||
if($end_time<=$now_time){
|
if($end_time<=$now_time){
|
||||||
throw new \Exception("结束时间不能是已经过去的时间");
|
// throw new \Exception("结束时间不能是已经过去的时间");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$params["start_time"] = $start_time;
|
||||||
|
$params["end_time"] = $end_time;
|
||||||
|
|
||||||
|
|
||||||
$orderTimeTableName = (new ClassesSpec)->getWithAlisaName();
|
$orderTimeTableName = (new ClassesSpec)->getWithAlisaName();
|
||||||
//修改
|
//修改
|
||||||
if($row){
|
if($row){
|
||||||
$this->specupdateCheck($row->id,$params,$row);
|
//修复旧数据时间戳
|
||||||
|
$row["start_time"]= strtotime(date("Y-m-d H:i",$row["start_time"]));
|
||||||
|
$row["end_time"]= strtotime(date("Y-m-d H:i",$row["end_time"]));
|
||||||
|
|
||||||
|
$this->updateCheck($row->id,$params,$row);
|
||||||
|
|
||||||
//规格名字不能一样(同课程下)
|
//规格名字不能一样(同课程下)
|
||||||
$spec_name = $params["name"];
|
$spec_name = $params["name"];
|
||||||
|
|
|
@ -297,8 +297,16 @@ class ClassesLib extends ManystoreBase
|
||||||
$this->model->validateFailException(true)->validate($validate);
|
$this->model->validateFailException(true)->validate($validate);
|
||||||
}
|
}
|
||||||
$this->update_check($params,$row=null);
|
$this->update_check($params,$row=null);
|
||||||
|
$spec = $params["spec"];
|
||||||
|
unset($params["spec"]);
|
||||||
$result = $this->model->allowField(true)->save($params);
|
$result = $this->model->allowField(true)->save($params);
|
||||||
\app\common\model\school\classes\ClassesLib::add_virtual_init($this->model["id"]);
|
\app\common\model\school\classes\ClassesLib::add_virtual_init($this->model["id"]);
|
||||||
|
//添加课程规格
|
||||||
|
foreach ($spec as $k=>$v){
|
||||||
|
$v["classes_lib_id"] = $this->model["id"];
|
||||||
|
\app\common\model\school\classes\ClassesSpec::create($v);
|
||||||
|
}
|
||||||
|
|
||||||
$this->update_classes($this->model["id"]);
|
$this->update_classes($this->model["id"]);
|
||||||
if($this->have_auth){
|
if($this->have_auth){
|
||||||
//调用通过事件
|
//调用通过事件
|
||||||
|
@ -422,9 +430,30 @@ class ClassesLib extends ManystoreBase
|
||||||
$validate = is_bool($this->modelValidate) ? ($this->modelSceneValidate ? $name . '.edit' : $name) : $this->modelValidate;
|
$validate = is_bool($this->modelValidate) ? ($this->modelSceneValidate ? $name . '.edit' : $name) : $this->modelValidate;
|
||||||
$row->validateFailException(true)->validate($validate);
|
$row->validateFailException(true)->validate($validate);
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->update_check($params,$row);
|
$this->update_check($params,$row);
|
||||||
|
|
||||||
|
$spec = $params["spec"] ?? [];//$params["delete_spec_ids"]
|
||||||
|
$delete_spec_ids = $params["delete_spec_ids"] ?? [];
|
||||||
|
unset($params["spec"]);
|
||||||
|
unset($params["delete_spec_ids"]);
|
||||||
|
|
||||||
$result = $row->allowField(true)->save($params);
|
$result = $row->allowField(true)->save($params);
|
||||||
|
|
||||||
|
foreach ($spec as $k=>$v){
|
||||||
|
$v["classes_lib_id"] = $row["id"];
|
||||||
|
//有id更新,否则新增
|
||||||
|
if(isset($v["id"]) && $v["id"]){
|
||||||
|
\app\common\model\school\classes\ClassesSpec::update((new \app\common\model\school\classes\ClassesSpec)->checkAssemblyParameters($v));
|
||||||
|
}else{
|
||||||
|
\app\common\model\school\classes\ClassesSpec::create((new \app\common\model\school\classes\ClassesSpec)->checkAssemblyParameters($v));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//删除规格
|
||||||
|
foreach ($delete_spec_ids as $k=>$delete_spec){
|
||||||
|
$delete_spec->delete();
|
||||||
|
}
|
||||||
|
|
||||||
$this->update_classes($row["id"]);
|
$this->update_classes($row["id"]);
|
||||||
|
|
||||||
if($this->have_auth){
|
if($this->have_auth){
|
||||||
|
@ -454,6 +483,12 @@ class ClassesLib extends ManystoreBase
|
||||||
}
|
}
|
||||||
$this->error(__('Parameter %s can not be empty', ''));
|
$this->error(__('Parameter %s can not be empty', ''));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$spec = \app\common\model\school\classes\ClassesSpec::where("classes_lib_id",$row["id"])->field("id,classes_lib_id,name,start_time,end_time,limit_num,status,weigh")->order('weigh desc,id desc')->select();
|
||||||
|
foreach ($spec as $k=>&$v){
|
||||||
|
$v["time"] = date("Y/m/d H:i",$v["start_time"])." - ".date("Y/m/d H:i",$v["end_time"]);
|
||||||
|
}
|
||||||
|
$row["spec"] = json_encode($spec, JSON_UNESCAPED_UNICODE);//不转义任何字符串
|
||||||
$this->view->assign("row", $row);
|
$this->view->assign("row", $row);
|
||||||
return $this->view->fetch();
|
return $this->view->fetch();
|
||||||
}
|
}
|
||||||
|
|
|
@ -135,16 +135,28 @@ class ClassesSpec extends ManystoreBase
|
||||||
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
(new \app\common\model\school\classes\ClassesSpec)->specCheck($params,SHOP_ID,$row);
|
|
||||||
|
$classesLib = new \app\common\model\school\classes\ClassesSpec();
|
||||||
|
$classesLib->no_auth_fields = $this->no_auth_fields;
|
||||||
|
$classesLib->need_auth = $this->need_auth;
|
||||||
|
$classesLib->have_auth = $this->have_auth;
|
||||||
|
$classesLib->specCheck($params,SHOP_ID,$row);
|
||||||
|
$this->need_auth = $classesLib->need_auth;
|
||||||
|
$this->have_auth = $classesLib->have_auth;
|
||||||
|
|
||||||
|
//修改
|
||||||
|
if($row){
|
||||||
|
$classesLib->updateCheck($row->id,$params,$row);
|
||||||
|
}else{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// (new \app\common\model\school\classes\ClassesSpec)->specCheck($params,SHOP_ID,$row);
|
||||||
}catch (\Exception $e){
|
}catch (\Exception $e){
|
||||||
$this->error($e->getMessage());
|
$this->error($e->getMessage());
|
||||||
}
|
}
|
||||||
|
|
||||||
//修改
|
|
||||||
if($row){
|
|
||||||
$this->updateCheck($row->id,$params,$row);
|
|
||||||
}else{
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -146,9 +146,9 @@
|
||||||
<!--定义模板-->
|
<!--定义模板-->
|
||||||
<script type="text/html" id="testtpl">
|
<script type="text/html" id="testtpl">
|
||||||
<tr class="form-inline">
|
<tr class="form-inline">
|
||||||
<td><input type="text" name="row[<%=name%>][<%=index%>][name]" data-rule="required" class="form-control" value="<%=row['name']%>" size="20" placeholder="课时名"></td>
|
<td><input type="text" name="row[<%=name%>][<%=index%>][name]" data-rule="required" class="form-control" value="<%=row['name']%>" size="25" placeholder="课时名"></td>
|
||||||
<td>
|
<td>
|
||||||
<input type="text" name="row[<%=name%>][<%=index%>][time]" data-rule="required" class="form-control datetimerange" data-time-picker="true" data-locale='{"format":"YYYY/MM/DD HH:mm"}' placeholder="指定开始结束时间" value="<%=row['time']%>" size="20" />
|
<input type="text" name="row[<%=name%>][<%=index%>][time]" data-rule="required" class="form-control datetimerange" data-time-picker="true" data-locale='{"format":"YYYY/MM/DD HH:mm"}' placeholder="指定开始结束时间" value="<%=row['time']%>" size="30" />
|
||||||
<!--<input type="text" class="form-control datetimerange" name="updatetime" value="" placeholder="修改时间" id="updatetime" data-index="49" autocomplete="off">-->
|
<!--<input type="text" class="form-control datetimerange" name="updatetime" value="" placeholder="修改时间" id="updatetime" data-index="49" autocomplete="off">-->
|
||||||
|
|
||||||
</td>
|
</td>
|
||||||
|
|
|
@ -166,6 +166,58 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2">{:__('课时规格信息')}:</label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
<table class="table table-responsive fieldlist" data-name="row[spec]" data-template="testtpl" data-tag="tr">
|
||||||
|
<tr>
|
||||||
|
<td>规格名</td>
|
||||||
|
<td>开始结束时间</td>
|
||||||
|
<td>限定人数</td>
|
||||||
|
<!-- <td>权重</td>-->
|
||||||
|
<td>上架状态</td>
|
||||||
|
<td></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td colspan="5"><a href="javascript:;" class="btn btn-sm btn-success btn-append"><i class="fa fa-plus"></i> 追加</a></td>
|
||||||
|
</tr>
|
||||||
|
<textarea name="row[spec]" id="spec" class="form-control hide" cols="30" rows="5">
|
||||||
|
{$row["spec"]}
|
||||||
|
</textarea>
|
||||||
|
|
||||||
|
</table>
|
||||||
|
<span style="color: red">(每个课时规格为当前课程的一节课,课程总共多少节课就需要上多少个课时规格,每个课时的开始和结束时间不能有重叠,后续有变更将触发审核机制!)</span>
|
||||||
|
<!--定义模板-->
|
||||||
|
<script type="text/html" id="testtpl">
|
||||||
|
<tr class="form-inline">
|
||||||
|
<td>
|
||||||
|
<input type="hidden" name="row[<%=name%>][<%=index%>][id]" class="form-control" value="<%=row['id']%>" size="20" >
|
||||||
|
<input type="text" name="row[<%=name%>][<%=index%>][name]" data-rule="required" class="form-control" value="<%=row['name']%>" size="25" placeholder="课时名"></td>
|
||||||
|
<td>
|
||||||
|
<input type="text" name="row[<%=name%>][<%=index%>][time]" data-rule="required" class="form-control datetimerange" data-time-picker="true" data-locale='{"format":"YYYY/MM/DD HH:mm"}' placeholder="指定开始结束时间" value="<%=row['time']%>" size="30" />
|
||||||
|
<!--<input type="text" class="form-control datetimerange" name="updatetime" value="" placeholder="修改时间" id="updatetime" data-index="49" autocomplete="off">-->
|
||||||
|
|
||||||
|
</td>
|
||||||
|
<td><input type="text" name="row[<%=name%>][<%=index%>][limit_num]" data-rule="required" class="form-control" value="<%=row['limit_num']%>" placeholder="课时限制人数" size="2" onkeyup="this.value=this.value.replace(/[^0-9]/g,'')" onafterpaste="this.value=this.value.replace(/[^0-9]/g,'')"></td>
|
||||||
|
<!-- <td><input type="text" name="row[<%=name%>][<%=index%>][weigh]" data-rule="required" class="form-control" value="<%=row['weigh']%>" size="2" placeholder="课时排序权重" onkeyup="this.value=this.value.replace(/[^0-9]/g,'')" onafterpaste="this.value=this.value.replace(/[^0-9]/g,'')"></td>-->
|
||||||
|
<td>
|
||||||
|
<select id="c-status" class="form-control" name="row[<%=name%>][<%=index%>][status]">
|
||||||
|
{foreach name="specStatusList" item="vo"}
|
||||||
|
<option value="{$key}" <%if(row.status=={$key}){%> selected <%}%> >{$vo}</option>
|
||||||
|
{/foreach}
|
||||||
|
</select>
|
||||||
|
</td>
|
||||||
|
<td><span class="btn btn-sm btn-danger btn-remove"><i class="fa fa-times"></i></span> <span class="btn btn-sm btn-primary btn-dragsort"><i class="fa fa-arrows"></i></span></td>
|
||||||
|
</tr>
|
||||||
|
</script>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
|
@ -365,7 +417,7 @@
|
||||||
<label class="control-label col-xs-12 col-sm-2"></label>
|
<label class="control-label col-xs-12 col-sm-2"></label>
|
||||||
<div class="col-xs-12 col-sm-8">
|
<div class="col-xs-12 col-sm-8">
|
||||||
<button type="submit" class="btn btn-success btn-embossed disabled">{:__('提交修改【涉及名称等核心数据将提交审核,审核时课程会下架】')}</button>
|
<button type="submit" class="btn btn-success btn-embossed disabled">{:__('提交修改【涉及名称等核心数据将提交审核,审核时课程会下架】')}</button>
|
||||||
<button type="button" data-url="school/classes/classes_spec/index?classes_lib_id={$row.id}" class="btn btn-success btn-changeuser {:$auth->check('school/classes/classes_spec/index')?'':'hide'}" title="{:__('设置课时')}" ><i class="fa fa-plus"></i> {:__('设置课时')}</button>
|
<!-- <button type="button" data-url="school/classes/classes_spec/index?classes_lib_id={$row.id}" class="btn btn-success btn-changeuser {:$auth->check('school/classes/classes_spec/index')?'':'hide'}" title="{:__('查看和设置课时')}" ><i class="fa fa-plus"></i> {:__('查看和设置课时')}</button>-->
|
||||||
|
|
||||||
|
|
||||||
<button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
|
<button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
|
||||||
|
|
|
@ -27,10 +27,10 @@
|
||||||
|
|
||||||
<div id="toolbar" class="toolbar">
|
<div id="toolbar" class="toolbar">
|
||||||
<a href="javascript:;" class="btn btn-primary btn-refresh" title="{:__('Refresh')}" ><i class="fa fa-refresh"></i> </a>
|
<a href="javascript:;" class="btn btn-primary btn-refresh" title="{:__('Refresh')}" ><i class="fa fa-refresh"></i> </a>
|
||||||
<a href="javascript:;" class="btn btn-success btn-add {:$auth->check('school/classes/classes_lib/add')?'':'hide'}" title="{:__('Add')}" ><i class="fa fa-plus"></i> {:__('Add')}</a>
|
<!-- <a href="javascript:;" class="btn btn-success btn-add {:$auth->check('school/classes/classes_lib/add')?'':'hide'}" title="{:__('Add')}" ><i class="fa fa-plus"></i> {:__('Add')}</a>-->
|
||||||
|
|
||||||
|
|
||||||
<a href="javascript:;" data-url="school/classes/classes_lib/addnew" class="btn btn-success btn-changeuser {:$auth->check('school/classes/classes_lib/addnew')?'':'hide'}" title="{:__('新版添加')}" ><i class="fa fa-plus"></i> {:__('新版添加')}(开发中)</a>
|
<a href="javascript:;" data-url="school/classes/classes_lib/addnew" class="btn btn-success btn-changeuser {:$auth->check('school/classes/classes_lib/addnew')?'':'hide'}" title="{:__('Add')}" ><i class="fa fa-plus"></i> {:__('Add')}</a>
|
||||||
|
|
||||||
<a href="javascript:;" class="btn btn-success btn-edit btn-disabled disabled {:$auth->check('school/classes/classes_lib/edit')?'':'hide'}" title="{:__('Edit')}" ><i class="fa fa-pencil"></i> {:__('Edit')}</a>
|
<a href="javascript:;" class="btn btn-success btn-edit btn-disabled disabled {:$auth->check('school/classes/classes_lib/edit')?'':'hide'}" title="{:__('Edit')}" ><i class="fa fa-pencil"></i> {:__('Edit')}</a>
|
||||||
<a href="javascript:;" class="btn btn-danger btn-del btn-disabled disabled {:$auth->check('school/classes/classes_lib/del')?'':'hide'}" title="{:__('Delete')}" ><i class="fa fa-trash"></i> {:__('Delete')}</a>
|
<a href="javascript:;" class="btn btn-danger btn-del btn-disabled disabled {:$auth->check('school/classes/classes_lib/del')?'':'hide'}" title="{:__('Delete')}" ><i class="fa fa-trash"></i> {:__('Delete')}</a>
|
||||||
|
|
|
@ -30,20 +30,20 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
||||||
|
|
||||||
{checkbox: true},
|
{checkbox: true},
|
||||||
{field: 'operate', title: __('Operate'), table: table , buttons: [
|
{field: 'operate', title: __('Operate'), table: table , buttons: [
|
||||||
{
|
// {
|
||||||
name: 'classes_spec',
|
// name: 'classes_spec',
|
||||||
text: __('设置课程规格'),
|
// text: __('设置课程规格'),
|
||||||
title: __('设置课程规格'),
|
// title: __('设置课程规格'),
|
||||||
classname: 'btn btn-xs btn-danger btn-magic btn-dialog',
|
// classname: 'btn btn-xs btn-danger btn-magic btn-dialog',
|
||||||
icon: 'fa fa-list',
|
// icon: 'fa fa-list',
|
||||||
url: classes_spec_url,
|
// url: classes_spec_url,
|
||||||
callback: function (data) {
|
// callback: function (data) {
|
||||||
|
//
|
||||||
},
|
// },
|
||||||
// visible: function (row) {
|
// // visible: function (row) {
|
||||||
// return row.status == '2'||row.status == '3';
|
// // return row.status == '2'||row.status == '3';
|
||||||
// }
|
// // }
|
||||||
},
|
// },
|
||||||
{
|
{
|
||||||
name: 'virtual_user',
|
name: 'virtual_user',
|
||||||
text: __('设置虚拟参与者'),
|
text: __('设置虚拟参与者'),
|
||||||
|
@ -329,6 +329,38 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
||||||
Controller.api.bindevent();
|
Controller.api.bindevent();
|
||||||
},
|
},
|
||||||
edit: function () {
|
edit: function () {
|
||||||
|
|
||||||
|
//因为日期选择框不会触发change事件,导致无法刷新textarea,所以加上判断
|
||||||
|
$(document).on("dp.change", "#edit-form .datetimerange", function () {
|
||||||
|
$(this).parent().prev().find("input").trigger("change");
|
||||||
|
});
|
||||||
|
|
||||||
|
$(document).on("dp.change", "#edit-form .datetimepicker", function () {
|
||||||
|
$(this).parent().prev().find("input").trigger("change");
|
||||||
|
});
|
||||||
|
|
||||||
|
$(document).on("fa.event.appendfieldlist", "#edit-form .btn-append", function (e, obj) {
|
||||||
|
// Form.api.bindevent($("form[role=form]"));
|
||||||
|
// // //绑定动态下拉组件
|
||||||
|
Form.events.selectpage(obj);
|
||||||
|
// // //绑定日期组件
|
||||||
|
Form.events.daterangepicker(obj);
|
||||||
|
Form.events.datetimepicker(obj);
|
||||||
|
Form.events.selectpicker(obj);
|
||||||
|
// Form.events.switcher(obj);
|
||||||
|
|
||||||
|
// // Form.events.datetimerange(obj);
|
||||||
|
// Form.api.bindevent(this);
|
||||||
|
// //绑定上传组件
|
||||||
|
// Form.events.faupload(obj);
|
||||||
|
|
||||||
|
// //上传成功回调事件,变更按钮的背景
|
||||||
|
// $(".upload-image", obj).data("upload-success", function (data) {
|
||||||
|
// $(this).css("background-image", "url('" + Fast.api.cdnurl(data.url) + "')");
|
||||||
|
// })
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
Controller.api.bindevent();
|
Controller.api.bindevent();
|
||||||
},
|
},
|
||||||
api: {
|
api: {
|
||||||
|
|
|
@ -31,19 +31,23 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
||||||
|
|
||||||
{field: 'id', title: __('Id')},
|
{field: 'id', title: __('Id')},
|
||||||
{field: 'weigh', title: __('Weigh'), operate: false,sortable: true},
|
{field: 'weigh', title: __('Weigh'), operate: false,sortable: true},
|
||||||
|
{field: 'messageevent.logo_image', title: __('Logo_image'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image},
|
||||||
|
|
||||||
{field: 'type', title: __('Type'), searchList: {"1":__('Type 1'),"2":__('Type 2')}, formatter: Table.api.formatter.normal},
|
{field: 'type', title: __('Type'), searchList: {"1":__('Type 1'),"2":__('Type 2')}, formatter: Table.api.formatter.normal},
|
||||||
|
{field: 'status', title: __('Status'), searchList: {"system":__('Status system'),"classes":__('Status classes'),"order":__('Status order')}, formatter: Table.api.formatter.status},
|
||||||
|
{field: 'mini_type', title: __('Mini_type'), searchList: {"order_notice":__('Mini_type order_notice'),"classes_auth":__('Mini_type classes_auth'),"classes_apply":__('Mini_type classes_apply'),"shop_apply":__('Mini_type shop_apply'),"classes_order_notice":__('Mini_type classes_order_notice'),"user_auth":__('Mini_type user_auth'),"aftercare":__('Mini_type aftercare'),"other":__('Mini_type other')}, formatter: Table.api.formatter.normal},
|
||||||
|
{field: 'event', title: __('Event'),visible:false, operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
|
||||||
|
{field: 'title', title: __('Title'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
|
||||||
|
{field: 'desc', title: __('Desc'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
{field: 'platform', title: __('Platform'), searchList: {"admin":__('Platform admin'),"user":__('Platform user'),"shop":__('Platform shop')}, operate:'FIND_IN_SET', formatter: Table.api.formatter.label},
|
{field: 'platform', title: __('Platform'), searchList: {"admin":__('Platform admin'),"user":__('Platform user'),"shop":__('Platform shop')}, operate:'FIND_IN_SET', formatter: Table.api.formatter.label},
|
||||||
{field: 'oper_type', title: __('Oper_type'), searchList: {"admin":__('Oper_type admin'),"user":__('Oper_type user'),"system":__('Oper_type system'),"shop":__('Oper_type shop')}, formatter: Table.api.formatter.normal},
|
{field: 'oper_type', title: __('Oper_type'), searchList: {"admin":__('Oper_type admin'),"user":__('Oper_type user'),"system":__('Oper_type system'),"shop":__('Oper_type shop')}, formatter: Table.api.formatter.normal},
|
||||||
{field: 'oper_id', title: __('Oper_id')},
|
{field: 'oper_id', title: __('Oper_id')},
|
||||||
{field: 'to_type', title: __('To_type'), searchList: {"admin":__('To_type admin'),"user":__('To_type user'),"system":__('To_type system'),"shop":__('To_type shop')}, formatter: Table.api.formatter.normal},
|
{field: 'to_type', title: __('To_type'), searchList: {"admin":__('To_type admin'),"user":__('To_type user'),"system":__('To_type system'),"shop":__('To_type shop')}, formatter: Table.api.formatter.normal},
|
||||||
{field: 'to_id', title: __('To_id')},
|
{field: 'to_id', title: __('To_id')},
|
||||||
{field: 'status', title: __('Status'), searchList: {"system":__('Status system'),"classes":__('Status classes'),"order":__('Status order')}, formatter: Table.api.formatter.status},
|
// {field: 'params', title: __('Params'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
|
||||||
{field: 'mini_type', title: __('Mini_type'), searchList: {"order_notice":__('Mini_type order_notice'),"classes_auth":__('Mini_type classes_auth'),"classes_apply":__('Mini_type classes_apply'),"shop_apply":__('Mini_type shop_apply'),"classes_order_notice":__('Mini_type classes_order_notice'),"user_auth":__('Mini_type user_auth'),"aftercare":__('Mini_type aftercare'),"other":__('Mini_type other')}, formatter: Table.api.formatter.normal},
|
|
||||||
{field: 'title', title: __('Title'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
|
|
||||||
{field: 'desc', title: __('Desc'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
|
|
||||||
// {field: 'params', title: __('Params'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
|
|
||||||
{field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
|
{field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
|
||||||
{field: 'admin.nickname', title: __('Admin.nickname'), operate: 'LIKE'},
|
{field: 'admin.nickname', title: __('Admin.nickname'), operate: 'LIKE'},
|
||||||
{field: 'admin.avatar', title: __('Admin.avatar'), operate: 'LIKE', events: Table.api.events.image, formatter: Table.api.formatter.image},
|
{field: 'admin.avatar', title: __('Admin.avatar'), operate: 'LIKE', events: Table.api.events.image, formatter: Table.api.formatter.image},
|
||||||
|
|
|
@ -0,0 +1,126 @@
|
||||||
|
define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
|
||||||
|
|
||||||
|
var Controller = {
|
||||||
|
index: function () {
|
||||||
|
// 初始化表格参数配置
|
||||||
|
Table.api.init({
|
||||||
|
extend: {
|
||||||
|
index_url: 'school/message_config/index' + location.search,
|
||||||
|
add_url: 'school/message_config/add',
|
||||||
|
edit_url: 'school/message_config/edit',
|
||||||
|
del_url: 'school/message_config/del',
|
||||||
|
multi_url: 'school/message_config/multi',
|
||||||
|
import_url: 'school/message_config/import',
|
||||||
|
table: 'school_message_config',
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
var table = $("#table");
|
||||||
|
|
||||||
|
// 初始化表格
|
||||||
|
table.bootstrapTable({
|
||||||
|
url: $.fn.bootstrapTable.defaults.extend.index_url,
|
||||||
|
pk: 'id',
|
||||||
|
sortName: 'weigh',
|
||||||
|
fixedColumns: true,
|
||||||
|
fixedRightNumber: 1,
|
||||||
|
columns: [
|
||||||
|
[
|
||||||
|
{checkbox: true},
|
||||||
|
{field: 'id', title: __('Id')},
|
||||||
|
{field: 'name', title: __('Name'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
|
||||||
|
{field: 'event', title: __('Event'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
|
||||||
|
{field: 'logo_image', title: __('Logo_image'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image},
|
||||||
|
{field: 'status', title: __('Status'), searchList: {"1":__('Status 1'),"2":__('Status 2')}, formatter: Table.api.formatter.status},
|
||||||
|
{field: 'wechat_wap', title: __('Wechat_wap'), searchList: {"1":__('Wechat_wap 1'),"2":__('Wechat_wap 2')}, formatter: Table.api.formatter.normal},
|
||||||
|
{field: 'message', title: __('Message'), searchList: {"1":__('Message 1'),"2":__('Message 2')}, formatter: Table.api.formatter.normal},
|
||||||
|
{field: 'selfmail', title: __('Selfmail'), searchList: {"1":__('Selfmail 1'),"2":__('Selfmail 2')}, formatter: Table.api.formatter.normal},
|
||||||
|
{field: 'message_id', title: __('Message_id'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
|
||||||
|
{field: 'wechat_wap_id', title: __('Wechat_wap_id'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
|
||||||
|
{field: 'selfmail_title', title: __('Selfmail_title'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
|
||||||
|
{field: 'weigh', title: __('Weigh'), operate: false},
|
||||||
|
{field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
|
||||||
|
{field: 'updatetime', title: __('Updatetime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
|
||||||
|
{field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
|
||||||
|
]
|
||||||
|
]
|
||||||
|
});
|
||||||
|
|
||||||
|
// 为表格绑定事件
|
||||||
|
Table.api.bindevent(table);
|
||||||
|
},
|
||||||
|
recyclebin: function () {
|
||||||
|
// 初始化表格参数配置
|
||||||
|
Table.api.init({
|
||||||
|
extend: {
|
||||||
|
'dragsort_url': ''
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
var table = $("#table");
|
||||||
|
|
||||||
|
// 初始化表格
|
||||||
|
table.bootstrapTable({
|
||||||
|
url: 'school/message_config/recyclebin' + location.search,
|
||||||
|
pk: 'id',
|
||||||
|
sortName: 'id',
|
||||||
|
columns: [
|
||||||
|
[
|
||||||
|
{checkbox: true},
|
||||||
|
{field: 'id', title: __('Id')},
|
||||||
|
{field: 'name', title: __('Name'), align: 'left'},
|
||||||
|
{
|
||||||
|
field: 'deletetime',
|
||||||
|
title: __('Deletetime'),
|
||||||
|
operate: 'RANGE',
|
||||||
|
addclass: 'datetimerange',
|
||||||
|
formatter: Table.api.formatter.datetime
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'operate',
|
||||||
|
width: '140px',
|
||||||
|
title: __('Operate'),
|
||||||
|
table: table,
|
||||||
|
events: Table.api.events.operate,
|
||||||
|
buttons: [
|
||||||
|
{
|
||||||
|
name: 'Restore',
|
||||||
|
text: __('Restore'),
|
||||||
|
classname: 'btn btn-xs btn-info btn-ajax btn-restoreit',
|
||||||
|
icon: 'fa fa-rotate-left',
|
||||||
|
url: 'school/message_config/restore',
|
||||||
|
refresh: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'Destroy',
|
||||||
|
text: __('Destroy'),
|
||||||
|
classname: 'btn btn-xs btn-danger btn-ajax btn-destroyit',
|
||||||
|
icon: 'fa fa-times',
|
||||||
|
url: 'school/message_config/destroy',
|
||||||
|
refresh: true
|
||||||
|
}
|
||||||
|
],
|
||||||
|
formatter: Table.api.formatter.operate
|
||||||
|
}
|
||||||
|
]
|
||||||
|
]
|
||||||
|
});
|
||||||
|
|
||||||
|
// 为表格绑定事件
|
||||||
|
Table.api.bindevent(table);
|
||||||
|
},
|
||||||
|
|
||||||
|
add: function () {
|
||||||
|
Controller.api.bindevent();
|
||||||
|
},
|
||||||
|
edit: function () {
|
||||||
|
Controller.api.bindevent();
|
||||||
|
},
|
||||||
|
api: {
|
||||||
|
bindevent: function () {
|
||||||
|
Form.api.bindevent($("form[role=form]"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
return Controller;
|
||||||
|
});
|
|
@ -29,34 +29,34 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
||||||
[
|
[
|
||||||
{checkbox: true},
|
{checkbox: true},
|
||||||
{field: 'operate', title: __('Operate'), table: table , buttons: [
|
{field: 'operate', title: __('Operate'), table: table , buttons: [
|
||||||
{
|
// {
|
||||||
name: 'classes_spec',
|
// name: 'classes_spec',
|
||||||
text: __('设置课程规格'),
|
// text: __('设置课程规格'),
|
||||||
title: __('设置课程规格'),
|
// title: __('设置课程规格'),
|
||||||
classname: 'btn btn-xs btn-danger btn-magic btn-dialog',
|
// classname: 'btn btn-xs btn-danger btn-magic btn-dialog',
|
||||||
icon: 'fa fa-list',
|
// icon: 'fa fa-list',
|
||||||
url: classes_spec_url,
|
// url: classes_spec_url,
|
||||||
callback: function (data) {
|
// callback: function (data) {
|
||||||
|
//
|
||||||
},
|
// },
|
||||||
// visible: function (row) {
|
// // visible: function (row) {
|
||||||
// return row.status == '2'||row.status == '3';
|
// // return row.status == '2'||row.status == '3';
|
||||||
// }
|
// // }
|
||||||
},
|
// },
|
||||||
{
|
// {
|
||||||
name: 'virtual_user',
|
// name: 'virtual_user',
|
||||||
text: __('设置虚拟参与者'),
|
// text: __('设置虚拟参与者'),
|
||||||
title: __('设置虚拟参与者'),
|
// title: __('设置虚拟参与者'),
|
||||||
classname: 'btn btn-xs btn-primary btn-dialog',
|
// classname: 'btn btn-xs btn-primary btn-dialog',
|
||||||
icon: 'fa fa-list',
|
// icon: 'fa fa-list',
|
||||||
url: virtual_user_url,
|
// url: virtual_user_url,
|
||||||
callback: function (data) {
|
// callback: function (data) {
|
||||||
|
//
|
||||||
},
|
// },
|
||||||
// visible: function (row) {
|
// // visible: function (row) {
|
||||||
// return row.status == '2'||row.status == '3';
|
// // return row.status == '2'||row.status == '3';
|
||||||
// }
|
// // }
|
||||||
},
|
// },
|
||||||
{
|
{
|
||||||
name: 'teacher',
|
name: 'teacher',
|
||||||
text: __('主讲老师信息'),
|
text: __('主讲老师信息'),
|
||||||
|
@ -332,6 +332,35 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
||||||
generrate.setOfflineType($("input:radio[name='row[address_type]']").val());
|
generrate.setOfflineType($("input:radio[name='row[address_type]']").val());
|
||||||
},
|
},
|
||||||
edit: function () {
|
edit: function () {
|
||||||
|
|
||||||
|
//因为日期选择框不会触发change事件,导致无法刷新textarea,所以加上判断
|
||||||
|
$(document).on("dp.change", "#edit-form .datetimerange", function () {
|
||||||
|
$(this).parent().prev().find("input").trigger("change");
|
||||||
|
});
|
||||||
|
|
||||||
|
$(document).on("dp.change", "#edit-form .datetimepicker", function () {
|
||||||
|
$(this).parent().prev().find("input").trigger("change");
|
||||||
|
});
|
||||||
|
|
||||||
|
$(document).on("fa.event.appendfieldlist", "#edit-form .btn-append", function (e, obj) {
|
||||||
|
// Form.api.bindevent($("form[role=form]"));
|
||||||
|
// // //绑定动态下拉组件
|
||||||
|
Form.events.selectpage(obj);
|
||||||
|
// // //绑定日期组件
|
||||||
|
Form.events.daterangepicker(obj);
|
||||||
|
Form.events.datetimepicker(obj);
|
||||||
|
// // Form.events.datetimerange(obj);
|
||||||
|
// Form.api.bindevent(this);
|
||||||
|
// //绑定上传组件
|
||||||
|
// Form.events.faupload(obj);
|
||||||
|
|
||||||
|
// //上传成功回调事件,变更按钮的背景
|
||||||
|
// $(".upload-image", obj).data("upload-success", function (data) {
|
||||||
|
// $(this).css("background-image", "url('" + Fast.api.cdnurl(data.url) + "')");
|
||||||
|
// })
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
Controller.api.bindevent();
|
Controller.api.bindevent();
|
||||||
},
|
},
|
||||||
api: {
|
api: {
|
||||||
|
|
Loading…
Reference in New Issue