虚拟用户生成,课程详情,用户核销权限,机构详情,教师详情

This commit is contained in:
15090180611 2024-11-07 18:11:08 +08:00
parent b8e0e4980e
commit b0bb197771
78 changed files with 3113 additions and 58 deletions

View File

@ -0,0 +1,71 @@
<?php
namespace app\admin\controller\dyqc;
use app\common\controller\Backend;
/**
* 店铺管理
*
* @icon fa fa-circle-o
*/
class ManystoreShop extends Backend
{
/**
* ManystoreShop模型对象
* @var \app\admin\model\dyqc\ManystoreShop
*/
protected $model = null;
public function _initialize()
{
parent::_initialize();
$this->model = new \app\admin\model\dyqc\ManystoreShop;
$this->view->assign("statusList", $this->model->getStatusList());
}
/**
* 默认生成的控制器所继承的父类中有index/add/edit/del/multi五个基础方法、destroy/restore/recyclebin三个回收站方法
* 因此在当前控制器中可不用编写增删改查的代码,除非需要自己控制这部分逻辑
* 需要将application/admin/library/traits/Backend.php中对应的方法复制到当前控制器,然后进行修改
*/
/**
* 查看
*/
public function index()
{
//当前是否为关联查询
$this->relationSearch = true;
//设置过滤方法
$this->request->filter(['strip_tags', 'trim']);
if ($this->request->isAjax()) {
//如果发送的来源是Selectpage则转发到Selectpage
if ($this->request->request('keyField')) {
return $this->selectpage();
}
list($where, $sort, $order, $offset, $limit) = $this->buildparams();
$list = $this->model
->with(['admin'])
->where($where)
->order($sort, $order)
->paginate($limit);
foreach ($list as $row) {
$row->getRelation('admin')->visible(['nickname']);
}
$result = array("total" => $list->total(), "rows" => $list->items());
return json($result);
}
return $this->view->fetch();
}
}

View File

@ -22,7 +22,8 @@ class VirtualUser extends Backend
{
parent::_initialize();
$this->model = new \app\admin\model\school\classes\VirtualUser;
$this->view->assign("jointypeList", $this->model->getJointypeList());
$this->view->assign("havetypeList", $this->model->getHavetypeList());
}
@ -57,7 +58,8 @@ class VirtualUser extends Backend
->paginate($limit);
foreach ($list as $row) {
// $row->visible(['id','classes_lib_id']);
// $row->visible(['lib']);
$row->getRelation('lib')->visible(['title','headimage']);
}

View File

@ -51,14 +51,14 @@ class Order extends Backend
list($where, $sort, $order, $offset, $limit) = $this->buildparams();
$list = $this->model
->with(['order','spec','user','detail','lib'])
->with(['classesorder','spec','user','detail','lib'])
->where($where)
->order($sort, $order)
->paginate($limit);
foreach ($list as $row) {
$row->getRelation('order')->visible(['order_no']);
$row->getRelation('classesorder')->visible(['order_no']);
$row->getRelation('spec')->visible(['name']);
$row->getRelation('user')->visible(['nickname','realname','mobile','avatar']);
$row->getRelation('detail')->visible(['title','headimage']);

View File

@ -0,0 +1,34 @@
<?php
return [
'Id' => 'ID',
'Name' => '店铺名称',
'Logo' => '品牌LOGO',
'Image' => '封面图',
'Images' => '店铺环境照片',
'Address_city' => '城市选择',
'Province' => '省编号',
'City' => '市编号',
'District' => '县区编号',
'Address' => '店铺地址',
'Address_detail' => '店铺详细地址',
'Longitude' => '经度',
'Latitude' => '纬度',
'Yyzzdm' => '营业执照',
'Yyzz_images' => '营业执照照片',
'Tel' => '服务电话',
'Content' => '店铺详情',
'Status' => '审核状态',
'Status 0' => '待审核',
'Set status to 0'=> '设为待审核',
'Status 1' => '审核通过',
'Set status to 1'=> '设为审核通过',
'Status 2' => '审核失败',
'Set status to 2'=> '设为审核失败',
'Reason' => '审核不通过原因',
'Auth_time' => '审核时间',
'Admin_id' => '审核管理员id',
'Create_time' => '创建时间',
'Update_time' => '修改时间',
'Admin.nickname' => '昵称'
];

View File

@ -16,6 +16,8 @@ return [
'Status' => '订单状态',
'Status -3' => '已取消',
'Set status to -3' => '设为已取消',
'Status -1' => '已报名待审核',
'Set status to -1' => '设为已报名待审核',
'Status 0' => '已预约',
'Set status to 0' => '设为已预约',
'Status 3' => '已完成',

View File

@ -5,6 +5,8 @@ return [
'Status' => '订单状态',
'Status -3' => '已取消',
'Set status to -3' => '设为已取消',
'Status -1' => '已报名待审核',
'Set status to -1' => '设为已报名待审核',
'Status 0' => '已预约',
'Set status to 0' => '设为已预约',
'Status 3' => '已完成',

View File

@ -5,6 +5,12 @@ return [
'Head_image' => '头像',
'Classes_lib_id' => '课程id',
'Time' => '虚拟下单时间',
'Jointype' => '参与中',
'Jointype 1' => '是',
'Jointype 0' => '否',
'Havetype' => '已报名',
'Havetype 1' => '是',
'Havetype 0' => '否',
'Lib.title' => '标题',
'Lib.headimage' => '头图'
];

View File

@ -0,0 +1,104 @@
<?php
namespace app\admin\model\dyqc;
use think\Model;
class ManystoreShop extends Model
{
// 表名
protected $name = 'manystore_shop';
// 自动写入时间戳字段
protected $autoWriteTimestamp = false;
// 定义时间戳字段名
protected $createTime = false;
protected $updateTime = false;
protected $deleteTime = false;
// 追加属性
protected $append = [
'status_text',
'auth_time_text',
'create_time_text',
'update_time_text'
];
public function getLogoAttr($value, $data)
{
if (!empty($value)) return cdnurl($value, true);
}
public function getImageAttr($value, $data)
{
if (!empty($value)) return cdnurl($value, true);
}
public function getStatusList()
{
return ['0' => __('Status 0'), '1' => __('Status 1'), '2' => __('Status 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 getAuthTimeTextAttr($value, $data)
{
$value = $value ? $value : (isset($data['auth_time']) ? $data['auth_time'] : '');
return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
}
public function getCreateTimeTextAttr($value, $data)
{
$value = $value ? $value : (isset($data['create_time']) ? $data['create_time'] : '');
return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
}
public function getUpdateTimeTextAttr($value, $data)
{
$value = $value ? $value : (isset($data['update_time']) ? $data['update_time'] : '');
return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
}
protected function setAuthTimeAttr($value)
{
return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
}
protected function setCreateTimeAttr($value)
{
return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
}
protected function setUpdateTimeAttr($value)
{
return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
}
public function admin()
{
return $this->belongsTo('app\admin\model\Admin', 'admin_id', 'id', [], 'LEFT')->setEagerlyType(0);
}
}

View File

@ -29,6 +29,19 @@ class Teacher extends Model
];
public function getHeadImageAttr($value, $data)
{
if (!empty($value)) return cdnurl($value, true);
}
public function getExpertImageAttr($value, $data)
{
if (!empty($value)) return cdnurl($value, true);
}
protected static function init()
{
self::afterInsert(function ($row) {

View File

@ -25,12 +25,22 @@ class VirtualUser extends Model
// 追加属性
protected $append = [
'time_text'
'time_text',
'jointype_text',
'havetype_text'
];
public function getJointypeList()
{
return ['1' => __('Jointype 1'), '0' => __('Jointype 0')];
}
public function getHavetypeList()
{
return ['1' => __('Havetype 1'), '0' => __('Havetype 0')];
}
public function getTimeTextAttr($value, $data)
@ -39,6 +49,22 @@ class VirtualUser extends Model
return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
}
public function getJointypeTextAttr($value, $data)
{
$value = $value ? $value : (isset($data['jointype']) ? $data['jointype'] : '');
$list = $this->getJointypeList();
return isset($list[$value]) ? $list[$value] : '';
}
public function getHavetypeTextAttr($value, $data)
{
$value = $value ? $value : (isset($data['havetype']) ? $data['havetype'] : '');
$list = $this->getHavetypeList();
return isset($list[$value]) ? $list[$value] : '';
}
protected function setTimeAttr($value)
{
return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);

View File

@ -37,7 +37,7 @@ class Order extends Model
public function getStatusList()
{
return ['-3' => __('Status -3'), '0' => __('Status 0'), '3' => __('Status 3')];
return ['-3' => __('Status -3'),'-1' => __('Status -1'), '0' => __('Status 0'), '3' => __('Status 3')];
}
@ -109,7 +109,7 @@ class Order extends Model
}
public function order()
public function classesorder()
{
return $this->belongsTo('app\admin\model\school\classes\Order', 'classes_order_id', 'id', [], 'LEFT')->setEagerlyType(0);
}

View File

@ -32,7 +32,7 @@ class OrderLog extends Model
public function getStatusList()
{
return ['-3' => __('Status -3'), '0' => __('Status 0'), '3' => __('Status 3')];
return ['-3' => __('Status -3'),'-1' => __('Status -1'), '0' => __('Status 0'), '3' => __('Status 3')];
}

View File

@ -0,0 +1,27 @@
<?php
namespace app\admin\validate\dyqc;
use think\Validate;
class ManystoreShop extends Validate
{
/**
* 验证规则
*/
protected $rule = [
];
/**
* 提示消息
*/
protected $message = [
];
/**
* 验证场景
*/
protected $scene = [
'add' => [],
'edit' => [],
];
}

View File

@ -0,0 +1,165 @@
<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">{:__('Logo')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-logo" data-rule="required" class="form-control" name="row[logo]" type="text" value="">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Image')}:</label>
<div class="col-xs-12 col-sm-8">
<div class="input-group">
<input id="c-image" data-rule="required" class="form-control" size="50" name="row[image]" type="text">
<div class="input-group-addon no-border no-padding">
<span><button type="button" id="faupload-image" class="btn btn-danger faupload" data-input-id="c-image" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp,image/webp" data-multiple="false" data-preview-id="p-image"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
<span><button type="button" id="fachoose-image" class="btn btn-primary fachoose" data-input-id="c-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-image"></span>
</div>
<ul class="row list-inline faupload-preview" id="p-image"></ul>
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Images')}:</label>
<div class="col-xs-12 col-sm-8">
<div class="input-group">
<input id="c-images" class="form-control" size="50" name="row[images]" type="textarea">
<div class="input-group-addon no-border no-padding">
<span><button type="button" id="faupload-images" class="btn btn-danger faupload" data-input-id="c-images" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp,image/webp" data-multiple="true" data-preview-id="p-images"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
<span><button type="button" id="fachoose-images" class="btn btn-primary fachoose" data-input-id="c-images" data-mimetype="image/*" data-multiple="true"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
</div>
<span class="msg-box n-right" for="c-images"></span>
</div>
<ul class="row list-inline faupload-preview" id="p-images"></ul>
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Address_city')}:</label>
<div class="col-xs-12 col-sm-8">
<div class='control-relative'><input id="c-address_city" data-rule="required" class="form-control" data-toggle="city-picker" name="row[address_city]" type="text"></div>
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Province')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-province" data-rule="required" class="form-control" name="row[province]" type="number">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('City')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-city" data-rule="required" class="form-control" name="row[city]" type="number">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('District')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-district" data-rule="required" class="form-control" name="row[district]" type="number">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Address')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-address" data-rule="required" class="form-control" name="row[address]" type="text">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Address_detail')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-address_detail" data-rule="required" class="form-control" name="row[address_detail]" type="text" value="">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Longitude')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-longitude" data-rule="required" class="form-control" name="row[longitude]" type="text" value="">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Latitude')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-latitude" data-rule="required" class="form-control" name="row[latitude]" type="text" value="">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Yyzzdm')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-yyzzdm" data-rule="required" class="form-control" name="row[yyzzdm]" type="text" value="">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Yyzz_images')}:</label>
<div class="col-xs-12 col-sm-8">
<div class="input-group">
<input id="c-yyzz_images" data-rule="required" class="form-control" size="50" name="row[yyzz_images]" type="text" value="">
<div class="input-group-addon no-border no-padding">
<span><button type="button" id="faupload-yyzz_images" class="btn btn-danger faupload" data-input-id="c-yyzz_images" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp,image/webp" data-multiple="true" data-preview-id="p-yyzz_images"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
<span><button type="button" id="fachoose-yyzz_images" class="btn btn-primary fachoose" data-input-id="c-yyzz_images" data-mimetype="image/*" data-multiple="true"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
</div>
<span class="msg-box n-right" for="c-yyzz_images"></span>
</div>
<ul class="row list-inline faupload-preview" id="p-yyzz_images"></ul>
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Tel')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-tel" class="form-control" name="row[tel]" type="text">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Content')}:</label>
<div class="col-xs-12 col-sm-8">
<textarea id="c-content" class="form-control editor" rows="5" name="row[content]" cols="50"></textarea>
</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="0"}checked{/in} /> {$vo}</label>
{/foreach}
</div>
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Reason')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-reason" class="form-control" name="row[reason]" type="text" value="">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Auth_time')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-auth_time" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[auth_time]" type="text" value="{:date('Y-m-d H:i:s')}">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Create_time')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-create_time" data-rule="required" min="0" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[create_time]" type="text" value="{:date('Y-m-d H:i:s')}">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Update_time')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-update_time" data-rule="required" min="0" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[update_time]" type="text" value="{:date('Y-m-d H:i:s')}">
</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>

View File

@ -0,0 +1,165 @@
<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">{:__('Logo')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-logo" data-rule="required" class="form-control" name="row[logo]" type="text" value="{$row.logo|htmlentities}">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Image')}:</label>
<div class="col-xs-12 col-sm-8">
<div class="input-group">
<input id="c-image" data-rule="required" class="form-control" size="50" name="row[image]" type="text" value="{$row.image|htmlentities}">
<div class="input-group-addon no-border no-padding">
<span><button type="button" id="faupload-image" class="btn btn-danger faupload" data-input-id="c-image" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp,image/webp" data-multiple="false" data-preview-id="p-image"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
<span><button type="button" id="fachoose-image" class="btn btn-primary fachoose" data-input-id="c-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-image"></span>
</div>
<ul class="row list-inline faupload-preview" id="p-image"></ul>
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Images')}:</label>
<div class="col-xs-12 col-sm-8">
<div class="input-group">
<input id="c-images" class="form-control" size="50" name="row[images]" type="textarea" value="{$row.images|htmlentities}">
<div class="input-group-addon no-border no-padding">
<span><button type="button" id="faupload-images" class="btn btn-danger faupload" data-input-id="c-images" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp,image/webp" data-multiple="true" data-preview-id="p-images"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
<span><button type="button" id="fachoose-images" class="btn btn-primary fachoose" data-input-id="c-images" data-mimetype="image/*" data-multiple="true"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
</div>
<span class="msg-box n-right" for="c-images"></span>
</div>
<ul class="row list-inline faupload-preview" id="p-images"></ul>
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Address_city')}:</label>
<div class="col-xs-12 col-sm-8">
<div class='control-relative'><input id="c-address_city" data-rule="required" class="form-control" data-toggle="city-picker" name="row[address_city]" type="text" value="{$row.address_city|htmlentities}"></div>
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Province')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-province" data-rule="required" class="form-control" name="row[province]" type="number" value="{$row.province|htmlentities}">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('City')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-city" data-rule="required" class="form-control" name="row[city]" type="number" value="{$row.city|htmlentities}">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('District')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-district" data-rule="required" class="form-control" name="row[district]" type="number" value="{$row.district|htmlentities}">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Address')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-address" data-rule="required" class="form-control" name="row[address]" type="text" value="{$row.address|htmlentities}">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Address_detail')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-address_detail" data-rule="required" class="form-control" name="row[address_detail]" type="text" value="{$row.address_detail|htmlentities}">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Longitude')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-longitude" data-rule="required" class="form-control" name="row[longitude]" type="text" value="{$row.longitude|htmlentities}">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Latitude')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-latitude" data-rule="required" class="form-control" name="row[latitude]" type="text" value="{$row.latitude|htmlentities}">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Yyzzdm')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-yyzzdm" data-rule="required" class="form-control" name="row[yyzzdm]" type="text" value="{$row.yyzzdm|htmlentities}">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Yyzz_images')}:</label>
<div class="col-xs-12 col-sm-8">
<div class="input-group">
<input id="c-yyzz_images" data-rule="required" class="form-control" size="50" name="row[yyzz_images]" type="text" value="{$row.yyzz_images|htmlentities}">
<div class="input-group-addon no-border no-padding">
<span><button type="button" id="faupload-yyzz_images" class="btn btn-danger faupload" data-input-id="c-yyzz_images" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp,image/webp" data-multiple="true" data-preview-id="p-yyzz_images"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
<span><button type="button" id="fachoose-yyzz_images" class="btn btn-primary fachoose" data-input-id="c-yyzz_images" data-mimetype="image/*" data-multiple="true"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
</div>
<span class="msg-box n-right" for="c-yyzz_images"></span>
</div>
<ul class="row list-inline faupload-preview" id="p-yyzz_images"></ul>
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Tel')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-tel" class="form-control" name="row[tel]" type="text" value="{$row.tel|htmlentities}">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Content')}:</label>
<div class="col-xs-12 col-sm-8">
<textarea id="c-content" class="form-control editor" rows="5" name="row[content]" cols="50">{$row.content|htmlentities}</textarea>
</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">{:__('Reason')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-reason" class="form-control" name="row[reason]" type="text" value="{$row.reason|htmlentities}">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Auth_time')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-auth_time" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[auth_time]" type="text" value="{:$row.auth_time?datetime($row.auth_time):''}">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Create_time')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-create_time" data-rule="required" min="0" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[create_time]" type="text" value="{:$row.create_time?datetime($row.create_time):''}">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Update_time')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-update_time" data-rule="required" min="0" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[update_time]" type="text" value="{:$row.update_time?datetime($row.update_time):''}">
</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>

View File

@ -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('dyqc/manystore_shop/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('dyqc/manystore_shop/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('dyqc/manystore_shop/del')?'':'hide'}" title="{:__('Delete')}" ><i class="fa fa-trash"></i> {:__('Delete')}</a>
<div class="dropdown btn-group {:$auth->check('dyqc/manystore_shop/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>
</div>
<table id="table" class="table table-striped table-bordered table-hover table-nowrap"
data-operate-edit="{:$auth->check('dyqc/manystore_shop/edit')}"
data-operate-del="{:$auth->check('dyqc/manystore_shop/del')}"
width="100%">
</table>
</div>
</div>
</div>
</div>
</div>

View File

@ -3,13 +3,13 @@
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Manystore_id')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-manystore_id" data-rule="required" data-source="manystore/index" class="form-control selectpage" name="row[manystore_id]" type="text" value="">
<input id="c-manystore_id" data-rule="required" data-source="manystore/index" data-field="id" class="form-control selectpage" name="row[manystore_id]" type="text" value="">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Shop_id')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-shop_id" data-rule="required" data-source="manystore/shop/index" class="form-control selectpage" name="row[shop_id]" type="text" value="">
<input id="c-shop_id" data-rule="required" data-source="dyqc/manystore_shop/index" class="form-control selectpage" name="row[shop_id]" type="text" value="">
</div>
</div>
<div class="form-group">
@ -18,16 +18,23 @@
<input id="c-user_id" data-rule="required" data-source="user/user/index" data-field="nickname" class="form-control selectpage" name="row[user_id]" type="text" value="">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('讲师id')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-teacher_id" data-rule="required" data-source="school/classes/teacher/index" data-field="name" class="form-control selectpage" name="row[teacher_id]" type="text" value="">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Classes_cate_ids')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-classes_cate_ids" data-rule="required" data-source="classes/cate/index" data-multiple="true" class="form-control selectpage" name="row[classes_cate_ids]" type="text" value="">
<input id="c-classes_cate_ids" data-rule="required" data-source="school/classes/cate/index" data-multiple="true" class="form-control selectpage" name="row[classes_cate_ids]" type="text" value="">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Classes_label_ids')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-classes_label_ids" data-rule="required" data-source="classes/label/index" data-multiple="true" class="form-control selectpage" name="row[classes_label_ids]" type="text" value="">
<input id="c-classes_label_ids" data-rule="required" data-source="school/classes/label/index" data-multiple="true" class="form-control selectpage" name="row[classes_label_ids]" type="text" value="">
</div>
</div>
<div class="form-group">
@ -48,12 +55,12 @@
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Add_id')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-add_id" data-rule="required" data-source="add/index" class="form-control selectpage" name="row[add_id]" type="text" value="">
</div>
</div>
<!-- <div class="form-group">-->
<!-- <label class="control-label col-xs-12 col-sm-2">{:__('Add_id')}:</label>-->
<!-- <div class="col-xs-12 col-sm-8">-->
<!-- <input id="c-add_id" data-rule="required" data-source="add/index" class="form-control selectpage" name="row[add_id]" type="text" value="">-->
<!-- </div>-->
<!-- </div>-->
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Title')}:</label>
<div class="col-xs-12 col-sm-8">
@ -196,6 +203,19 @@
<input id="c-virtual_num" class="form-control" name="row[virtual_num]" type="number">
</div>
</div>
<!-- <div class="form-group">-->
<!-- <label class="control-label col-xs-12 col-sm-2">{:__('虚拟参与人数')}:</label>-->
<!-- <div class="col-xs-12 col-sm-8">-->
<!-- <input id="c-virtual_people" class="form-control" name="row[virtual_people]" type="number">-->
<!-- </div>-->
<!-- </div>-->
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Sale')}:</label>
<div class="col-xs-12 col-sm-8">

View File

@ -3,13 +3,13 @@
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Manystore_id')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-manystore_id" data-rule="required" data-source="manystore/index" class="form-control selectpage" name="row[manystore_id]" type="text" value="{$row.manystore_id|htmlentities}">
<input id="c-manystore_id" data-rule="required" data-source="manystore/index" data-field="id" class="form-control selectpage" name="row[manystore_id]" type="text" value="{$row.manystore_id|htmlentities}">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Shop_id')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-shop_id" data-rule="required" data-source="manystore/shop/index" class="form-control selectpage" name="row[shop_id]" type="text" value="{$row.shop_id|htmlentities}">
<input id="c-shop_id" data-rule="required" data-source="dyqc/manystore_shop/index" class="form-control selectpage" name="row[shop_id]" type="text" value="{$row.shop_id|htmlentities}">
</div>
</div>
<div class="form-group">
@ -18,16 +18,24 @@
<input id="c-user_id" data-rule="required" data-source="user/user/index" data-field="nickname" class="form-control selectpage" name="row[user_id]" type="text" value="{$row.user_id|htmlentities}">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('讲师id')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-teacher_id" data-rule="required" data-source="school/classes/teacher/index" data-field="name" class="form-control selectpage" name="row[teacher_id]" type="text" value="{$row.teacher_id|htmlentities}">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Classes_cate_ids')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-classes_cate_ids" data-rule="required" data-source="classes/cate/index" data-multiple="true" class="form-control selectpage" name="row[classes_cate_ids]" type="text" value="{$row.classes_cate_ids|htmlentities}">
<input id="c-classes_cate_ids" data-rule="required" data-source="school/classes/cate/index" data-multiple="true" class="form-control selectpage" name="row[classes_cate_ids]" type="text" value="{$row.classes_cate_ids|htmlentities}">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Classes_label_ids')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-classes_label_ids" data-rule="required" data-source="classes/label/index" data-multiple="true" class="form-control selectpage" name="row[classes_label_ids]" type="text" value="{$row.classes_label_ids|htmlentities}">
<input id="c-classes_label_ids" data-rule="required" data-source="school/classes/label/index" data-multiple="true" class="form-control selectpage" name="row[classes_label_ids]" type="text" value="{$row.classes_label_ids|htmlentities}">
</div>
</div>
<div class="form-group">
@ -48,12 +56,12 @@
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Add_id')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-add_id" data-rule="required" data-source="add/index" class="form-control selectpage" name="row[add_id]" type="text" value="{$row.add_id|htmlentities}">
</div>
</div>
<!-- <div class="form-group">-->
<!-- <label class="control-label col-xs-12 col-sm-2">{:__('Add_id')}:</label>-->
<!-- <div class="col-xs-12 col-sm-8">-->
<!-- <input id="c-add_id" data-rule="required" data-source="add/index" class="form-control selectpage" name="row[add_id]" type="text" value="{$row.add_id|htmlentities}">-->
<!-- </div>-->
<!-- </div>-->
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Title')}:</label>
<div class="col-xs-12 col-sm-8">
@ -220,6 +228,16 @@
<input id="c-virtual_collect" class="form-control" name="row[virtual_collect]" type="number" value="{$row.virtual_collect|htmlentities}">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('虚拟参与人数')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-virtual_people" class="form-control" name="row[virtual_people]" type="number" value="{$row.virtual_people|htmlentities}">
</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">
@ -310,6 +328,10 @@
</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">

View File

@ -3,7 +3,7 @@
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Classes_lib_id')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-classes_lib_id" data-rule="required" data-source="school/classes/lib/index" class="form-control selectpage" name="row[classes_lib_id]" type="text" value="">
<input id="c-classes_lib_id" data-rule="required" data-source="school/classes/classes_lib/index" data-field="title" class="form-control selectpage" name="row[classes_lib_id]" type="text" value="">
</div>
</div>
<div class="form-group">

View File

@ -3,7 +3,7 @@
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Classes_lib_id')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-classes_lib_id" data-rule="required" data-source="school/classes/lib/index" class="form-control selectpage" name="row[classes_lib_id]" type="text" value="{$row.classes_lib_id|htmlentities}">
<input id="c-classes_lib_id" data-rule="required" data-source="school/classes/classes_lib/index" data-field="title" class="form-control selectpage" name="row[classes_lib_id]" type="text" value="{$row.classes_lib_id|htmlentities}">
</div>
</div>
<div class="form-group">

View File

@ -3,13 +3,13 @@
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Manystore_id')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-manystore_id" data-rule="required" data-source="manystore/index" class="form-control selectpage" name="row[manystore_id]" type="text" value="">
<input id="c-manystore_id" data-rule="required" data-source="manystore/index" data-field="id" class="form-control selectpage" name="row[manystore_id]" type="text" value="">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Shop_id')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-shop_id" data-rule="required" data-source="manystore/shop/index" class="form-control selectpage" name="row[shop_id]" type="text" value="">
<input id="c-shop_id" data-rule="required" data-source="dyqc/manystore_shop/index" class="form-control selectpage" name="row[shop_id]" type="text" value="">
</div>
</div>
<div class="form-group">

View File

@ -3,13 +3,13 @@
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Manystore_id')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-manystore_id" data-rule="required" data-source="manystore/index" class="form-control selectpage" name="row[manystore_id]" type="text" value="{$row.manystore_id|htmlentities}">
<input id="c-manystore_id" data-rule="required" data-source="manystore/index" data-field="id" class="form-control selectpage" name="row[manystore_id]" type="text" value="{$row.manystore_id|htmlentities}">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Shop_id')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-shop_id" data-rule="required" data-source="manystore/shop/index" class="form-control selectpage" name="row[shop_id]" type="text" value="{$row.shop_id|htmlentities}">
<input id="c-shop_id" data-rule="required" data-source="dyqc/manystore_shop/index" class="form-control selectpage" name="row[shop_id]" type="text" value="{$row.shop_id|htmlentities}">
</div>
</div>
<div class="form-group">

View File

@ -3,13 +3,13 @@
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Manystore_id')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-manystore_id" data-rule="required" data-source="manystore/index" class="form-control selectpage" name="row[manystore_id]" type="text" value="">
<input id="c-manystore_id" data-rule="required" data-source="manystore/index" data-field="id" class="form-control selectpage" name="row[manystore_id]" type="text" value="">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Shop_id')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-shop_id" data-rule="required" data-source="manystore/shop/index" class="form-control selectpage" name="row[shop_id]" type="text" value="">
<input id="c-shop_id" data-rule="required" data-source="dyqc/manystore_shop/index" class="form-control selectpage" name="row[shop_id]" type="text" value="">
</div>
</div>
<div class="form-group">
@ -21,7 +21,7 @@
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Classes_lib_ids')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-classes_lib_ids" data-rule="required" data-source="classes/lib/index" data-multiple="true" class="form-control selectpage" name="row[classes_lib_ids]" type="text" value="">
<input id="c-classes_lib_ids" data-rule="required" data-source="school/classes/classes_lib/index" data-field="title" data-multiple="true" class="form-control selectpage" name="row[classes_lib_ids]" type="text" value="">
</div>
</div>
<div class="form-group">

View File

@ -3,13 +3,13 @@
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Manystore_id')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-manystore_id" data-rule="required" data-source="manystore/index" class="form-control selectpage" name="row[manystore_id]" type="text" value="{$row.manystore_id|htmlentities}">
<input id="c-manystore_id" data-rule="required" data-source="manystore/index" data-field="id" class="form-control selectpage" name="row[manystore_id]" type="text" value="{$row.manystore_id|htmlentities}">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Shop_id')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-shop_id" data-rule="required" data-source="manystore/shop/index" class="form-control selectpage" name="row[shop_id]" type="text" value="{$row.shop_id|htmlentities}">
<input id="c-shop_id" data-rule="required" data-source="dyqc/manystore_shop/index" class="form-control selectpage" name="row[shop_id]" type="text" value="{$row.shop_id|htmlentities}">
</div>
</div>
<div class="form-group">
@ -21,7 +21,7 @@
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Classes_lib_ids')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-classes_lib_ids" data-rule="required" data-source="classes/lib/index" data-multiple="true" class="form-control selectpage" name="row[classes_lib_ids]" type="text" value="{$row.classes_lib_ids|htmlentities}">
<input id="c-classes_lib_ids" data-rule="required" data-source="school/classes/classes_lib/index" data-field="title" data-multiple="true" class="form-control selectpage" name="row[classes_lib_ids]" type="text" value="{$row.classes_lib_ids|htmlentities}">
</div>
</div>
<div class="form-group">

View File

@ -23,7 +23,7 @@
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Classes_lib_id')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-classes_lib_id" data-rule="required" data-source="school/classes/lib/index" class="form-control selectpage" name="row[classes_lib_id]" type="text" value="">
<input id="c-classes_lib_id" data-rule="required" data-source="school/classes/classes_lib/index" data-field="title" class="form-control selectpage" name="row[classes_lib_id]" type="text" value="">
</div>
</div>
<div class="form-group">

View File

@ -23,7 +23,7 @@
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Classes_lib_id')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-classes_lib_id" data-rule="required" data-source="school/classes/lib/index" class="form-control selectpage" name="row[classes_lib_id]" type="text" value="{$row.classes_lib_id|htmlentities}">
<input id="c-classes_lib_id" data-rule="required" data-source="school/classes/classes_lib/index" data-field="title" class="form-control selectpage" name="row[classes_lib_id]" type="text" value="{$row.classes_lib_id|htmlentities}">
</div>
</div>
<div class="form-group">

View File

@ -2,9 +2,11 @@
namespace app\api\controller;
use app\admin\model\school\classes\VirtualHead;
use app\common\controller\Api;
use app\common\exception\UploadException;
use app\common\library\Upload;
use app\common\library\Virtual;
use app\common\model\Area;
use app\common\model\Version;
use fast\Random;
@ -17,7 +19,7 @@ use think\Hook;
*/
class Common extends Api
{
protected $noNeedLogin = ['init', 'captcha'];
protected $noNeedLogin = ['init', 'captcha','virtualgenerate'];
protected $noNeedRight = '*';
public function _initialize()
@ -162,5 +164,33 @@ class Common extends Api
]);
$captcha = new Captcha((array)Config::get('captcha'));
return $captcha->entry($id);
}
/**
* @ApiTitle(生成随机昵称和头像)
* @ApiSummary(生成随机昵称和头像)
* @ApiRoute(/api/common/virtualgenerate)
* @ApiMethod(GET)
* @ApiParams(name = "number", type = "int",required=true,description = "生成数量")
* @ApiReturn({ unpaid_user_data 参与中 paid_user_data 已报名 })
*/
public function virtualgenerate(){
$number = $this->request->get('number/d','');
if(empty($number)){
$this->error(__('缺少必要参数'));
}
try {
$res = (new Virtual)->getVirtualUser($number);
} catch (\Exception $e){
// Log::log($e->getMessage());
$this->error($e->getMessage(),['errcode'=>$e->getCode()]);
}
$this->success('生成成功', $res);
}
}

View File

@ -156,10 +156,15 @@ class User extends Api
*/
public function index()
{
$data = [
'welcome' => $this->auth->nickname,
'user_info'=>$this->auth->getUserinfo()
];
//是否有核销按钮展示权
$data['have_auth'] = \app\common\model\User::verificationAuth($this->auth->id);
$data['have_teacher'] = \app\common\model\User::teacherAuth($this->auth->id);
$data['user_info']["avatar"] = $data['user_info']["avatar"]? cdnurl($data['user_info']["avatar"],true):$data['user_info']["avatar"];
$this->success('调用成功',$data);
}

View File

@ -0,0 +1,25 @@
<?php
namespace app\api\controller\school;
use app\common\controller\Api;
class Base extends Api
{
/**
* 初始化操作
* @access protected
*/
protected function _initialize()
{
parent::_initialize();
//判断登录用户是否是员工
}
}

View File

@ -0,0 +1,119 @@
<?php
namespace app\api\controller\school;
use app\common\model\school\classes\ClassesLib;
use think\Cache;
use think\Log;
/**
* 课程接口
*/
class Classes extends Base
{
protected $noNeedLogin = ["detail",'people','spec'];
protected $noNeedRight = '*';
protected $model = null;
/**
* 初始化操作
* @access protected
*/
protected function _initialize()
{
$this->model = new ClassesLib;
parent::_initialize();
//判断登录用户是否是员工
}
public function index()
{
}
/**
* @ApiTitle(课程详情接口)
* @ApiSummary(课程详情接口)
* @ApiRoute(/api/school/classes/detail)
* @ApiMethod(GET)
* @ApiParams(name = "id", type = "int",required=true,description = "课程id")
* @ApiReturn({
*
*})
*/
public function detail(){
$id = $this->request->get('id/d','');
if(empty($id)){
$this->error(__('缺少必要参数'));
}
try {
$res = $this->model->detail($id);
} catch (\Exception $e){
// Log::log($e->getMessage());
$this->error($e->getMessage(),['errcode'=>$e->getCode()]);
}
$this->success('获取成功', ['detail' => $res]);
}
/**
* @ApiTitle(课程参与者和报名者)
* @ApiSummary(课程参与者和报名者)
* @ApiRoute(/api/school/classes/people)
* @ApiMethod(GET)
* @ApiParams(name = "id", type = "int",required=true,description = "课程id")
* @ApiReturn({ unpaid_user_data 参与中 paid_user_data 已报名 })
*/
public function people(){
$id = $this->request->get('id/d','');
if(empty($id)){
$this->error(__('缺少必要参数'));
}
try {
$res = $this->model->virtualParticipants($id);
} catch (\Exception $e){
// Log::log($e->getMessage());
$this->error($e->getMessage(),['errcode'=>$e->getCode()]);
}
$this->success('获取成功', $res);
}
/**
* @ApiTitle(课程课时规格)
* @ApiSummary(课程课时规格)
* @ApiRoute(/api/school/classes/spec)
* @ApiMethod(GET)
* @ApiParams(name = "id", type = "int",required=true,description = "课程id")
* @ApiReturn({ spec 课时规格 })
*/
public function spec(){
$id = $this->request->get('id/d','');
if(empty($id)){
$this->error(__('缺少必要参数'));
}
try {
$res = $this->model->spec($id);
} catch (\Exception $e){
// Log::log($e->getMessage());
$this->error($e->getMessage(),['errcode'=>$e->getCode()]);
}
$this->success('获取成功', ['spec'=>$res]);
}
}

View File

@ -0,0 +1,57 @@
<?php
namespace app\api\controller\school;
use app\common\model\school\classes\Teacher as Teachermodel;
/**
* 课程订单接口
*/
class Order extends Base
{
protected $noNeedLogin = ["detail",'people','spec'];
protected $noNeedRight = '*';
protected $model = null;
/**
* 初始化操作
* @access protected
*/
protected function _initialize()
{
$this->model = new Teachermodel;
parent::_initialize();
//判断登录用户是否是员工
}
/**
* @ApiTitle( x详情)
* @ApiSummary(xx详情)
* @ApiRoute(/api/school/teacher/detail)
* @ApiMethod(GET)
* @ApiParams(name = "id", type = "int",required=true,description = "老师id")
* @ApiReturn({
*
*})
*/
public function detail(){
$id = $this->request->get('id/d','');
if(empty($id)){
$this->error(__('缺少必要参数'));
}
try {
$res = $this->model->detail($id);
} catch (\Exception $e){
// Log::log($e->getMessage());
$this->error($e->getMessage(),['errcode'=>$e->getCode()]);
}
$this->success('获取成功', ['detail' => $res]);
}
}

View File

@ -0,0 +1,60 @@
<?php
namespace app\api\controller\school;
use app\common\model\dyqc\ManystoreShop;
/**
* 机构接口
*/
class Shop extends Base
{
protected $noNeedLogin = ["detail",'people','spec'];
protected $noNeedRight = '*';
protected $model = null;
/**
* 初始化操作
* @access protected
*/
protected function _initialize()
{
$this->model = new ManystoreShop;
parent::_initialize();
//判断登录用户是否是员工
}
/**
* @ApiTitle( 机构详情)
* @ApiSummary(机构详情)
* @ApiRoute(/api/school/shop/detail)
* @ApiMethod(GET)
* @ApiParams(name = "id", type = "int",required=true,description = "机构id")
* @ApiReturn({
*
*})
*/
public function detail(){
$id = $this->request->get('id/d','');
if(empty($id)){
$this->error(__('缺少必要参数'));
}
try {
$res = $this->model->detail($id);
} catch (\Exception $e){
// Log::log($e->getMessage());
$this->error($e->getMessage(),['errcode'=>$e->getCode()]);
}
$this->success('获取成功', ['detail' => $res]);
}
}

View File

@ -0,0 +1,57 @@
<?php
namespace app\api\controller\school;
use app\common\model\school\classes\Teacher as Teachermodel;
/**
* 教师接口
*/
class Teacher extends Base
{
protected $noNeedLogin = ["detail",'people','spec'];
protected $noNeedRight = '*';
protected $model = null;
/**
* 初始化操作
* @access protected
*/
protected function _initialize()
{
$this->model = new Teachermodel;
parent::_initialize();
//判断登录用户是否是员工
}
/**
* @ApiTitle( 老师详情)
* @ApiSummary(老师详情)
* @ApiRoute(/api/school/teacher/detail)
* @ApiMethod(GET)
* @ApiParams(name = "id", type = "int",required=true,description = "老师id")
* @ApiReturn({
*
*})
*/
public function detail(){
$id = $this->request->get('id/d','');
if(empty($id)){
$this->error(__('缺少必要参数'));
}
try {
$res = $this->model->detail($id);
} catch (\Exception $e){
// Log::log($e->getMessage());
$this->error($e->getMessage(),['errcode'=>$e->getCode()]);
}
$this->success('获取成功', ['detail' => $res]);
}
}

View File

@ -0,0 +1,25 @@
<?php
namespace app\api\controller\school\worker;
use app\common\controller\Api;
class Base extends Api
{
/**
* 初始化操作
* @access protected
*/
protected function _initialize()
{
parent::_initialize();
//判断登录用户是否是员工
}
}

View File

@ -0,0 +1,66 @@
<?php
namespace app\common\library;
use app\common\model\school\classes\VirtualHead;
use app\common\model\school\classes\VirtualUser;
/**
* 虚拟数据工具类
*/
class Virtual
{
/** 获得虚拟昵称
* @return mixed|string
*/
public function getNickName(){
$str = config("site.virtual_nickname");
$arr = explode("##",$str);
$r = rand(0,sizeof($arr));
return $arr[$r];
}
public function getVirtualUser($num=10,$classes_lib_id = 0,$time=null,$set=false){
$users = [];
if(!$time)$time = time();
//mysql随机查询$num个数据
$virtualHead = VirtualHead::orderRaw("rand()")->limit($num)->select();
//随机获得$num个虚拟用户昵称和头像
foreach($virtualHead as $v) {
$nickname = $this->getNickName();
$head = $v->head_image;
$r = rand(($time - 86400*7),$time);
$users[] = [
"nickname"=>$nickname,
"head_image"=>$head,
"time"=>$r,
"jointype" => "1",
"havetype" => "".($r % 2)
];
}
if(!$set){
return $users;
}else{
$user_data=[];
foreach($users as $user) {
$r = rand(($time - 86400*7),$time);
$user_data[] = [
"nickname"=>$user["nickname"],
"head_image"=>$user["head_image"],
"classes_lib_id"=>$classes_lib_id,
"time"=>$r,
"jointype" => "1",
"havetype" => "".($r % 2)
];
}
(new VirtualUser)->saveAll($user_data);
return $user_data;
}
}
}

View File

@ -2,6 +2,8 @@
namespace app\common\model;
use app\common\model\school\classes\Teacher;
use app\common\model\school\classes\Verification;
use think\Db;
use think\Model;
@ -45,7 +47,7 @@ class User extends Model
//$value = '/assets/img/avatar.png';
$value = letter_avatar($data['nickname']);
}
return $value;
return cdnurl($value,true);
}
/**
@ -148,4 +150,33 @@ class User extends Model
}
return $level;
}
/**是否有核销权限
* @return boolean
*/
public static function verificationAuth($user_id){
$have_auth = false;
//判断用户是否有核销权限
//判断是否是员工
$verification = Verification::where("user_id",$user_id)->where("status",'1')->find();
if($verification)$have_auth = true;
//判断是否是教师
$teacher = Teacher::where("user_id",$user_id)->find();
if($teacher)$have_auth = true;
return $have_auth;
}
/**是否有老师权限
* @return boolean
*/
public static function teacherAuth($user_id){
$have_auth = false;
//判断是否是教师
$teacher = Teacher::where("user_id",$user_id)->find();
if($teacher)$have_auth = true;
return $have_auth;
}
}

View File

@ -0,0 +1,178 @@
<?php
namespace app\common\model\dyqc;
use app\common\model\school\classes\ClassesLib;
use app\common\model\school\classes\Teacher;
use think\Model;
class ManystoreShop extends Model
{
// 表名
protected $name = 'manystore_shop';
// 自动写入时间戳字段
protected $autoWriteTimestamp = false;
// 定义时间戳字段名
protected $createTime = false;
protected $updateTime = false;
protected $deleteTime = false;
// 追加属性
protected $append = [
'status_text',
'auth_time_text',
'create_time_text',
'update_time_text'
];
/** 专家团队
* @return \think\model\relation\HasMany
*/
public function teachers()
{
return $this->hasMany(Teacher::class,'shop_id')->where("status","1")->order("weigh desc");
}
public function getLogoAttr($value, $data)
{
if (!empty($value)) return cdnurl($value, true);
}
public function getImageAttr($value, $data)
{
if (!empty($value)) return cdnurl($value, true);
}
public function getImagesAttr($value, $data)
{
$imagesArray = [];
if (!empty($value)) {
$imagesArray = explode(',', $value);
foreach ($imagesArray as &$v) {
$v = cdnurl($v, true);
}
return $imagesArray;
}
return $imagesArray;
}
public function getYyzzImagesAttr($value, $data)
{
$imagesArray = [];
if (!empty($value)) {
$imagesArray = explode(',', $value);
foreach ($imagesArray as &$v) {
$v = cdnurl($v, true);
}
return $imagesArray;
}
return $imagesArray;
}
public function getStatusList()
{
return ['0' => __('Status 0'), '1' => __('Status 1'), '2' => __('Status 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 getAuthTimeTextAttr($value, $data)
{
$value = $value ? $value : (isset($data['auth_time']) ? $data['auth_time'] : '');
return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
}
public function getCreateTimeTextAttr($value, $data)
{
$value = $value ? $value : (isset($data['create_time']) ? $data['create_time'] : '');
return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
}
public function getUpdateTimeTextAttr($value, $data)
{
$value = $value ? $value : (isset($data['update_time']) ? $data['update_time'] : '');
return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
}
protected function setAuthTimeAttr($value)
{
return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
}
protected function setCreateTimeAttr($value)
{
return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
}
protected function setUpdateTimeAttr($value)
{
return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
}
public function admin()
{
return $this->belongsTo('app\admin\model\Admin', 'admin_id', 'id', [], 'LEFT')->setEagerlyType(0);
}
/** 机构详情
* @param $id
* @throws \think\exception\DbException
*/
public function detail($id){
$self = $this->get($id,['teachers']);
//一对多隐藏字段方法
// foreach ($self['teachers'] as $k=>$v){
// $v->visible(['id','name','expert_image','expert_content']);
// }
// $self->visible(['id','name','expert_image','expert_content']);
$self["hot"] = $this->getHotClasses($id,$limit=5);
return $self;
}
public function getHotClasses($id,$limit=5){
$data = ClassesLib::where("shop_id",$id)
->where("status",'1')
->limit($limit)
->order("hot desc,weigh desc")
->field("title,headimage,price,hot,weigh")
->select();
return $data;
}
}

View File

@ -0,0 +1,59 @@
<?php
namespace app\common\model\school\classes;
use think\Model;
use traits\model\SoftDelete;
class Cate extends Model
{
use SoftDelete;
// 表名
protected $name = 'school_classes_cate';
// 自动写入时间戳字段
protected $autoWriteTimestamp = 'integer';
// 定义时间戳字段名
protected $createTime = 'createtime';
protected $updateTime = 'updatetime';
protected $deleteTime = 'deletetime';
// 追加属性
protected $append = [
'status_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 getStatusTextAttr($value, $data)
{
$value = $value ? $value : (isset($data['status']) ? $data['status'] : '');
$list = $this->getStatusList();
return isset($list[$value]) ? $list[$value] : '';
}
}

View File

@ -0,0 +1,353 @@
<?php
namespace app\common\model\school\classes;
use app\common\model\dyqc\ManystoreShop;
use app\common\model\User;
use think\Model;
use traits\model\SoftDelete;
class ClassesLib extends Model
{
use SoftDelete;
// 表名
protected $name = 'school_classes_lib';
// 自动写入时间戳字段
protected $autoWriteTimestamp = 'integer';
// 定义时间戳字段名
protected $createTime = 'createtime';
protected $updateTime = 'updatetime';
protected $deleteTime = 'deletetime';
// 追加属性
protected $append = [
'add_type_text',
'type_text',
'address_type_text',
'status_text',
'auth_status_text',
'auth_time_text',
'recommend_text',
'hot_text',
'new_text',
'selfhot_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 getAddTypeList()
{
return ['1' => __('Add_type 1'), '2' => __('Add_type 2')];
}
public function getTypeList()
{
return ['out' => __('Type out'), 'in' => __('Type in')];
}
public function getAddressTypeList()
{
return ['1' => __('Address_type 1'), '2' => __('Address_type 2')];
}
public function getStatusList()
{
return ['1' => __('Status 1'), '2' => __('Status 2'), '3' => __('Status 3')];
}
public function getAuthStatusList()
{
return ['0' => __('Auth_status 0'), '1' => __('Auth_status 1'), '2' => __('Auth_status 2')];
}
public function getRecommendList()
{
return ['0' => __('Recommend 0'), '1' => __('Recommend 1')];
}
public function getHotList()
{
return ['0' => __('Hot 0'), '1' => __('Hot 1')];
}
public function getNewList()
{
return ['0' => __('New 0'), '1' => __('New 1')];
}
public function getSelfhotList()
{
return ['0' => __('Selfhot 0'), '1' => __('Selfhot 1')];
}
public function getAddTypeTextAttr($value, $data)
{
$value = $value ? $value : (isset($data['add_type']) ? $data['add_type'] : '');
$list = $this->getAddTypeList();
return isset($list[$value]) ? $list[$value] : '';
}
public function getTypeTextAttr($value, $data)
{
$value = $value ? $value : (isset($data['type']) ? $data['type'] : '');
$list = $this->getTypeList();
return isset($list[$value]) ? $list[$value] : '';
}
public function getAddressTypeTextAttr($value, $data)
{
$value = $value ? $value : (isset($data['address_type']) ? $data['address_type'] : '');
$list = $this->getAddressTypeList();
return isset($list[$value]) ? $list[$value] : '';
}
public function getStatusTextAttr($value, $data)
{
$value = $value ? $value : (isset($data['status']) ? $data['status'] : '');
$list = $this->getStatusList();
return isset($list[$value]) ? $list[$value] : '';
}
public function getAuthStatusTextAttr($value, $data)
{
$value = $value ? $value : (isset($data['auth_status']) ? $data['auth_status'] : '');
$list = $this->getAuthStatusList();
return isset($list[$value]) ? $list[$value] : '';
}
public function getAuthTimeTextAttr($value, $data)
{
$value = $value ? $value : (isset($data['auth_time']) ? $data['auth_time'] : '');
return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
}
public function getRecommendTextAttr($value, $data)
{
$value = $value ? $value : (isset($data['recommend']) ? $data['recommend'] : '');
$list = $this->getRecommendList();
return isset($list[$value]) ? $list[$value] : '';
}
public function getHotTextAttr($value, $data)
{
$value = $value ? $value : (isset($data['hot']) ? $data['hot'] : '');
$list = $this->getHotList();
return isset($list[$value]) ? $list[$value] : '';
}
public function getNewTextAttr($value, $data)
{
$value = $value ? $value : (isset($data['new']) ? $data['new'] : '');
$list = $this->getNewList();
return isset($list[$value]) ? $list[$value] : '';
}
public function getSelfhotTextAttr($value, $data)
{
$value = $value ? $value : (isset($data['selfhot']) ? $data['selfhot'] : '');
$list = $this->getSelfhotList();
return isset($list[$value]) ? $list[$value] : '';
}
protected function setAuthTimeAttr($value)
{
return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
}
public function getHeadimageAttr($value, $data)
{
if (!empty($value)) return cdnurl($value, true);
}
public function getImagesAttr($value, $data)
{
$imagesArray = [];
if (!empty($value)) {
$imagesArray = explode(',', $value);
foreach ($imagesArray as &$v) {
$v = cdnurl($v, true);
}
return $imagesArray;
}
return $imagesArray;
}
public function manystore()
{
return $this->belongsTo('app\admin\model\Manystore', 'manystore_id', 'id', [], 'LEFT')->setEagerlyType(0);
}
public function shop()
{
return $this->belongsTo(ManystoreShop::class, 'shop_id', 'id', [], 'LEFT')->setEagerlyType(0);
}
public function user()
{
return $this->belongsTo('app\common\model\User', 'user_id', 'id', [], 'LEFT')->setEagerlyType(0);
}
public function admin()
{
return $this->belongsTo('app\admin\model\Admin', 'admin_id', 'id', [], 'LEFT')->setEagerlyType(0);
}
public function teacher()
{
return $this->belongsTo('app\common\model\school\classes\Teacher', 'teacher_id', 'id', [], 'LEFT')->setEagerlyType(0);
}
/** 课程详情
* @param $id
* @return ClassesLib|null
* @throws \think\exception\DbException
*/
public function detail($id){
$self = $this->get($id,['shop','teacher']);
//下架判断
if($self['status'] != '1'){
$this->error("该课程已下架");
}
//参与人数 = 虚拟人数 + 平台人数
return $self;
}
/**课程参与人员信息
* @param $id
*
*/
public function virtualParticipants($id){
//虚拟用户生成数量
$v_num = 10;
$unpaid_user_data = $paid_user_data = [];
//参与者头像
//先从订单里取出最新的10个未支付和使用中的用户不足的用虚拟用户填充
$user_ids = \app\common\model\school\classes\order\Order::where("classes_lib_id",$id)->where("status","in",["0",'3'])->order("createtime desc")->limit($v_num)->column("createtime","user_id");
if($user_ids){
$users = User::where("id","in",array_keys($user_ids))->select();
foreach ($users as $user){
$unpaid_user_data[] = [
"nickname"=>$user['nickname'],
"head_image"=>$user['avatar'],
"classes_lib_id"=>$id,
"time"=>$user_ids[$user['id']],
"jointype"=>'1',
"havetype"=>'0'
];
}
}
//计算需要生成的虚拟用户数量
$v_num = $v_num - count($user_ids);
if($v_num<0)$v_num =0;
if($v_num){
$unpaid_user = VirtualUser::where("classes_lib_id",$id)->where("jointype",'1')->order("time desc")->limit($v_num)->select();
$unpaid_user_data = array_merge($unpaid_user_data,$unpaid_user);
}
//再从订单里取出最新的10个使用中已完成 和 已退款 的用户,不足的用虚拟用户填充
$user_ids = \app\common\model\school\classes\order\Order::where("classes_lib_id",$id)->where("status","in",["3",'6','9'])->order("createtime desc")->limit($v_num)->column("createtime","user_id");
if($user_ids){
$users = User::where("id","in",array_keys($user_ids))->select();
foreach ($users as $user){
$paid_user_data[] = [
"nickname"=>$user['nickname'],
"head_image"=>$user['avatar'],
"classes_lib_id"=>$id,
"time"=>$user_ids[$user['id']],
"jointype"=>'0',
"havetype"=>'1'
];
}
}
//计算需要生成的虚拟用户数量
$v_num = 10;
$v_num = $v_num - count($user_ids);
if($v_num<0)$v_num =0;
if($v_num){
$unpaid_user = VirtualUser::where("classes_lib_id",$id)->where("havetype",'1')->order("time desc")->limit($v_num)->select();
$paid_user_data = array_merge($paid_user_data,$unpaid_user);
}
//进行昵称加*和按时间重新排序
array_multisort(array_column($unpaid_user_data, 'time'), SORT_ASC, $unpaid_user_data);
array_multisort(array_column($paid_user_data, 'time'), SORT_ASC, $paid_user_data);
foreach ($unpaid_user_data as &$userss){
//substr_replace($username, '****', 3, 4);
$userss["nickname"] = $this->nickname_filter($userss["nickname"]);
}
foreach ($paid_user_data as &$usersss){
//substr_replace($username, '****', 3, 4);
$usersss["nickname"] = $this->nickname_filter($usersss["nickname"]);
}
return compact("unpaid_user_data","paid_user_data");
}
public function nickname_filter($nickname){
$nickname_len = mb_strlen($nickname);
if($nickname_len<=2){
return $nickname;
}else{
return mb_substr($nickname,0,1).str_repeat("*",$nickname_len-2).mb_substr($nickname,-1);
}
}
/**课程规格
* @param $id
*
*/
public function spec($id){
//课程规格
$spec_data = ClassesSpec::where("classes_lib_id",$id)->where("status",'1')->order("weigh desc")->select();
return $spec_data;
}
}

View File

@ -0,0 +1,87 @@
<?php
namespace app\common\model\school\classes;
use think\Model;
use traits\model\SoftDelete;
class ClassesSpec extends Model
{
use SoftDelete;
// 表名
protected $name = 'school_classes_lib_spec';
// 自动写入时间戳字段
protected $autoWriteTimestamp = 'integer';
// 定义时间戳字段名
protected $createTime = 'createtime';
protected $updateTime = 'updatetime';
protected $deleteTime = 'deletetime';
// 追加属性
protected $append = [
'start_time_text',
'end_time_text',
'status_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 getStartTimeTextAttr($value, $data)
{
$value = $value ? $value : (isset($data['start_time']) ? $data['start_time'] : '');
return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
}
public function getEndTimeTextAttr($value, $data)
{
$value = $value ? $value : (isset($data['end_time']) ? $data['end_time'] : '');
return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
}
public function getStatusTextAttr($value, $data)
{
$value = $value ? $value : (isset($data['status']) ? $data['status'] : '');
$list = $this->getStatusList();
return isset($list[$value]) ? $list[$value] : '';
}
protected function setStartTimeAttr($value)
{
return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
}
protected function setEndTimeAttr($value)
{
return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
}
public function lib()
{
return $this->belongsTo('Lib', 'classes_lib_id', 'id', [], 'LEFT')->setEagerlyType(0);
}
}

View File

@ -0,0 +1,60 @@
<?php
namespace app\common\model\school\classes;
use think\Model;
class Collect extends Model
{
// 表名
protected $name = 'school_classes_collect';
// 自动写入时间戳字段
protected $autoWriteTimestamp = 'integer';
// 定义时间戳字段名
protected $createTime = 'createtime';
protected $updateTime = false;
protected $deleteTime = false;
// 追加属性
protected $append = [
];
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 user()
{
return $this->belongsTo('app\admin\model\User', 'user_id', 'id', [], 'LEFT')->setEagerlyType(0);
}
public function lib()
{
return $this->belongsTo('Lib', 'classes_lib_id', 'id', [], 'LEFT')->setEagerlyType(0);
}
}

View File

@ -0,0 +1,59 @@
<?php
namespace app\common\model\school\classes;
use think\Model;
use traits\model\SoftDelete;
class Label extends Model
{
use SoftDelete;
// 表名
protected $name = 'school_classes_label';
// 自动写入时间戳字段
protected $autoWriteTimestamp = 'integer';
// 定义时间戳字段名
protected $createTime = 'createtime';
protected $updateTime = 'updatetime';
protected $deleteTime = 'deletetime';
// 追加属性
protected $append = [
'status_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 getStatusTextAttr($value, $data)
{
$value = $value ? $value : (isset($data['status']) ? $data['status'] : '');
$list = $this->getStatusList();
return isset($list[$value]) ? $list[$value] : '';
}
}

View File

@ -0,0 +1,12 @@
<?php
namespace app\common\model\school\classes;
use think\Model;
class Lib extends Model
{
// 表名
protected $name = 'school_classes_lib';
}

View File

@ -0,0 +1,12 @@
<?php
namespace app\common\model\school\classes;
use think\Model;
class Order extends Model
{
// 表名
protected $name = 'school_classes_order';
}

View File

@ -0,0 +1,95 @@
<?php
namespace app\common\model\school\classes;
use think\Model;
use traits\model\SoftDelete;
class Teacher extends Model
{
use SoftDelete;
// 表名
protected $name = 'school_teacher';
// 自动写入时间戳字段
protected $autoWriteTimestamp = 'integer';
// 定义时间戳字段名
protected $createTime = 'createtime';
protected $updateTime = 'updatetime';
protected $deleteTime = 'deletetime';
// 追加属性
protected $append = [
'status_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 getHeadImageAttr($value, $data)
{
if (!empty($value)) return cdnurl($value, true);
}
public function getExpertImageAttr($value, $data)
{
if (!empty($value)) return cdnurl($value, true);
}
public function getStatusList()
{
return ['1' => __('Status 1'), '2' => __('Status 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 user()
{
return $this->belongsTo('app\admin\model\User', 'user_id', 'id', [], 'LEFT')->setEagerlyType(0);
}
public function manystore()
{
return $this->belongsTo('app\admin\model\Manystore', 'manystore_id', 'id', [], 'LEFT')->setEagerlyType(0);
}
public function shop()
{
return $this->belongsTo('app\admin\model\manystore\Shop', 'shop_id', 'id', [], 'LEFT')->setEagerlyType(0);
}
public function detail($id){
$self = $this->get($id,["shop"]);
$self["shop"]->visible(['name']);
return $self;
}
}

View File

@ -0,0 +1,65 @@
<?php
namespace app\common\model\school\classes;
use think\Model;
class Verification extends Model
{
// 表名
protected $name = 'school_verification';
// 自动写入时间戳字段
protected $autoWriteTimestamp = 'integer';
// 定义时间戳字段名
protected $createTime = 'createtime';
protected $updateTime = 'updatetime';
protected $deleteTime = false;
// 追加属性
protected $append = [
'status_text'
];
public function getStatusList()
{
return ['1' => __('Status 1'), '2' => __('Status 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 manystore()
{
return $this->belongsTo('app\admin\model\Manystore', 'manystore_id', 'id', [], 'LEFT')->setEagerlyType(0);
}
public function shop()
{
return $this->belongsTo('app\admin\model\manystore\Shop', 'shop_id', 'id', [], 'LEFT')->setEagerlyType(0);
}
public function user()
{
return $this->belongsTo('app\admin\model\User', 'user_id', 'id', [], 'LEFT')->setEagerlyType(0);
}
}

View File

@ -0,0 +1,53 @@
<?php
namespace app\common\model\school\classes;
use think\Model;
class VirtualHead extends Model
{
// 表名
protected $name = 'school_virtual_head';
// 自动写入时间戳字段
protected $autoWriteTimestamp = false;
// 定义时间戳字段名
protected $createTime = false;
protected $updateTime = false;
protected $deleteTime = false;
// 追加属性
protected $append = [
];
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 getHeadImageAttr($value, $data)
{
if (!empty($value)) return cdnurl($value, true);
}
}

View File

@ -0,0 +1,60 @@
<?php
namespace app\common\model\school\classes;
use think\Model;
class VirtualUser extends Model
{
// 表名
protected $name = 'school_virtual_user';
// 自动写入时间戳字段
protected $autoWriteTimestamp = false;
// 定义时间戳字段名
protected $createTime = false;
protected $updateTime = false;
protected $deleteTime = false;
// 追加属性
protected $append = [
'time_text'
];
public function getTimeTextAttr($value, $data)
{
$value = $value ? $value : (isset($data['time']) ? $data['time'] : '');
return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
}
protected function setTimeAttr($value)
{
return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
}
public function lib()
{
return $this->belongsTo('Lib', 'classes_lib_id', 'id', [], 'LEFT')->setEagerlyType(0);
}
public function getHeadImageAttr($value, $data)
{
if (!empty($value)) return cdnurl($value, true);
}
}

View File

@ -0,0 +1,12 @@
<?php
namespace app\common\model\school\classes\hour;
use think\Model;
class Order extends Model
{
// 表名
protected $name = 'school_classes_hour_order';
}

View File

@ -0,0 +1,140 @@
<?php
namespace app\common\model\school\classes\hourorder;
use think\Model;
use traits\model\SoftDelete;
class Order extends Model
{
use SoftDelete;
// 表名
protected $name = 'school_classes_hour_order';
// 自动写入时间戳字段
protected $autoWriteTimestamp = 'integer';
// 定义时间戳字段名
protected $createTime = 'createtime';
protected $updateTime = 'updatetime';
protected $deleteTime = 'deletetime';
// 追加属性
protected $append = [
'start_time_text',
'end_time_text',
'status_text',
'reservation_time_text',
'finish_time_text',
'cancel_time_text'
];
public function getStatusList()
{
return ['-3' => __('Status -3'),'-1' => __('Status -1'), '0' => __('Status 0'), '3' => __('Status 3')];
}
public function getStartTimeTextAttr($value, $data)
{
$value = $value ? $value : (isset($data['start_time']) ? $data['start_time'] : '');
return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
}
public function getEndTimeTextAttr($value, $data)
{
$value = $value ? $value : (isset($data['end_time']) ? $data['end_time'] : '');
return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
}
public function getStatusTextAttr($value, $data)
{
$value = $value ? $value : (isset($data['status']) ? $data['status'] : '');
$list = $this->getStatusList();
return isset($list[$value]) ? $list[$value] : '';
}
public function getReservationTimeTextAttr($value, $data)
{
$value = $value ? $value : (isset($data['reservation_time']) ? $data['reservation_time'] : '');
return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
}
public function getFinishTimeTextAttr($value, $data)
{
$value = $value ? $value : (isset($data['finish_time']) ? $data['finish_time'] : '');
return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
}
public function getCancelTimeTextAttr($value, $data)
{
$value = $value ? $value : (isset($data['cancel_time']) ? $data['cancel_time'] : '');
return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
}
protected function setStartTimeAttr($value)
{
return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
}
protected function setEndTimeAttr($value)
{
return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
}
protected function setReservationTimeAttr($value)
{
return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
}
protected function setFinishTimeAttr($value)
{
return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
}
protected function setCancelTimeAttr($value)
{
return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
}
public function classesorder()
{
return $this->belongsTo('app\admin\model\school\classes\Order', 'classes_order_id', 'id', [], 'LEFT')->setEagerlyType(0);
}
public function spec()
{
return $this->belongsTo('app\admin\model\school\classes\lib\Spec', 'classes_lib_spec_id', 'id', [], 'LEFT')->setEagerlyType(0);
}
public function user()
{
return $this->belongsTo('app\admin\model\User', 'user_id', 'id', [], 'LEFT')->setEagerlyType(0);
}
public function detail()
{
return $this->belongsTo('app\admin\model\school\classes\order\Detail', 'classes_order_detail_id', 'id', [], 'LEFT')->setEagerlyType(0);
}
public function lib()
{
return $this->belongsTo('app\admin\model\school\classes\Lib', 'classes_lib_id', 'id', [], 'LEFT')->setEagerlyType(0);
}
}

View File

@ -0,0 +1,53 @@
<?php
namespace app\common\model\school\classes\hourorder;
use think\Model;
class OrderLog extends Model
{
// 表名
protected $name = 'school_classes_hour_order_log';
// 自动写入时间戳字段
protected $autoWriteTimestamp = 'integer';
// 定义时间戳字段名
protected $createTime = 'createtime';
protected $updateTime = false;
protected $deleteTime = false;
// 追加属性
protected $append = [
'status_text'
];
public function getStatusList()
{
return ['-3' => __('Status -3'),'-1' => __('Status -1'), '0' => __('Status 0'), '3' => __('Status 3')];
}
public function getStatusTextAttr($value, $data)
{
$value = $value ? $value : (isset($data['status']) ? $data['status'] : '');
$list = $this->getStatusList();
return isset($list[$value]) ? $list[$value] : '';
}
public function order()
{
return $this->belongsTo('app\admin\model\school\classes\hour\Order', 'classes_hour_order_id', 'id', [], 'LEFT')->setEagerlyType(0);
}
}

View File

@ -0,0 +1,12 @@
<?php
namespace app\common\model\school\classes\lib;
use think\Model;
class Spec extends Model
{
// 表名
protected $name = 'school_classes_lib_spec';
}

View File

@ -0,0 +1,12 @@
<?php
namespace app\common\model\school\classes\order;
use think\Model;
class Detail extends Model
{
// 表名
protected $name = 'school_classes_order_detail';
}

View File

@ -0,0 +1,189 @@
<?php
namespace app\common\model\school\classes\order;
use think\Model;
use traits\model\SoftDelete;
class Order extends Model
{
use SoftDelete;
// 表名
protected $name = 'school_classes_order';
// 自动写入时间戳字段
protected $autoWriteTimestamp = 'integer';
// 定义时间戳字段名
protected $createTime = 'createtime';
protected $updateTime = 'updatetime';
protected $deleteTime = 'deletetime';
// 追加属性
protected $append = [
'pay_type_text',
'status_text',
'before_status_text',
'server_status_text',
'result_status_text',
'canceltime_text',
'paytime_text',
'finishtime_text',
'refundtime_text'
];
public function getPayTypeList()
{
return ['yue' => __('Pay_type yue'), 'wechat' => __('Pay_type wechat')];
}
public function getStatusList()
{
return ['-3' => __('Status -3'), '0' => __('Status 0'), '3' => __('Status 3'), '6' => __('Status 6'), '9' => __('Status 9')];
}
public function getBeforeStatusList()
{
return ['-3' => __('Before_status -3'), '0' => __('Before_status 0'), '3' => __('Before_status 3'), '6' => __('Before_status 6'), '9' => __('Before_status 9')];
}
public function getServerStatusList()
{
return ['0' => __('Server_status 0'), '3' => __('Server_status 3'), '6' => __('Server_status 6')];
}
public function getResultStatusList()
{
return ['0' => __('Result_status 0'), '3' => __('Result_status 3'), '6' => __('Result_status 6')];
}
public function getPayTypeTextAttr($value, $data)
{
$value = $value ? $value : (isset($data['pay_type']) ? $data['pay_type'] : '');
$list = $this->getPayTypeList();
return isset($list[$value]) ? $list[$value] : '';
}
public function getStatusTextAttr($value, $data)
{
$value = $value ? $value : (isset($data['status']) ? $data['status'] : '');
$list = $this->getStatusList();
return isset($list[$value]) ? $list[$value] : '';
}
public function getBeforeStatusTextAttr($value, $data)
{
$value = $value ? $value : (isset($data['before_status']) ? $data['before_status'] : '');
$list = $this->getBeforeStatusList();
return isset($list[$value]) ? $list[$value] : '';
}
public function getServerStatusTextAttr($value, $data)
{
$value = $value ? $value : (isset($data['server_status']) ? $data['server_status'] : '');
$list = $this->getServerStatusList();
return isset($list[$value]) ? $list[$value] : '';
}
public function getResultStatusTextAttr($value, $data)
{
$value = $value ? $value : (isset($data['result_status']) ? $data['result_status'] : '');
$list = $this->getResultStatusList();
return isset($list[$value]) ? $list[$value] : '';
}
public function getCanceltimeTextAttr($value, $data)
{
$value = $value ? $value : (isset($data['canceltime']) ? $data['canceltime'] : '');
return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
}
public function getPaytimeTextAttr($value, $data)
{
$value = $value ? $value : (isset($data['paytime']) ? $data['paytime'] : '');
return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
}
public function getFinishtimeTextAttr($value, $data)
{
$value = $value ? $value : (isset($data['finishtime']) ? $data['finishtime'] : '');
return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
}
public function getRefundtimeTextAttr($value, $data)
{
$value = $value ? $value : (isset($data['refundtime']) ? $data['refundtime'] : '');
return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
}
protected function setCanceltimeAttr($value)
{
return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
}
protected function setPaytimeAttr($value)
{
return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
}
protected function setFinishtimeAttr($value)
{
return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
}
protected function setRefundtimeAttr($value)
{
return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
}
public function manystore()
{
return $this->belongsTo('app\admin\model\Manystore', 'manystore_id', 'id', [], 'LEFT')->setEagerlyType(0);
}
public function user()
{
return $this->belongsTo('app\admin\model\User', 'user_id', 'id', [], 'LEFT')->setEagerlyType(0);
}
public function shop()
{
return $this->belongsTo('app\admin\model\manystore\Shop', 'shop_id', 'id', [], 'LEFT')->setEagerlyType(0);
}
public function lib()
{
return $this->belongsTo('app\admin\model\school\classes\Lib', 'classes_lib_id', 'id', [], 'LEFT')->setEagerlyType(0);
}
public function detail()
{
return $this->belongsTo('Detail', 'classes_order_detail_id', 'id', [], 'LEFT')->setEagerlyType(0);
}
public function admin()
{
return $this->belongsTo('app\admin\model\Admin', 'admin_id', 'id', [], 'LEFT')->setEagerlyType(0);
}
}

View File

@ -0,0 +1,99 @@
<?php
namespace app\common\model\school\classes\order;
use think\Model;
use traits\model\SoftDelete;
class OrderDetail extends Model
{
use SoftDelete;
// 表名
protected $name = 'school_classes_order_detail';
// 自动写入时间戳字段
protected $autoWriteTimestamp = 'integer';
// 定义时间戳字段名
protected $createTime = 'createtime';
protected $updateTime = 'updatetime';
protected $deleteTime = 'deletetime';
// 追加属性
protected $append = [
'add_type_text',
'type_text',
'address_type_text'
];
public function getAddTypeList()
{
return ['1' => __('Add_type 1'), '2' => __('Add_type 2')];
}
public function getTypeList()
{
return ['out' => __('Type out'), 'in' => __('Type in')];
}
public function getAddressTypeList()
{
return ['1' => __('Address_type 1'), '2' => __('Address_type 2')];
}
public function getAddTypeTextAttr($value, $data)
{
$value = $value ? $value : (isset($data['add_type']) ? $data['add_type'] : '');
$list = $this->getAddTypeList();
return isset($list[$value]) ? $list[$value] : '';
}
public function getTypeTextAttr($value, $data)
{
$value = $value ? $value : (isset($data['type']) ? $data['type'] : '');
$list = $this->getTypeList();
return isset($list[$value]) ? $list[$value] : '';
}
public function getAddressTypeTextAttr($value, $data)
{
$value = $value ? $value : (isset($data['address_type']) ? $data['address_type'] : '');
$list = $this->getAddressTypeList();
return isset($list[$value]) ? $list[$value] : '';
}
public function order()
{
return $this->belongsTo('app\admin\model\school\classes\Order', 'classes_order_id', 'id', [], 'LEFT')->setEagerlyType(0);
}
public function manystore()
{
return $this->belongsTo('app\admin\model\Manystore', 'manystore_id', 'id', [], 'LEFT')->setEagerlyType(0);
}
public function shop()
{
return $this->belongsTo('app\admin\model\manystore\Shop', 'shop_id', 'id', [], 'LEFT')->setEagerlyType(0);
}
public function user()
{
return $this->belongsTo('app\admin\model\User', 'user_id', 'id', [], 'LEFT')->setEagerlyType(0);
}
}

View File

@ -0,0 +1,95 @@
<?php
namespace app\common\model\school\classes\order;
use think\Model;
class OrderLog extends Model
{
// 表名
protected $name = 'school_classes_order_log';
// 自动写入时间戳字段
protected $autoWriteTimestamp = 'integer';
// 定义时间戳字段名
protected $createTime = 'createtime';
protected $updateTime = false;
protected $deleteTime = false;
// 追加属性
protected $append = [
'status_text',
'before_status_text',
'server_status_text',
'result_status_text'
];
public function getStatusList()
{
return ['-3' => __('Status -3'), '0' => __('Status 0'), '3' => __('Status 3'), '6' => __('Status 6'), '9' => __('Status 9')];
}
public function getBeforeStatusList()
{
return ['-3' => __('Before_status -3'), '0' => __('Before_status 0'), '3' => __('Before_status 3'), '6' => __('Before_status 6'), '9' => __('Before_status 9')];
}
public function getServerStatusList()
{
return ['0' => __('Server_status 0'), '3' => __('Server_status 3'), '6' => __('Server_status 6')];
}
public function getResultStatusList()
{
return ['0' => __('Result_status 0'), '3' => __('Result_status 3'), '6' => __('Result_status 6')];
}
public function getStatusTextAttr($value, $data)
{
$value = $value ? $value : (isset($data['status']) ? $data['status'] : '');
$list = $this->getStatusList();
return isset($list[$value]) ? $list[$value] : '';
}
public function getBeforeStatusTextAttr($value, $data)
{
$value = $value ? $value : (isset($data['before_status']) ? $data['before_status'] : '');
$list = $this->getBeforeStatusList();
return isset($list[$value]) ? $list[$value] : '';
}
public function getServerStatusTextAttr($value, $data)
{
$value = $value ? $value : (isset($data['server_status']) ? $data['server_status'] : '');
$list = $this->getServerStatusList();
return isset($list[$value]) ? $list[$value] : '';
}
public function getResultStatusTextAttr($value, $data)
{
$value = $value ? $value : (isset($data['result_status']) ? $data['result_status'] : '');
$list = $this->getResultStatusList();
return isset($list[$value]) ? $list[$value] : '';
}
public function order()
{
return $this->belongsTo('app\admin\model\school\classes\Order', 'classes_order_id', 'id', [], 'LEFT')->setEagerlyType(0);
}
}

View File

@ -22,7 +22,8 @@ class VirtualUser extends ManystoreBase
{
parent::_initialize();
$this->model = new \app\manystore\model\school\classes\VirtualUser;
$this->view->assign("jointypeList", $this->model->getJointypeList());
$this->view->assign("havetypeList", $this->model->getHavetypeList());
}
public function import()

View File

@ -15,6 +15,7 @@ return [
'Verification_num' => '下单时已核销人数',
'Status' => '订单状态',
'Status -3' => '已取消',
'Status -1' => '已报名待审核',
'Status 0' => '已预约',
'Status 3' => '已完成',
'Verification_user_id' => '核销人用户id',

View File

@ -4,6 +4,7 @@ return [
'Classes_hour_order_id' => '课时订单id',
'Status' => '订单状态',
'Status -3' => '已取消',
'Status -1' => '已报名待审核',
'Status 0' => '已预约',
'Status 3' => '已完成',
'Log_text' => '记录内容',

View File

@ -5,6 +5,12 @@ return [
'Head_image' => '头像',
'Classes_lib_id' => '课程id',
'Time' => '虚拟下单时间',
'Jointype' => '参与中',
'Jointype 1' => '是',
'Jointype 0' => '否',
'Havetype' => '已报名',
'Havetype 1' => '是',
'Havetype 0' => '否',
'Schoolclasseslib.title' => '标题',
'Schoolclasseslib.headimage' => '头图'
];

View File

@ -0,0 +1,12 @@
<?php
namespace app\manystore\model;
use think\Model;
class Admin extends Model
{
// 表名
protected $name = 'admin';
}

View File

@ -0,0 +1,12 @@
<?php
namespace app\manystore\model;
use think\Model;
class SchoolClassesHourOrder extends Model
{
// 表名
protected $name = 'school_classes_hour_order';
}

View File

@ -0,0 +1,12 @@
<?php
namespace app\manystore\model;
use think\Model;
class SchoolClassesLib extends Model
{
// 表名
protected $name = 'school_classes_lib';
}

View File

@ -0,0 +1,12 @@
<?php
namespace app\manystore\model;
use think\Model;
class SchoolClassesLibSpec extends Model
{
// 表名
protected $name = 'school_classes_lib_spec';
}

View File

@ -0,0 +1,12 @@
<?php
namespace app\manystore\model;
use think\Model;
class SchoolClassesOrder extends Model
{
// 表名
protected $name = 'school_classes_order';
}

View File

@ -0,0 +1,12 @@
<?php
namespace app\manystore\model;
use think\Model;
class SchoolClassesOrderDetail extends Model
{
// 表名
protected $name = 'school_classes_order_detail';
}

View File

@ -0,0 +1,12 @@
<?php
namespace app\manystore\model;
use think\Model;
class User extends Model
{
// 表名
protected $name = 'user';
}

View File

@ -25,12 +25,22 @@ class VirtualUser extends Model
// 追加属性
protected $append = [
'time_text'
'time_text',
'jointype_text',
'havetype_text'
];
public function getJointypeList()
{
return ['1' => __('Jointype 1'), '0' => __('Jointype 0')];
}
public function getHavetypeList()
{
return ['1' => __('Havetype 1'), '0' => __('Havetype 0')];
}
public function getTimeTextAttr($value, $data)
@ -39,6 +49,22 @@ class VirtualUser extends Model
return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
}
public function getJointypeTextAttr($value, $data)
{
$value = $value ? $value : (isset($data['jointype']) ? $data['jointype'] : '');
$list = $this->getJointypeList();
return isset($list[$value]) ? $list[$value] : '';
}
public function getHavetypeTextAttr($value, $data)
{
$value = $value ? $value : (isset($data['havetype']) ? $data['havetype'] : '');
$list = $this->getHavetypeList();
return isset($list[$value]) ? $list[$value] : '';
}
protected function setTimeAttr($value)
{
return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);

View File

@ -37,7 +37,7 @@ class Order extends Model
public function getStatusList()
{
return ['-3' => __('Status -3'), '0' => __('Status 0'), '3' => __('Status 3')];
return ['-3' => __('Status -3'),'-1' => __('Status -1'), '0' => __('Status 0'), '3' => __('Status 3')];
}

View File

@ -32,7 +32,7 @@ class OrderLog extends Model
public function getStatusList()
{
return ['-3' => __('Status -3'), '0' => __('Status 0'), '3' => __('Status 3')];
return ['-3' => __('Status -3'),'-1' => __('Status -1'), '0' => __('Status 0'), '3' => __('Status 3')];
}

View File

@ -32,6 +32,30 @@
<input id="c-time" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[time]" type="text" value="{:date('Y-m-d H:i:s')}">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Jointype')}:</label>
<div class="col-xs-12 col-sm-8">
<select id="c-jointype" class="form-control selectpicker" name="row[jointype]">
{foreach name="jointypeList" item="vo"}
<option value="{$key}" {in name="key" value="0"}selected{/in}>{$vo}</option>
{/foreach}
</select>
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Havetype')}:</label>
<div class="col-xs-12 col-sm-8">
<select id="c-havetype" class="form-control selectpicker" name="row[havetype]">
{foreach name="havetypeList" item="vo"}
<option value="{$key}" {in name="key" value="0"}selected{/in}>{$vo}</option>
{/foreach}
</select>
</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">

View File

@ -32,6 +32,30 @@
<input id="c-time" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[time]" type="text" value="{:$row.time?datetime($row.time):''}">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Jointype')}:</label>
<div class="col-xs-12 col-sm-8">
<select id="c-jointype" class="form-control selectpicker" name="row[jointype]">
{foreach name="jointypeList" item="vo"}
<option value="{$key}" {in name="key" value="$row.jointype"}selected{/in}>{$vo}</option>
{/foreach}
</select>
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Havetype')}:</label>
<div class="col-xs-12 col-sm-8">
<select id="c-havetype" class="form-control selectpicker" name="row[havetype]">
{foreach name="havetypeList" item="vo"}
<option value="{$key}" {in name="key" value="$row.havetype"}selected{/in}>{$vo}</option>
{/foreach}
</select>
</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">

View File

@ -40,14 +40,14 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
{field: 'limit_num', title: __('Limit_num')},
{field: 'sign_num', title: __('Sign_num')},
{field: 'verification_num', title: __('Verification_num')},
{field: 'status', title: __('Status'), searchList: {"-3":__('Status -3'),"0":__('Status 0'),"3":__('Status 3')}, formatter: Table.api.formatter.status},
{field: 'status', title: __('Status'), searchList: {"-3":__('Status -3'),"-1":__('Status -1'),"0":__('Status 0'),"3":__('Status 3')}, formatter: Table.api.formatter.status},
{field: 'verification_user_id', title: __('Verification_user_id')},
{field: 'reservation_time', title: __('Reservation_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
{field: 'finish_time', title: __('Finish_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
{field: 'cancel_time', title: __('Cancel_time'), 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: 'updatetime', title: __('Updatetime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
{field: 'order.order_no', title: __('Order.order_no'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
{field: 'classesorder.order_no', title: __('Order.order_no'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
{field: 'spec.name', title: __('Spec.name'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
{field: 'user.nickname', title: __('User.nickname'), operate: 'LIKE'},
{field: 'user.realname', title: __('User.realname'), operate: 'LIKE'},

View File

@ -27,7 +27,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
{checkbox: true},
{field: 'id', title: __('Id')},
{field: 'classes_hour_order_id', title: __('Classes_hour_order_id')},
{field: 'status', title: __('Status'), searchList: {"-3":__('Status -3'),"0":__('Status 0'),"3":__('Status 3')}, formatter: Table.api.formatter.status},
{field: 'status', title: __('Status'), searchList: {"-3":__('Status -3'),"-1":__('Status -1'),"0":__('Status 0'),"3":__('Status 3')}, formatter: Table.api.formatter.status},
{field: 'log_text', title: __('Log_text'), 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: 'order.order_no', title: __('Order.order_no'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},

View File

@ -25,8 +25,9 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
columns: [
[
{checkbox: true},
{field: 'id', title: __('Classes_lib_id')},
{field: 'id', title: __('Id')},
{field: 'nickname', title: __('Nickname'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
{field: 'nickname', title: __('Nickname'), operate: 'LIKE'},
{field: 'head_image', title: __('Head_image'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image},
{field: 'classes_lib_id', title: __('Classes_lib_id')},
{field: 'time', title: __('Time'),operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},

View File

@ -38,7 +38,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
{field: 'limit_num', title: __('Limit_num')},
{field: 'sign_num', title: __('Sign_num')},
{field: 'verification_num', title: __('Verification_num')},
{field: 'status', title: __('Status'), searchList: {"-3":__('Status -3'),"0":__('Status 0'),"3":__('Status 3')}, formatter: Table.api.formatter.status},
{field: 'status', title: __('Status'), searchList: {"-3":__('Status -3'),"-1":__('Status -1'),"0":__('Status 0'),"3":__('Status 3')}, formatter: Table.api.formatter.status},
{field: 'verification_user_id', title: __('Verification_user_id')},
{field: 'reservation_time', title: __('Reservation_time')},
{field: 'finish_time', title: __('Finish_time')},

View File

@ -27,7 +27,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
{checkbox: true},
{field: 'id', title: __('Id')},
{field: 'classes_hour_order_id', title: __('Classes_hour_order_id')},
{field: 'status', title: __('Status'), searchList: {"-3":__('Status -3'),"0":__('Status 0'),"3":__('Status 3')}, formatter: Table.api.formatter.status},
{field: 'status', title: __('Status'), searchList: {"-3":__('Status -3'),"-1":__('Status -1'),"0":__('Status 0'),"3":__('Status 3')}, formatter: Table.api.formatter.status},
{field: 'log_text', title: __('Log_text'), operate: 'LIKE'},
{field: 'createtime', title: __('Createtime')},
{field: 'schoolclasseshourorder.order_no', title: __('Schoolclasseshourorder.order_no'), operate: 'LIKE'},

View File

@ -29,7 +29,9 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
{field: 'nickname', title: __('Nickname'), operate: 'LIKE'},
{field: 'head_image', title: __('Head_image'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image},
{field: 'classes_lib_id', title: __('Classes_lib_id')},
{field: 'time', title: __('Time')},
{field: 'time', title: __('Time'),operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
{field: 'jointype', title: __('Jointype'), searchList: {"1":__('Jointype 1'),"0":__('Jointype 0')}, formatter: Table.api.formatter.normal},
{field: 'havetype', title: __('Havetype'), searchList: {"1":__('Havetype 1'),"0":__('Havetype 0')}, formatter: Table.api.formatter.normal},
{field: 'schoolclasseslib.title', title: __('Schoolclasseslib.title'), operate: 'LIKE'},
{field: 'schoolclasseslib.headimage', title: __('Schoolclasseslib.headimage'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image},
{field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}