1,机构申请接口和机构状态查询
2,站内信基功能编辑完成 3,用户授权接口和后台(进行中) 4,课程大搜索列表接口
This commit is contained in:
parent
a4b369c59d
commit
72132ff273
|
@ -0,0 +1,73 @@
|
|||
<?php
|
||||
|
||||
namespace app\admin\controller\manystore;
|
||||
|
||||
use app\common\controller\Backend;
|
||||
|
||||
/**
|
||||
* 店铺更新log管理
|
||||
*
|
||||
* @icon fa fa-circle-o
|
||||
*/
|
||||
class ShopLog extends Backend
|
||||
{
|
||||
|
||||
/**
|
||||
* ShopLog模型对象
|
||||
* @var \app\admin\model\manystore\ShopLog
|
||||
*/
|
||||
protected $model = null;
|
||||
|
||||
public function _initialize()
|
||||
{
|
||||
parent::_initialize();
|
||||
$this->model = new \app\admin\model\manystore\ShopLog;
|
||||
$this->view->assign("typeList", $this->model->getTypeList());
|
||||
$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(['shop','user'])
|
||||
->where($where)
|
||||
->order($sort, $order)
|
||||
->paginate($limit);
|
||||
|
||||
foreach ($list as $row) {
|
||||
|
||||
$row->getRelation('shop')->visible(['name']);
|
||||
$row->getRelation('user')->visible(['nickname','mobile','avatar']);
|
||||
}
|
||||
|
||||
$result = array("total" => $list->total(), "rows" => $list->items());
|
||||
|
||||
return json($result);
|
||||
}
|
||||
return $this->view->fetch();
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,72 @@
|
|||
<?php
|
||||
|
||||
namespace app\admin\controller\manystore;
|
||||
|
||||
use app\common\controller\Backend;
|
||||
|
||||
/**
|
||||
* 授权机构用户
|
||||
*
|
||||
* @icon fa fa-circle-o
|
||||
*/
|
||||
class UserAuth extends Backend
|
||||
{
|
||||
|
||||
/**
|
||||
* UserAuth模型对象
|
||||
* @var \app\admin\model\manystore\UserAuth
|
||||
*/
|
||||
protected $model = null;
|
||||
|
||||
public function _initialize()
|
||||
{
|
||||
parent::_initialize();
|
||||
$this->model = new \app\admin\model\manystore\UserAuth;
|
||||
$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(['shop','user'])
|
||||
->where($where)
|
||||
->order($sort, $order)
|
||||
->paginate($limit);
|
||||
|
||||
foreach ($list as $row) {
|
||||
|
||||
$row->getRelation('shop')->visible(['name']);
|
||||
$row->getRelation('user')->visible(['nickname','avatar']);
|
||||
}
|
||||
|
||||
$result = array("total" => $list->total(), "rows" => $list->items());
|
||||
|
||||
return json($result);
|
||||
}
|
||||
return $this->view->fetch();
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,76 @@
|
|||
<?php
|
||||
|
||||
namespace app\admin\controller\school;
|
||||
|
||||
use app\common\controller\Backend;
|
||||
|
||||
/**
|
||||
* 夜校站内信
|
||||
*
|
||||
* @icon fa fa-circle-o
|
||||
*/
|
||||
class Message extends Backend
|
||||
{
|
||||
|
||||
/**
|
||||
* Message模型对象
|
||||
* @var \app\admin\model\school\Message
|
||||
*/
|
||||
protected $model = null;
|
||||
|
||||
public function _initialize()
|
||||
{
|
||||
parent::_initialize();
|
||||
$this->model = new \app\admin\model\school\Message;
|
||||
$this->view->assign("platformList", $this->model->getPlatformList());
|
||||
$this->view->assign("operTypeList", $this->model->getOperTypeList());
|
||||
$this->view->assign("toTypeList", $this->model->getToTypeList());
|
||||
$this->view->assign("statusList", $this->model->getStatusList());
|
||||
$this->view->assign("miniTypeList", $this->model->getMiniTypeList());
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 默认生成的控制器所继承的父类中有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','user'])
|
||||
->where($where)
|
||||
->order($sort, $order)
|
||||
->paginate($limit);
|
||||
|
||||
foreach ($list as $row) {
|
||||
|
||||
$row->getRelation('admin')->visible(['nickname','avatar']);
|
||||
$row->getRelation('user')->visible(['nickname','avatar']);
|
||||
}
|
||||
|
||||
$result = array("total" => $list->total(), "rows" => $list->items());
|
||||
|
||||
return json($result);
|
||||
}
|
||||
return $this->view->fetch();
|
||||
}
|
||||
|
||||
}
|
|
@ -3,6 +3,16 @@
|
|||
namespace app\admin\controller\school\classes;
|
||||
|
||||
use app\common\controller\Backend;
|
||||
use app\common\model\school\classes\Order;
|
||||
use app\common\model\User;
|
||||
use app\manystore\model\Manystore;
|
||||
use think\Db;
|
||||
use think\db\exception\DataNotFoundException;
|
||||
use think\db\exception\ModelNotFoundException;
|
||||
use think\Exception;
|
||||
use think\exception\DbException;
|
||||
use think\exception\PDOException;
|
||||
use think\exception\ValidateException;
|
||||
|
||||
/**
|
||||
* 机构课程课时规格
|
||||
|
@ -21,6 +31,9 @@ class ClassesSpec extends Backend
|
|||
protected $qSwitch = true;
|
||||
protected $qFields = ["classes_lib_id"];
|
||||
|
||||
protected $no_auth_fields = ['name','limit_num','status','weigh'];
|
||||
protected $have_auth = false;
|
||||
|
||||
|
||||
public function _initialize()
|
||||
{
|
||||
|
@ -73,4 +86,211 @@ class ClassesSpec extends Backend
|
|||
return $this->view->fetch();
|
||||
}
|
||||
|
||||
protected function no_auth_fields_check($params,$row){
|
||||
|
||||
foreach ($params as $k=>$v){
|
||||
|
||||
//说明数值有变动
|
||||
//$params[$k] 去掉两端空格
|
||||
$params[$k] = trim($v);
|
||||
|
||||
if($row[$k]!=$params[$k]){
|
||||
//当修改参数不在允许修改的字段中
|
||||
if(!in_array($k,$this->no_auth_fields)){
|
||||
|
||||
$this->have_auth = true;break;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return $this->have_auth;
|
||||
|
||||
}
|
||||
|
||||
protected function update_classes($classes_lib_id){
|
||||
//更新课程规格库存
|
||||
//所有课时加起来
|
||||
\app\common\model\school\classes\ClassesLib::update_classes($classes_lib_id);
|
||||
}
|
||||
|
||||
|
||||
protected function updateCheck($id,$params=[],$row=null){
|
||||
if($params && $row){
|
||||
|
||||
if(!$this->no_auth_fields_check($params,$row)){
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
// 课程存在售后订单则不允许操作
|
||||
// 课程存在未完成订单则不允许操作
|
||||
$order = \app\common\model\school\classes\hour\Order::where("classes_lib_spec_id",$id)->where("status","in","-1,0")->find();
|
||||
if($order)$this->error("存在正在使用中的课时订单报名学员,课时规格无法继续操作,如规格有误请下架!");
|
||||
}
|
||||
|
||||
|
||||
protected function update_check(&$params,$row=null)
|
||||
{
|
||||
|
||||
//修改
|
||||
if($row){
|
||||
$this->updateCheck($row->id,$params,$row);
|
||||
}else{
|
||||
//新增
|
||||
|
||||
}
|
||||
|
||||
;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*
|
||||
* @return string
|
||||
* @throws \think\Exception
|
||||
*/
|
||||
public function add()
|
||||
{
|
||||
if (false === $this->request->isPost()) {
|
||||
return $this->view->fetch();
|
||||
}
|
||||
$params = $this->request->post('row/a');
|
||||
if (empty($params)) {
|
||||
$this->error(__('Parameter %s can not be empty', ''));
|
||||
}
|
||||
$params = $this->preExcludeFields($params);
|
||||
|
||||
if ($this->dataLimit && $this->dataLimitFieldAutoFill) {
|
||||
$params[$this->dataLimitField] = $this->auth->id;
|
||||
}
|
||||
$result = false;
|
||||
Db::startTrans();
|
||||
try {
|
||||
//是否采用模型验证
|
||||
if ($this->modelValidate) {
|
||||
$name = str_replace("\\model\\", "\\validate\\", get_class($this->model));
|
||||
$validate = is_bool($this->modelValidate) ? ($this->modelSceneValidate ? $name . '.add' : $name) : $this->modelValidate;
|
||||
$this->model->validateFailException()->validate($validate);
|
||||
}
|
||||
$this->update_check($params,$row=null);
|
||||
$result = $this->model->allowField(true)->save($params);
|
||||
$this->update_classes($this->model["classes_lib_id"]);
|
||||
Db::commit();
|
||||
} catch (ValidateException|PDOException|Exception $e) {
|
||||
Db::rollback();
|
||||
$this->error($e->getMessage());
|
||||
}
|
||||
if ($result === false) {
|
||||
$this->error(__('No rows were inserted'));
|
||||
}
|
||||
$this->success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @param $ids
|
||||
* @return string
|
||||
* @throws DbException
|
||||
* @throws \think\Exception
|
||||
*/
|
||||
public function edit($ids = null)
|
||||
{
|
||||
$row = $this->model->get($ids);
|
||||
if (!$row) {
|
||||
$this->error(__('No Results were found'));
|
||||
}
|
||||
$adminIds = $this->getDataLimitAdminIds();
|
||||
if (is_array($adminIds) && !in_array($row[$this->dataLimitField], $adminIds)) {
|
||||
$this->error(__('You have no permission'));
|
||||
}
|
||||
if (false === $this->request->isPost()) {
|
||||
$this->view->assign('row', $row);
|
||||
return $this->view->fetch();
|
||||
}
|
||||
$params = $this->request->post('row/a');
|
||||
if (empty($params)) {
|
||||
$this->error(__('Parameter %s can not be empty', ''));
|
||||
}
|
||||
$params = $this->preExcludeFields($params);
|
||||
$result = false;
|
||||
Db::startTrans();
|
||||
try {
|
||||
//是否采用模型验证
|
||||
if ($this->modelValidate) {
|
||||
$name = str_replace("\\model\\", "\\validate\\", get_class($this->model));
|
||||
$validate = is_bool($this->modelValidate) ? ($this->modelSceneValidate ? $name . '.edit' : $name) : $this->modelValidate;
|
||||
$row->validateFailException()->validate($validate);
|
||||
}
|
||||
$this->update_check($params,$row);
|
||||
$result = $row->allowField(true)->save($params);
|
||||
$this->update_classes($row["classes_lib_id"]);
|
||||
Db::commit();
|
||||
} catch (ValidateException|PDOException|Exception $e) {
|
||||
Db::rollback();
|
||||
$this->error($e->getMessage());
|
||||
}
|
||||
if (false === $result) {
|
||||
$this->error(__('No rows were updated'));
|
||||
}
|
||||
$this->success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*
|
||||
* @param $ids
|
||||
* @return void
|
||||
* @throws DbException
|
||||
* @throws DataNotFoundException
|
||||
* @throws ModelNotFoundException
|
||||
*/
|
||||
public function del($ids = null)
|
||||
{
|
||||
if (false === $this->request->isPost()) {
|
||||
$this->error(__("Invalid parameters"));
|
||||
}
|
||||
$ids = $ids ?: $this->request->post("ids");
|
||||
if (empty($ids)) {
|
||||
$this->error(__('Parameter %s can not be empty', 'ids'));
|
||||
}
|
||||
$pk = $this->model->getPk();
|
||||
$adminIds = $this->getDataLimitAdminIds();
|
||||
if (is_array($adminIds)) {
|
||||
$this->model->where($this->dataLimitField, 'in', $adminIds);
|
||||
}
|
||||
$list = $this->model->where($pk, 'in', $ids)->select();
|
||||
$datas = [];
|
||||
foreach ($list as $item) {
|
||||
$this->updateCheck($item->id);
|
||||
$datas[] = $item->classes_lib_id;
|
||||
}
|
||||
|
||||
|
||||
$count = 0;
|
||||
Db::startTrans();
|
||||
try {
|
||||
foreach ($list as $item) {
|
||||
$count += $item->delete();
|
||||
}
|
||||
foreach ($datas as $classes_lib_id) {
|
||||
$this->update_classes($classes_lib_id);
|
||||
}
|
||||
|
||||
Db::commit();
|
||||
} catch (PDOException|Exception $e) {
|
||||
Db::rollback();
|
||||
$this->error($e->getMessage());
|
||||
}
|
||||
if ($count) {
|
||||
$this->success();
|
||||
}
|
||||
$this->error(__('No rows were deleted'));
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,45 @@
|
|||
<?php
|
||||
|
||||
return [
|
||||
'Id' => 'ID',
|
||||
'Shop_id' => '机构店铺id',
|
||||
'User_id' => '机构前端用户',
|
||||
'Name' => '店铺名称',
|
||||
'Logo' => '品牌LOGO',
|
||||
'Image' => '封面图',
|
||||
'Images' => '店铺环境照片',
|
||||
'Address_city' => '城市选择',
|
||||
'Province' => '省编号',
|
||||
'City' => '市编号',
|
||||
'District' => '县区编号',
|
||||
'Address' => '店铺地址',
|
||||
'Address_detail' => '店铺详细地址',
|
||||
'Longitude' => '经度',
|
||||
'Latitude' => '纬度',
|
||||
'Yyzzdm' => '营业执照',
|
||||
'Yyzz_images' => '营业执照照片',
|
||||
'Front_idcard_image' => '法人身份证正面',
|
||||
'Reverse_idcard_image' => '法人身份证反面',
|
||||
'Tel' => '服务电话',
|
||||
'Content' => '店铺详情',
|
||||
'Type' => '类型',
|
||||
'Type 1' => '个人',
|
||||
'Type 2' => '机构',
|
||||
'Desc' => '申请备注',
|
||||
'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' => '修改时间',
|
||||
'Shop.name' => '店铺名称',
|
||||
'User.nickname' => '昵称',
|
||||
'User.mobile' => '手机号',
|
||||
'User.avatar' => '头像'
|
||||
];
|
|
@ -0,0 +1,19 @@
|
|||
<?php
|
||||
|
||||
return [
|
||||
'Shop_id' => '机构shopid',
|
||||
'User_id' => '授权用户',
|
||||
'Status' => '授权状态',
|
||||
'Status 0' => '待确认',
|
||||
'Set status to 0'=> '设为待确认',
|
||||
'Status 1' => '通过',
|
||||
'Set status to 1'=> '设为通过',
|
||||
'Status 2' => '拒绝',
|
||||
'Set status to 2'=> '设为拒绝',
|
||||
'Auth_time' => '授权确认时间',
|
||||
'Createtime' => '发起时间',
|
||||
'Update_time' => '修改时间',
|
||||
'Shop.name' => '店铺名称',
|
||||
'User.nickname' => '昵称',
|
||||
'User.avatar' => '头像'
|
||||
];
|
|
@ -81,5 +81,8 @@ return [
|
|||
'User.realname' => '真实姓名',
|
||||
'User.mobile' => '手机号',
|
||||
'User.avatar' => '头像',
|
||||
'Admin.nickname' => '昵称'
|
||||
'Admin.nickname' => '昵称',
|
||||
'Limit_num' => '总限定人数',
|
||||
'Sign_num' => '总已报名人数',
|
||||
'Verification_num' => '总已核销人数',
|
||||
];
|
||||
|
|
|
@ -0,0 +1,44 @@
|
|||
<?php
|
||||
|
||||
return [
|
||||
'Platform' => '消息平台',
|
||||
'Platform admin' => '总后台',
|
||||
'Platform user' => '用户端',
|
||||
'Platform shop' => '机构后台',
|
||||
'Oper_type' => '发送人类型',
|
||||
'Oper_type admin' => '管理员',
|
||||
'Oper_type user' => '用户',
|
||||
'Oper_type system' => '系统',
|
||||
'Oper_type shop' => '机构',
|
||||
'Oper_id' => '发送人id(没有为0)',
|
||||
'To_type' => '接收人类型',
|
||||
'To_type admin' => '管理员',
|
||||
'To_type user' => '用户',
|
||||
'To_type system' => '系统',
|
||||
'To_type shop' => '机构',
|
||||
'To_id' => '接收人id(全部为0)',
|
||||
'Status' => '消息总类型',
|
||||
'Status system' => '系统消息',
|
||||
'Set status to system' => '设为系统消息',
|
||||
'Status classes' => '课程消息',
|
||||
'Set status to classes' => '设为课程消息',
|
||||
'Status order' => '订单消息',
|
||||
'Set status to order' => '设为订单消息',
|
||||
'Mini_type' => '小消息类型',
|
||||
'Mini_type order_notice' => '课程订单通知',
|
||||
'Mini_type classes_auth' => '课程报名审核',
|
||||
'Mini_type classes_apply' => '课程上新审核',
|
||||
'Mini_type shop_apply' => '机构审核',
|
||||
'Mini_type classes_order_notice' => '课时预约',
|
||||
'Mini_type user_auth' => '机构授权用户信息',
|
||||
'Mini_type aftercare' => '售后服务',
|
||||
'Mini_type other' => '其他',
|
||||
'Title' => '消息标题',
|
||||
'Desc' => '消息内容',
|
||||
'Params' => '消息额外参数(json)',
|
||||
'Createtime' => '创建时间',
|
||||
'Admin.nickname' => '昵称',
|
||||
'Admin.avatar' => '头像',
|
||||
'User.nickname' => '昵称',
|
||||
'User.avatar' => '头像'
|
||||
];
|
|
@ -0,0 +1,12 @@
|
|||
<?php
|
||||
|
||||
namespace app\admin\model\manystore;
|
||||
|
||||
use think\Model;
|
||||
|
||||
class Shop extends Model
|
||||
{
|
||||
// 表名
|
||||
protected $name = 'manystore_shop';
|
||||
|
||||
}
|
|
@ -0,0 +1,110 @@
|
|||
<?php
|
||||
|
||||
namespace app\admin\model\manystore;
|
||||
|
||||
use think\Model;
|
||||
|
||||
|
||||
class ShopLog extends Model
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// 表名
|
||||
protected $name = 'manystore_shop_log';
|
||||
|
||||
// 自动写入时间戳字段
|
||||
protected $autoWriteTimestamp = false;
|
||||
|
||||
// 定义时间戳字段名
|
||||
protected $createTime = false;
|
||||
protected $updateTime = false;
|
||||
protected $deleteTime = false;
|
||||
|
||||
// 追加属性
|
||||
protected $append = [
|
||||
'type_text',
|
||||
'status_text',
|
||||
'auth_time_text',
|
||||
'create_time_text',
|
||||
'update_time_text'
|
||||
];
|
||||
|
||||
|
||||
|
||||
public function getTypeList()
|
||||
{
|
||||
return ['1' => __('Type 1'), '2' => __('Type 2')];
|
||||
}
|
||||
|
||||
public function getStatusList()
|
||||
{
|
||||
return ['0' => __('Status 0'), '1' => __('Status 1'), '2' => __('Status 2')];
|
||||
}
|
||||
|
||||
|
||||
public function getTypeTextAttr($value, $data)
|
||||
{
|
||||
$value = $value ? $value : (isset($data['type']) ? $data['type'] : '');
|
||||
$list = $this->getTypeList();
|
||||
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 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 shop()
|
||||
{
|
||||
return $this->belongsTo('Shop', 'shop_id', 'id', [], 'LEFT')->setEagerlyType(0);
|
||||
}
|
||||
|
||||
|
||||
public function user()
|
||||
{
|
||||
return $this->belongsTo('app\admin\model\User', 'user_id', 'id', [], 'LEFT')->setEagerlyType(0);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,83 @@
|
|||
<?php
|
||||
|
||||
namespace app\admin\model\manystore;
|
||||
|
||||
use think\Model;
|
||||
|
||||
|
||||
class UserAuth extends Model
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// 表名
|
||||
protected $name = 'manystore_user_auth';
|
||||
|
||||
// 自动写入时间戳字段
|
||||
protected $autoWriteTimestamp = 'integer';
|
||||
|
||||
// 定义时间戳字段名
|
||||
protected $createTime = 'createtime';
|
||||
protected $updateTime = false;
|
||||
protected $deleteTime = false;
|
||||
|
||||
// 追加属性
|
||||
protected $append = [
|
||||
'status_text',
|
||||
'auth_time_text',
|
||||
'update_time_text'
|
||||
];
|
||||
|
||||
|
||||
|
||||
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 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 setUpdateTimeAttr($value)
|
||||
{
|
||||
return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
|
||||
}
|
||||
|
||||
|
||||
public function shop()
|
||||
{
|
||||
return $this->belongsTo('Shop', 'shop_id', 'id', [], 'LEFT')->setEagerlyType(0);
|
||||
}
|
||||
|
||||
|
||||
public function user()
|
||||
{
|
||||
return $this->belongsTo('app\admin\model\User', 'user_id', 'id', [], 'LEFT')->setEagerlyType(0);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,119 @@
|
|||
<?php
|
||||
|
||||
namespace app\admin\model\school;
|
||||
|
||||
use think\Model;
|
||||
|
||||
|
||||
class Message extends Model
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// 表名
|
||||
protected $name = 'school_message';
|
||||
|
||||
// 自动写入时间戳字段
|
||||
protected $autoWriteTimestamp = 'integer';
|
||||
|
||||
// 定义时间戳字段名
|
||||
protected $createTime = 'createtime';
|
||||
protected $updateTime = false;
|
||||
protected $deleteTime = false;
|
||||
|
||||
// 追加属性
|
||||
protected $append = [
|
||||
'platform_text',
|
||||
'oper_type_text',
|
||||
'to_type_text',
|
||||
'status_text',
|
||||
'mini_type_text'
|
||||
];
|
||||
|
||||
|
||||
|
||||
public function getPlatformList()
|
||||
{
|
||||
return ['admin' => __('Platform admin'), 'user' => __('Platform user'), 'shop' => __('Platform shop')];
|
||||
}
|
||||
|
||||
public function getOperTypeList()
|
||||
{
|
||||
return ['admin' => __('Oper_type admin'), 'user' => __('Oper_type user'), 'system' => __('Oper_type system'), 'shop' => __('Oper_type shop')];
|
||||
}
|
||||
|
||||
public function getToTypeList()
|
||||
{
|
||||
return ['admin' => __('To_type admin'), 'user' => __('To_type user'), 'system' => __('To_type system'), 'shop' => __('To_type shop')];
|
||||
}
|
||||
|
||||
public function getStatusList()
|
||||
{
|
||||
return ['system' => __('Status system'), 'classes' => __('Status classes'), 'order' => __('Status order')];
|
||||
}
|
||||
|
||||
public function getMiniTypeList()
|
||||
{
|
||||
return ['order_notice' => __('Mini_type order_notice'), 'classes_auth' => __('Mini_type classes_auth'), 'classes_apply' => __('Mini_type classes_apply'), 'shop_apply' => __('Mini_type shop_apply'), 'classes_order_notice' => __('Mini_type classes_order_notice'), 'user_auth' => __('Mini_type user_auth'), 'aftercare' => __('Mini_type aftercare'), 'other' => __('Mini_type other')];
|
||||
}
|
||||
|
||||
|
||||
public function getPlatformTextAttr($value, $data)
|
||||
{
|
||||
$value = $value ?: ($data['platform'] ?? '');
|
||||
$valueArr = explode(',', $value);
|
||||
$list = $this->getPlatformList();
|
||||
return implode(',', array_intersect_key($list, array_flip($valueArr)));
|
||||
}
|
||||
|
||||
|
||||
public function getOperTypeTextAttr($value, $data)
|
||||
{
|
||||
$value = $value ? $value : (isset($data['oper_type']) ? $data['oper_type'] : '');
|
||||
$list = $this->getOperTypeList();
|
||||
return isset($list[$value]) ? $list[$value] : '';
|
||||
}
|
||||
|
||||
|
||||
public function getToTypeTextAttr($value, $data)
|
||||
{
|
||||
$value = $value ? $value : (isset($data['to_type']) ? $data['to_type'] : '');
|
||||
$list = $this->getToTypeList();
|
||||
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 getMiniTypeTextAttr($value, $data)
|
||||
{
|
||||
$value = $value ? $value : (isset($data['mini_type']) ? $data['mini_type'] : '');
|
||||
$list = $this->getMiniTypeList();
|
||||
return isset($list[$value]) ? $list[$value] : '';
|
||||
}
|
||||
|
||||
protected function setPlatformAttr($value)
|
||||
{
|
||||
return is_array($value) ? implode(',', $value) : $value;
|
||||
}
|
||||
|
||||
|
||||
public function admin()
|
||||
{
|
||||
return $this->belongsTo('app\admin\model\Admin', 'oper_id', 'id', [], 'LEFT')->setEagerlyType(0);
|
||||
}
|
||||
|
||||
|
||||
public function user()
|
||||
{
|
||||
return $this->belongsTo('app\admin\model\User', 'to_id', 'id', [], 'LEFT')->setEagerlyType(0);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,27 @@
|
|||
<?php
|
||||
|
||||
namespace app\admin\validate\manystore;
|
||||
|
||||
use think\Validate;
|
||||
|
||||
class ShopLog extends Validate
|
||||
{
|
||||
/**
|
||||
* 验证规则
|
||||
*/
|
||||
protected $rule = [
|
||||
];
|
||||
/**
|
||||
* 提示消息
|
||||
*/
|
||||
protected $message = [
|
||||
];
|
||||
/**
|
||||
* 验证场景
|
||||
*/
|
||||
protected $scene = [
|
||||
'add' => [],
|
||||
'edit' => [],
|
||||
];
|
||||
|
||||
}
|
|
@ -0,0 +1,27 @@
|
|||
<?php
|
||||
|
||||
namespace app\admin\validate\manystore;
|
||||
|
||||
use think\Validate;
|
||||
|
||||
class UserAuth extends Validate
|
||||
{
|
||||
/**
|
||||
* 验证规则
|
||||
*/
|
||||
protected $rule = [
|
||||
];
|
||||
/**
|
||||
* 提示消息
|
||||
*/
|
||||
protected $message = [
|
||||
];
|
||||
/**
|
||||
* 验证场景
|
||||
*/
|
||||
protected $scene = [
|
||||
'add' => [],
|
||||
'edit' => [],
|
||||
];
|
||||
|
||||
}
|
|
@ -0,0 +1,27 @@
|
|||
<?php
|
||||
|
||||
namespace app\admin\validate\school;
|
||||
|
||||
use think\Validate;
|
||||
|
||||
class Message extends Validate
|
||||
{
|
||||
/**
|
||||
* 验证规则
|
||||
*/
|
||||
protected $rule = [
|
||||
];
|
||||
/**
|
||||
* 提示消息
|
||||
*/
|
||||
protected $message = [
|
||||
];
|
||||
/**
|
||||
* 验证场景
|
||||
*/
|
||||
protected $scene = [
|
||||
'add' => [],
|
||||
'edit' => [],
|
||||
];
|
||||
|
||||
}
|
|
@ -0,0 +1,223 @@
|
|||
<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">{:__('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="">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('User_id')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<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">{:__('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" 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" 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" 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" 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" 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" 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" 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" 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" 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" 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" 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" 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">{:__('Front_idcard_image')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<div class="input-group">
|
||||
<input id="c-front_idcard_image" class="form-control" size="50" name="row[front_idcard_image]" type="text">
|
||||
<div class="input-group-addon no-border no-padding">
|
||||
<span><button type="button" id="faupload-front_idcard_image" class="btn btn-danger faupload" data-input-id="c-front_idcard_image" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp,image/webp" data-multiple="false" data-preview-id="p-front_idcard_image"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
|
||||
<span><button type="button" id="fachoose-front_idcard_image" class="btn btn-primary fachoose" data-input-id="c-front_idcard_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-front_idcard_image"></span>
|
||||
</div>
|
||||
<ul class="row list-inline faupload-preview" id="p-front_idcard_image"></ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Reverse_idcard_image')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<div class="input-group">
|
||||
<input id="c-reverse_idcard_image" class="form-control" size="50" name="row[reverse_idcard_image]" type="text">
|
||||
<div class="input-group-addon no-border no-padding">
|
||||
<span><button type="button" id="faupload-reverse_idcard_image" class="btn btn-danger faupload" data-input-id="c-reverse_idcard_image" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp,image/webp" data-multiple="false" data-preview-id="p-reverse_idcard_image"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
|
||||
<span><button type="button" id="fachoose-reverse_idcard_image" class="btn btn-primary fachoose" data-input-id="c-reverse_idcard_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-reverse_idcard_image"></span>
|
||||
</div>
|
||||
<ul class="row list-inline faupload-preview" id="p-reverse_idcard_image"></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">{:__('Type')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
|
||||
<select id="c-type" data-rule="required" class="form-control selectpicker" name="row[type]">
|
||||
{foreach name="typeList" item="vo"}
|
||||
<option value="{$key}" {in name="key" value="2"}selected{/in}>{$vo}</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Desc')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-desc" class="form-control" name="row[desc]" type="text" value="">
|
||||
</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>
|
|
@ -0,0 +1,223 @@
|
|||
<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">{:__('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}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('User_id')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<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">{:__('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" 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" 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" 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" 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" 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" 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" 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" 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" 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" 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" 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" 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">{:__('Front_idcard_image')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<div class="input-group">
|
||||
<input id="c-front_idcard_image" class="form-control" size="50" name="row[front_idcard_image]" type="text" value="{$row.front_idcard_image|htmlentities}">
|
||||
<div class="input-group-addon no-border no-padding">
|
||||
<span><button type="button" id="faupload-front_idcard_image" class="btn btn-danger faupload" data-input-id="c-front_idcard_image" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp,image/webp" data-multiple="false" data-preview-id="p-front_idcard_image"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
|
||||
<span><button type="button" id="fachoose-front_idcard_image" class="btn btn-primary fachoose" data-input-id="c-front_idcard_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-front_idcard_image"></span>
|
||||
</div>
|
||||
<ul class="row list-inline faupload-preview" id="p-front_idcard_image"></ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Reverse_idcard_image')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<div class="input-group">
|
||||
<input id="c-reverse_idcard_image" class="form-control" size="50" name="row[reverse_idcard_image]" type="text" value="{$row.reverse_idcard_image|htmlentities}">
|
||||
<div class="input-group-addon no-border no-padding">
|
||||
<span><button type="button" id="faupload-reverse_idcard_image" class="btn btn-danger faupload" data-input-id="c-reverse_idcard_image" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp,image/webp" data-multiple="false" data-preview-id="p-reverse_idcard_image"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
|
||||
<span><button type="button" id="fachoose-reverse_idcard_image" class="btn btn-primary fachoose" data-input-id="c-reverse_idcard_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-reverse_idcard_image"></span>
|
||||
</div>
|
||||
<ul class="row list-inline faupload-preview" id="p-reverse_idcard_image"></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">{:__('Type')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
|
||||
<select id="c-type" data-rule="required" class="form-control selectpicker" name="row[type]">
|
||||
{foreach name="typeList" item="vo"}
|
||||
<option value="{$key}" {in name="key" value="$row.type"}selected{/in}>{$vo}</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Desc')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-desc" class="form-control" name="row[desc]" type="text" value="{$row.desc|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">
|
||||
|
||||
<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>
|
|
@ -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('manystore/shop_log/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('manystore/shop_log/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('manystore/shop_log/del')?'':'hide'}" title="{:__('Delete')}" ><i class="fa fa-trash"></i> {:__('Delete')}</a>
|
||||
|
||||
|
||||
<div class="dropdown btn-group {:$auth->check('manystore/shop_log/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('manystore/shop_log/edit')}"
|
||||
data-operate-del="{:$auth->check('manystore/shop_log/del')}"
|
||||
width="100%">
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
|
@ -0,0 +1,45 @@
|
|||
<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">{:__('Shop_id')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<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">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('User_id')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-user_id" data-rule="required" data-source="user/user/index" data-field="mobile" data-format-item="{id} - {nickname} - {mobile}" 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">{:__('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">{:__('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">{:__('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>
|
|
@ -0,0 +1,45 @@
|
|||
<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">{:__('Shop_id')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<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">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('User_id')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-user_id" data-rule="required" data-source="user/user/index" data-field="mobile" data-format-item="{id} - {nickname} - {mobile}" 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">{:__('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">{:__('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">{:__('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>
|
|
@ -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('manystore/user_auth/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('manystore/user_auth/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('manystore/user_auth/del')?'':'hide'}" title="{:__('Delete')}" ><i class="fa fa-trash"></i> {:__('Delete')}</a>
|
||||
|
||||
|
||||
<div class="dropdown btn-group {:$auth->check('manystore/user_auth/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('manystore/user_auth/edit')}"
|
||||
data-operate-del="{:$auth->check('manystore/user_auth/del')}"
|
||||
width="100%">
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
|
@ -15,7 +15,7 @@
|
|||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('User_id')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-user_id" data-rule="required" data-source="user/user/index" data-field="id" data-format-item="{id} - {nickname} - {mobile}" class="form-control selectpage" name="row[user_id]" type="text" value="">
|
||||
<input id="c-user_id" data-rule="required" data-source="user/user/index" data-field="mobile" data-format-item="{id} - {nickname} - {mobile}" class="form-control selectpage" name="row[user_id]" type="text" value="">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('User_id')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-user_id" data-rule="required" data-source="user/user/index" data-field="id" data-format-item="{id} - {nickname} - {mobile}" class="form-control selectpage" name="row[user_id]" type="text" value="{$row.user_id|htmlentities}">
|
||||
<input id="c-user_id" data-rule="required" data-source="user/user/index" data-field="mobile" data-format-item="{id} - {nickname} - {mobile}" class="form-control selectpage" name="row[user_id]" type="text" value="{$row.user_id|htmlentities}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
|
|
|
@ -0,0 +1,99 @@
|
|||
<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">{:__('Platform')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
|
||||
<select id="c-platform" class="form-control selectpicker" multiple="" name="row[platform][]">
|
||||
{foreach name="platformList" item="vo"}
|
||||
<option value="{$key}" {in name="key" value=""}selected{/in}>{$vo}</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Oper_type')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
|
||||
<select id="c-oper_type" data-rule="required" class="form-control selectpicker" name="row[oper_type]">
|
||||
{foreach name="operTypeList" item="vo"}
|
||||
<option value="{$key}" {in name="key" value="system"}selected{/in}>{$vo}</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Oper_id')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-oper_id" data-rule="required" class="form-control" name="row[oper_id]" type="text" value="">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('To_type')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
|
||||
<select id="c-to_type" data-rule="required" class="form-control selectpicker" name="row[to_type]">
|
||||
{foreach name="toTypeList" item="vo"}
|
||||
<option value="{$key}" {in name="key" value="system"}selected{/in}>{$vo}</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('To_id')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-to_id" data-rule="required" class="form-control" name="row[to_id]" type="text" value="">
|
||||
</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="system"}checked{/in} /> {$vo}</label>
|
||||
{/foreach}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Mini_type')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
|
||||
<select id="c-mini_type" data-rule="required" class="form-control selectpicker" name="row[mini_type]">
|
||||
{foreach name="miniTypeList" item="vo"}
|
||||
<option value="{$key}" {in name="key" value="other"}selected{/in}>{$vo}</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
|
||||
</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">
|
||||
<input id="c-title" data-rule="required" class="form-control" name="row[title]" type="text">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Desc')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-desc" data-rule="required" class="form-control" name="row[desc]" type="text">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Params')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-params" class="form-control" name="row[params]" type="text">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group layer-footer">
|
||||
<label class="control-label col-xs-12 col-sm-2"></label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<button type="submit" class="btn btn-primary btn-embossed disabled">{:__('OK')}</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
|
@ -0,0 +1,99 @@
|
|||
<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">{:__('Platform')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
|
||||
<select id="c-platform" class="form-control selectpicker" multiple="" name="row[platform][]">
|
||||
{foreach name="platformList" item="vo"}
|
||||
<option value="{$key}" {in name="key" value="$row.platform"}selected{/in}>{$vo}</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Oper_type')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
|
||||
<select id="c-oper_type" data-rule="required" class="form-control selectpicker" name="row[oper_type]">
|
||||
{foreach name="operTypeList" item="vo"}
|
||||
<option value="{$key}" {in name="key" value="$row.oper_type"}selected{/in}>{$vo}</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Oper_id')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-oper_id" data-rule="required" class="form-control" name="row[oper_id]" type="text" value="{$row.oper_id|htmlentities}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('To_type')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
|
||||
<select id="c-to_type" data-rule="required" class="form-control selectpicker" name="row[to_type]">
|
||||
{foreach name="toTypeList" item="vo"}
|
||||
<option value="{$key}" {in name="key" value="$row.to_type"}selected{/in}>{$vo}</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('To_id')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-to_id" data-rule="required" class="form-control" name="row[to_id]" type="text" value="{$row.to_id|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">
|
||||
|
||||
<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">{:__('Mini_type')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
|
||||
<select id="c-mini_type" data-rule="required" class="form-control selectpicker" name="row[mini_type]">
|
||||
{foreach name="miniTypeList" item="vo"}
|
||||
<option value="{$key}" {in name="key" value="$row.mini_type"}selected{/in}>{$vo}</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
|
||||
</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">
|
||||
<input id="c-title" data-rule="required" class="form-control" name="row[title]" type="text" value="{$row.title|htmlentities}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Desc')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-desc" data-rule="required" class="form-control" name="row[desc]" type="text" value="{$row.desc|htmlentities}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Params')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-params" class="form-control" name="row[params]" type="text" value="{$row.params|htmlentities}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group layer-footer">
|
||||
<label class="control-label col-xs-12 col-sm-2"></label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<button type="submit" class="btn btn-primary btn-embossed disabled">{:__('OK')}</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
|
@ -0,0 +1,46 @@
|
|||
<div class="panel panel-default panel-intro">
|
||||
|
||||
<div class="panel-heading">
|
||||
{:build_heading(null,FALSE)}
|
||||
<ul class="nav nav-tabs" data-field="status">
|
||||
<li class="{:$Think.get.status === null ? 'active' : ''}"><a href="#t-all" data-value="" data-toggle="tab">{:__('All')}</a></li>
|
||||
{foreach name="statusList" item="vo"}
|
||||
<li class="{:$Think.get.status === (string)$key ? 'active' : ''}"><a href="#t-{$key}" data-value="{$key}" data-toggle="tab">{$vo}</a></li>
|
||||
{/foreach}
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="panel-body">
|
||||
<div id="myTabContent" class="tab-content">
|
||||
<div class="tab-pane fade active in" id="one">
|
||||
<div class="widget-body no-padding">
|
||||
<div id="toolbar" class="toolbar">
|
||||
<a href="javascript:;" class="btn btn-primary btn-refresh" title="{:__('Refresh')}" ><i class="fa fa-refresh"></i> </a>
|
||||
<a href="javascript:;" class="btn btn-success btn-add {:$auth->check('school/message/add')?'':'hide'}" title="{:__('Add')}" ><i class="fa fa-plus"></i> {:__('Add')}</a>
|
||||
<a href="javascript:;" class="btn btn-success btn-edit btn-disabled disabled {:$auth->check('school/message/edit')?'':'hide'}" title="{:__('Edit')}" ><i class="fa fa-pencil"></i> {:__('Edit')}</a>
|
||||
<a href="javascript:;" class="btn btn-danger btn-del btn-disabled disabled {:$auth->check('school/message/del')?'':'hide'}" title="{:__('Delete')}" ><i class="fa fa-trash"></i> {:__('Delete')}</a>
|
||||
|
||||
|
||||
<div class="dropdown btn-group {:$auth->check('school/message/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('school/message/edit')}"
|
||||
data-operate-del="{:$auth->check('school/message/del')}"
|
||||
width="100%">
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
|
@ -6,6 +6,7 @@ use addons\xilufitness\services\login\LoginService;
|
|||
use app\common\controller\Api;
|
||||
use app\common\library\Ems;
|
||||
use app\common\library\Sms;
|
||||
use app\common\model\dyqc\ManystoreShop;
|
||||
use fast\Random;
|
||||
use think\Cache;
|
||||
use think\Config;
|
||||
|
@ -164,6 +165,8 @@ class User extends Api
|
|||
//是否有核销按钮展示权
|
||||
$data['have_auth'] = \app\common\model\User::verificationAuth($this->auth->id);
|
||||
$data['have_teacher'] = \app\common\model\User::teacherAuth($this->auth->id);
|
||||
//机构认证信息
|
||||
$data['shop_auth_info'] = ManystoreShop::getAuthInfo($this->auth->id);
|
||||
|
||||
$data['user_info']["avatar"] = $data['user_info']["avatar"]? cdnurl($data['user_info']["avatar"],true):$data['user_info']["avatar"];
|
||||
$this->success('调用成功',$data);
|
||||
|
|
|
@ -2,7 +2,10 @@
|
|||
|
||||
namespace app\api\controller\school;
|
||||
|
||||
use app\common\model\school\classes\Cate;
|
||||
use app\common\model\school\classes\ClassesLib;
|
||||
use app\common\model\school\classes\Label;
|
||||
use app\common\model\school\SearchCity;
|
||||
use think\Cache;
|
||||
use think\Log;
|
||||
|
||||
|
@ -11,7 +14,7 @@ use think\Log;
|
|||
*/
|
||||
class Classes extends Base
|
||||
{
|
||||
protected $noNeedLogin = ["detail",'people','spec'];
|
||||
protected $noNeedLogin = ["detail",'people','spec','label_list','cate_list',"index","classes_list"];
|
||||
protected $noNeedRight = '*';
|
||||
|
||||
protected $model = null;
|
||||
|
@ -29,8 +32,42 @@ class Classes extends Base
|
|||
//判断登录用户是否是员工
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @ApiTitle(课程查询参数接口)
|
||||
* @ApiSummary(课程查询参数接口)
|
||||
* @ApiRoute(/api/school/classes/index)
|
||||
* @ApiMethod(GET)
|
||||
* @ApiReturn({
|
||||
|
||||
*
|
||||
*})
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
//距离查询参数
|
||||
//展示的城市
|
||||
//展示的查询距离
|
||||
$distance_config = config("site.search_distance_list");
|
||||
$distance_config_data = [];
|
||||
foreach ($distance_config as $k=>$v){
|
||||
//组成类似sql二维数组
|
||||
$distance_config_data[] = ['distance'=>$k,'distance_name'=>$v];
|
||||
|
||||
}
|
||||
|
||||
$distance_city = SearchCity::order("id desc")->select();
|
||||
foreach ($distance_city as $k=>&$v){
|
||||
//字符串按斜杠分割后,取数值最后一个元素(切记:分割后数组长度不是等长)
|
||||
$v["address_city"] = explode("/",$v["address_city"]);
|
||||
$v["address_city"] = $v["address_city"][count($v["address_city"])-1];
|
||||
}
|
||||
|
||||
$cate = Cate::showList(1, 20,"","-1");
|
||||
|
||||
$label = Label::showList(1, 20,"");
|
||||
|
||||
$this->success('获取成功', compact('distance_config_data',"distance_city","cate" ,"label" ));
|
||||
}
|
||||
|
||||
|
||||
|
@ -116,4 +153,171 @@ class Classes extends Base
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* @ApiTitle( 课程分类列表)
|
||||
* @ApiSummary(课程分类列表)
|
||||
* @ApiRoute(/api/school/classes/cate_list)
|
||||
* @ApiMethod(GET)
|
||||
* @ApiParams(name = "keywords", type = "string",required=false,description = "搜索关键字")
|
||||
* @ApiParams(name = "page", type = "string",required=true,description = "页数")
|
||||
* @ApiParams(name = "limit", type = "string",required=true,description = "条数")
|
||||
* @ApiParams(name = "hot", type = "string",required=false,description = "状态搜索条件:-1=全部分类,0=非热门分类,1=热门分类")
|
||||
* @ApiReturn({
|
||||
*
|
||||
*})
|
||||
*/
|
||||
public function cate_list()
|
||||
{
|
||||
$user_id = 0;
|
||||
$user = $this->auth->getUser();//登录用户
|
||||
if($user)$user_id = $user['id'];
|
||||
$page = $this->request->get('page/d', 0); //页数
|
||||
$limit = $this->request->get('limit/d', 0); //条数
|
||||
$keywords = $this->request->get('keywords/s', ''); //搜索关键字
|
||||
$hot = $this->request->get('hot/s', '-1'); //搜索关键字
|
||||
// $type = $this->request->get('type/s', ''); //筛选学员和教练单
|
||||
|
||||
try{
|
||||
//当前申请状态
|
||||
$res = Cate::showList($page, $limit,$keywords,$hot);
|
||||
// if($user_id =='670153'){
|
||||
// file_put_contents("ceshi66.txt",(new AppointmentOrder())->getLastSql());
|
||||
// }
|
||||
}catch (\Exception $e){
|
||||
|
||||
$this->error($e->getMessage());
|
||||
}
|
||||
$this->success('查询成功', $res);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @ApiTitle( 课程标签列表)
|
||||
* @ApiSummary(课程标签列表)
|
||||
* @ApiRoute(/api/school/classes/label_list)
|
||||
* @ApiMethod(GET)
|
||||
* @ApiParams(name = "keywords", type = "string",required=false,description = "搜索关键字")
|
||||
* @ApiParams(name = "page", type = "string",required=true,description = "页数")
|
||||
* @ApiParams(name = "limit", type = "string",required=true,description = "条数")
|
||||
* @ApiReturn({
|
||||
*
|
||||
*})
|
||||
*/
|
||||
public function label_list()
|
||||
{
|
||||
$user_id = 0;
|
||||
$user = $this->auth->getUser();//登录用户
|
||||
if($user)$user_id = $user['id'];
|
||||
$page = $this->request->get('page/d', 0); //页数
|
||||
$limit = $this->request->get('limit/d', 0); //条数
|
||||
$keywords = $this->request->get('keywords/s', ''); //搜索关键字
|
||||
// $type = $this->request->get('type/s', ''); //筛选学员和教练单
|
||||
|
||||
try{
|
||||
//当前申请状态
|
||||
$res = Label::showList($page, $limit,$keywords);
|
||||
// if($user_id =='670153'){
|
||||
// file_put_contents("ceshi66.txt",(new AppointmentOrder())->getLastSql());
|
||||
// }
|
||||
}catch (\Exception $e){
|
||||
|
||||
$this->error($e->getMessage());
|
||||
}
|
||||
$this->success('查询成功', $res);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @ApiTitle( 通用课程大索索列表)
|
||||
* @ApiSummary(通用课程大索索列表)
|
||||
* @ApiRoute(/api/school/classes/classes_list)
|
||||
* @ApiMethod(GET)
|
||||
* @ApiParams(name = "keywords", type = "string",required=false,description = "搜索关键字")
|
||||
* @ApiParams(name = "page", type = "string",required=true,description = "页数")
|
||||
* @ApiParams(name = "limit", type = "string",required=true,description = "条数")
|
||||
* @ApiParams(name = "user_id", type = "int",required=false,description = "主讲师用户id")
|
||||
* @ApiParams(name = "shop_id", type = "int",required=false,description = "机构店铺id")
|
||||
* @ApiParams(name = "teacher_id", type = "int",required=false,description = "老师id")
|
||||
* @ApiParams(name = "classes_cate_ids", type = "string",required=false,description = "平台课程分类ids")
|
||||
* @ApiParams(name = "classes_label_ids", type = "string",required=false,description = "平台课程热门标签ids")
|
||||
* @ApiParams(name = "self_label_tag", type = "string",required=false,description = "机构特色标签")
|
||||
* @ApiParams(name = "keyword", type = "string",required=false,description = "关键字搜索")
|
||||
* @ApiParams(name = "type", type = "string",required=false,description = "地点类型:out=户外,in=室内")
|
||||
* @ApiParams(name = "address_type", type = "string",required=false,description = "地址类型:1=按机构,2=独立位置")
|
||||
* @ApiParams(name = "province", type = "string",required=false,description = "省编号")
|
||||
* @ApiParams(name = "city", type = "string",required=false,description = "市编号")
|
||||
* @ApiParams(name = "district", type = "string",required=false,description = "县区编号")
|
||||
* @ApiParams(name = "status", type = "string",required=false,description = "不传则默认查上架的 状态: 1=上架,2=下架,3=平台下架")
|
||||
* @ApiParams(name = "recommend", type = "string",required=false,description = "平台推荐:0=否,1=是")
|
||||
* @ApiParams(name = "hot", type = "string",required=false,description = "平台热门:0=否,1=是")
|
||||
* @ApiParams(name = "new", type = "string",required=false,description = "平台最新:0=否,1=是")
|
||||
* @ApiParams(name = "selfhot", type = "string",required=false,description = "机构热门:0=否,1=是")
|
||||
* @ApiParams(name = "feel", type = "string",required=false,description = "是否免费:0=否,1=是")
|
||||
* @ApiParams(name = "order", type = "string",required=false,description = " normal=综合排序推薦優先,distance=距离优先,hot=熱門优先,new=平台最新优先,selfhot=机构热门优先,sale=銷量优先")
|
||||
* @ApiParams(name = "nearby", type = "string",required=false,description = "限制最大搜索距离(米)")
|
||||
* @ApiParams(name = "latitude", type = "string",required=false,description = "latitude")
|
||||
* @ApiParams(name = "longitude", type = "string",required=false,description = "longitude")
|
||||
* @ApiReturn({
|
||||
*
|
||||
*})
|
||||
*/
|
||||
public function classes_list()
|
||||
{
|
||||
$user_id = 0;
|
||||
$user = $this->auth->getUser();//登录用户
|
||||
if($user)$user_id = $user['id'];
|
||||
$params =[];
|
||||
$params["page"] = $this->request->get('page/d', 1); //页数
|
||||
$params["limit"] = $this->request->get('limit/d', 10); //条数
|
||||
$params["keywords"] = $this->request->get('keywords/s', ''); //搜索关键字
|
||||
$params["user_id"] = $this->request->get('user_id/d', ''); //主讲师用户id
|
||||
$params["shop_id"] = $this->request->get('shop_id/d', ''); //机构店铺id
|
||||
$params["teacher_id"] = $this->request->get('teacher_id/d', ''); //机构店铺id
|
||||
$params["classes_cate_ids"] = $this->request->get('classes_cate_ids/s', ''); //机构店铺id
|
||||
$params["classes_label_ids"] = $this->request->get('classes_label_ids/s', ''); //机构店铺id
|
||||
$params["self_label_tag"] = $this->request->get('self_label_tag/s', ''); //机构店铺id
|
||||
$params["keyword"] = $this->request->get('keyword/s', ''); //机构店铺id
|
||||
$params["type"] = $this->request->get('type/s', ''); //机构店铺id
|
||||
$params["address_type"] = $this->request->get('address_type/s', ''); //机构店铺id
|
||||
$params["province"] = $this->request->get('province/s', ''); //机构店铺id
|
||||
|
||||
$params["city"] = $this->request->get('city/s', ''); //机构店铺id
|
||||
$params["district"] = $this->request->get('district/s', ''); //机构店铺id
|
||||
$params["status"] = $this->request->get('status/s', ''); //机构店铺id
|
||||
$params["recommend"] = $this->request->get('recommend/s', ''); //机构店铺id
|
||||
$params["hot"] = $this->request->get('hot/s', ''); //机构店铺id
|
||||
$params["new"] = $this->request->get('new/s', ''); //机构店铺id
|
||||
$params["selfhot"] = $this->request->get('selfhot/s', ''); //机构店铺id
|
||||
$params["feel"] = $this->request->get('feel/s', ''); //机构店铺id
|
||||
|
||||
$params["order"] = $this->request->get('order/s', ''); //机构店铺id
|
||||
$params["nearby"] = $this->request->get('nearby/s', ''); //机构店铺id
|
||||
|
||||
|
||||
$params["latitude"] = $this->request->get('latitude/s', ''); //机构店铺id
|
||||
$params["longitude"] = $this->request->get('longitude/s', ''); //机构店铺id
|
||||
|
||||
// $type = $this->request->get('type/s', ''); //筛选学员和教练单
|
||||
|
||||
try{
|
||||
//当前申请状态
|
||||
$res = ClassesLib::getVaildList($params);
|
||||
// if($user_id =='670153'){
|
||||
// file_put_contents("ceshi66.txt",(new AppointmentOrder())->getLastSql());
|
||||
// }
|
||||
}catch (\Exception $e){
|
||||
|
||||
$this->error($e->getMessage());
|
||||
}
|
||||
$this->success('查询成功', ["list"=>$res]);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -57,4 +57,108 @@ class Shop extends Base
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
/** 机构申请
|
||||
* @ApiTitle( 机构申请)
|
||||
* @ApiSummary(机构申请)
|
||||
* @ApiRoute(/api/school/shop/shopapply)
|
||||
* @ApiMethod(POST)
|
||||
* @ApiParams(name = "name", type = "string",required=true,description = "机构名称")
|
||||
* @ApiParams(name = "tel", type = "string",required=false,description = "服务电话(非必填)")
|
||||
* @ApiParams(name = "desc", type = "string",required=false,description = "申请备注(非必填)")
|
||||
* @ApiParams(name = "front_idcard_image", type = "string",required=true,description = "法人身份证正面")
|
||||
* @ApiParams(name = "reverse_idcard_image", type = "string",required=true,description = "法人身份证反面")
|
||||
* @ApiParams(name = "images", type = "string",required=true,description = "机构环境照片(多个逗号拼接)")
|
||||
* @ApiParams(name = "yyzz_images", type = "string",required=true,description = "营业执照照片(多个逗号拼接)")
|
||||
* @ApiReturn({
|
||||
*
|
||||
*})
|
||||
*/
|
||||
public function shopapply(){
|
||||
$params=[];
|
||||
$params["name"] = $this->request->post('name/s','');
|
||||
$params["tel"] = $this->request->post('tel/s','');
|
||||
$params["desc"] = $this->request->post('desc/s','');
|
||||
$params["front_idcard_image"] = $this->request->post('front_idcard_image/s','');
|
||||
$params["reverse_idcard_image"] = $this->request->post('reverse_idcard_image/s','');
|
||||
|
||||
$params["images"] = $this->request->post('images/s','');
|
||||
$params["yyzz_images"] = $this->request->post('yyzz_images/s','');
|
||||
|
||||
if(empty($id)){
|
||||
$this->error(__('缺少必要参数'));
|
||||
}
|
||||
$type = "2";
|
||||
$user_id = 0;
|
||||
$user = $this->auth->getUser();//登录用户
|
||||
if($user)$user_id = $user['id'];
|
||||
try {
|
||||
$res = $this->model->apply($type,$user_id,$params,true,true);
|
||||
} catch (\Exception $e){
|
||||
// Log::log($e->getMessage());
|
||||
$this->error($e->getMessage(),['errcode'=>$e->getCode()]);
|
||||
}
|
||||
$this->success('获取成功', ['detail' => $res]);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/** 个人申请
|
||||
* @ApiTitle( 个人申请)
|
||||
* @ApiSummary(个人申请)
|
||||
* @ApiRoute(/api/school/shop/userapply)
|
||||
* @ApiMethod(POST)
|
||||
* @ApiParams(name = "name", type = "string",required=true,description = "姓名")
|
||||
* @ApiParams(name = "tel", type = "string",required=false,description = "服务电话(非必填)")
|
||||
* @ApiParams(name = "desc", type = "string",required=false,description = "申请备注(非必填)")
|
||||
* @ApiParams(name = "front_idcard_image", type = "string",required=true,description = "身份证正面")
|
||||
* @ApiParams(name = "reverse_idcard_image", type = "string",required=true,description = "身份证反面")
|
||||
* @ApiReturn({
|
||||
*
|
||||
*})
|
||||
*/
|
||||
public function userapply(){
|
||||
$params=[];
|
||||
$params["name"] = $this->request->post('name/s','');
|
||||
$params["tel"] = $this->request->post('tel/s','');
|
||||
$params["desc"] = $this->request->post('desc/s','');
|
||||
$params["front_idcard_image"] = $this->request->post('front_idcard_image/s','');
|
||||
$params["reverse_idcard_image"] = $this->request->post('reverse_idcard_image/s','');
|
||||
|
||||
// if(empty($id)){
|
||||
// $this->error(__('缺少必要参数'));
|
||||
// }
|
||||
$type = "1";
|
||||
$user_id = 0;
|
||||
$user = $this->auth->getUser();//登录用户
|
||||
if($user)$user_id = $user['id'];
|
||||
try {
|
||||
$res = $this->model->apply($type,$user_id,$params,true,true);
|
||||
} catch (\Exception $e){
|
||||
// Log::log($e->getMessage());
|
||||
$this->error($e->getMessage(),['errcode'=>$e->getCode()]);
|
||||
}
|
||||
$this->success('获取成功', ['detail' => $res]);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @ApiTitle(机构申请状态)
|
||||
* @ApiSummary(机构申请状态)
|
||||
* @ApiRoute(/api/school/shop/auth_info)
|
||||
* @ApiMethod(GET)
|
||||
*/
|
||||
public function auth_info(){
|
||||
|
||||
try {
|
||||
$res = ManystoreShop::getAuthInfo($this->auth->id);
|
||||
} catch (\Exception $e){
|
||||
// Log::log($e->getMessage());
|
||||
$this->error($e->getMessage(),['errcode'=>$e->getCode()]);
|
||||
}
|
||||
$this->success('获取成功', $res);
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -570,3 +570,11 @@ if (!function_exists('de_code')) {
|
|||
return $num;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (!function_exists('getDistanceBuilder')) {
|
||||
function getDistanceBuilder($lat, $lng) {
|
||||
return "ROUND(6378.138 * 2 * ASIN(SQRT(POW(SIN((". matchLatLng($lat) . " * PI() / 180 - latitude * PI() / 180) / 2), 2) + COS(". matchLatLng($lat). " * PI() / 180) * COS(latitude * PI() / 180) * POW(SIN((". matchLatLng($lng). " * PI() / 180 - longitude * PI() / 180) / 2), 2))) * 1000) AS distance";
|
||||
}
|
||||
}
|
||||
|
|
|
@ -120,6 +120,8 @@ class ManystoreBase extends Controller
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
protected function checkAssemblyParameters(){
|
||||
if(!$this->qSwitch)return false;
|
||||
//得到所有get参数
|
||||
|
|
|
@ -0,0 +1,90 @@
|
|||
<?php
|
||||
//
|
||||
$defaultHooks = [
|
||||
// 订单创建
|
||||
'classes_order_create_before' => [ // 订单创建前
|
||||
'app\\common\\listener\\classesorder\\OrderHook'
|
||||
],
|
||||
'classes_order_create_after' => [ // 订单创建后
|
||||
'app\\common\\listener\\classesorder\\OrderHook'
|
||||
],
|
||||
'classes_order_payed_after' => [ // 订单支付成功
|
||||
'app\\common\\listener\\classesorder\\OrderHook'
|
||||
],
|
||||
'classes_order_cancel_after' => [ // 订单取消后
|
||||
'addons\\shopro\\listener\\classesorder\\OrderHook'
|
||||
],
|
||||
|
||||
'classes_order_finish_after' => [ // 订单完成后
|
||||
'app\\common\\listener\\classesorder\\OrderHook'
|
||||
],
|
||||
|
||||
//
|
||||
// app\common\listener\classesorder
|
||||
|
||||
// 订单取消
|
||||
// 'order_cancel_before' => [ // 订单取消前
|
||||
// ],
|
||||
// 'order_cancel_after' => [ // 订单取消后
|
||||
// 'addons\\shopro\\listener\\order\\Invalid'
|
||||
// ],
|
||||
|
||||
];
|
||||
|
||||
|
||||
//课时订单事件钩子
|
||||
$hourHooks = [
|
||||
// 订单创建
|
||||
'classeshour_order_create_before' => [ // 订单创建前
|
||||
'app\\common\\listener\\classeshourorder\\OrderHook'
|
||||
],
|
||||
'classeshour_order_create_after' => [ // 订单创建后
|
||||
'app\\common\\listener\\classeshourorder\\OrderHook'
|
||||
],
|
||||
'classeshour_order_update_after' => [ // 订单变更课时后
|
||||
'app\\common\\listener\\classeshourorder\\OrderHook'
|
||||
],
|
||||
'classeshour_order_auth_success_after' => [ // 订单审核通过后
|
||||
'app\\common\\listener\\classeshourorder\\OrderHook'
|
||||
],
|
||||
'classeshour_order_auth_fail_after' => [ // 订单审核失败后
|
||||
'app\\common\\listener\\classeshourorder\\OrderHook'
|
||||
],
|
||||
'classeshour_order_finish_after' => [ // 订单核销完成后
|
||||
'app\\common\\listener\\classeshourorder\\OrderHook'
|
||||
],
|
||||
'classeshour_order_cancel_after' => [ // 订单取消后
|
||||
'addons\\shopro\\listener\\classeshourorder\\OrderHook'
|
||||
],
|
||||
];
|
||||
|
||||
|
||||
|
||||
//机构审核事件钩子
|
||||
$manystoreHooks = [
|
||||
// 订单创建
|
||||
'shop_create_after' => [ // 机构账号创建成功后(审核之前)
|
||||
'app\\common\\listener\\manystore\\ShopHook'
|
||||
],
|
||||
'shop_apply_after' => [ // 机构账号提交审核申请后
|
||||
'app\\common\\listener\\manystore\\ShopHook'
|
||||
],
|
||||
'shop_auth_success_after' => [ // 机构审核通过后
|
||||
'app\\common\\listener\\manystore\\ShopHook'
|
||||
],
|
||||
'shop_auth_fail_after' => [ // 机构审核失败后
|
||||
'app\\common\\listener\\manystore\\ShopHook'
|
||||
],
|
||||
];
|
||||
|
||||
|
||||
|
||||
|
||||
//
|
||||
//if (file_exists(ROOT_PATH . 'addons/shopro/listener/commission')) {
|
||||
// $defaultHooks = array_merge_recursive($defaultHooks, $commissionHooks);
|
||||
//}
|
||||
$defaultHooks = array_merge_recursive($defaultHooks, $hourHooks);
|
||||
$defaultHooks = array_merge_recursive($defaultHooks, $manystoreHooks);
|
||||
|
||||
return $defaultHooks;
|
|
@ -17,12 +17,35 @@ class OrderHook
|
|||
}
|
||||
|
||||
|
||||
// 订单变更课时后
|
||||
public function classeshourOrderUpdateAfter(&$params)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// 订单审核通过后
|
||||
public function classeshourOrderAuthSuccessAfter(&$params)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
// 订单审核失败后
|
||||
public function classeshourOrderAuthFailAfter(&$params)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
// 订单核销完成后
|
||||
public function classeshourOrderFinishAfter(&$params)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
// // 订单支付成功后
|
||||
// public function classeshourOrderPayedAfter(&$params)
|
||||
// {
|
||||
//
|
||||
// }
|
||||
|
||||
// 订单取消成功后
|
||||
public function classeshourOrderCancelAfter(&$params)
|
||||
|
|
|
@ -30,5 +30,11 @@ class OrderHook
|
|||
|
||||
}
|
||||
|
||||
// 订单完成后
|
||||
public function classesOrderFinishAfter(&$params)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,36 @@
|
|||
<?php
|
||||
namespace app\common\listener\manystore;
|
||||
class ShopHook
|
||||
{
|
||||
|
||||
|
||||
// 机构账号创建成功后(审核之前)
|
||||
public function shopCreateAfter(&$params)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
// 机构账号提交审核申请后
|
||||
public function shopApplyAfter(&$params)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
// 机构账号审核成功后
|
||||
public function shopAuthSuccessAfter(&$params)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
// 机构账号审核失败后
|
||||
public function shopAuthFailAfter(&$params)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -6,6 +6,11 @@ use app\common\model\BaseModel;
|
|||
use app\common\model\school\classes\ClassesLib;
|
||||
use app\common\model\school\classes\Teacher;
|
||||
use app\common\model\User;
|
||||
use app\manystore\model\Manystore;
|
||||
use app\manystore\model\ManystoreAuthGroup;
|
||||
use app\manystore\model\ManystoreAuthGroupAccess;
|
||||
use fast\Random;
|
||||
use think\Cache;
|
||||
use think\Model;
|
||||
|
||||
|
||||
|
@ -35,6 +40,16 @@ class ManystoreShop extends BaseModel
|
|||
'update_time_text'
|
||||
];
|
||||
|
||||
// 拼音对象
|
||||
protected static $pinyin = null;
|
||||
|
||||
protected static function init()
|
||||
{
|
||||
self::$pinyin = new \Overtrue\Pinyin\Pinyin('Overtrue\Pinyin\MemoryFileDictLoader');
|
||||
|
||||
}
|
||||
|
||||
|
||||
/** 专家团队
|
||||
* @return \think\model\relation\HasMany
|
||||
*/
|
||||
|
@ -192,7 +207,7 @@ class ManystoreShop extends BaseModel
|
|||
* @return bool
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function apply($type,$user_id=0,$params=[],$check=false,$oper_type='user',$oper_id=0,$trans=false){
|
||||
public function apply($type,$user_id=0,$params=[],$check=false,$trans=false){
|
||||
|
||||
if($check){
|
||||
$user = User::get($user_id);
|
||||
|
@ -255,10 +270,7 @@ class ManystoreShop extends BaseModel
|
|||
}
|
||||
$params["type"] = $type;
|
||||
|
||||
//得到申请单(没有则创建)
|
||||
$shop = ManystoreShop::where( 'user_id',$user_id)->where("status","1")->find();
|
||||
//如果存在申请单,则直接更新这个单的状态
|
||||
//如果不存在则创建一个新单
|
||||
|
||||
|
||||
// $order = self::getHaveCancelOrder($order_no);
|
||||
|
||||
|
@ -269,21 +281,24 @@ class ManystoreShop extends BaseModel
|
|||
$res = true;
|
||||
try{
|
||||
//事务逻辑
|
||||
// //更新订单取消状态
|
||||
// $order = Order::updateCancel($order);
|
||||
// //插入订单取消日志
|
||||
// if(!$user_id ||$order["user_id"] !=$user_id ){
|
||||
// OrderLog::log($order['id'],"[员工代操作]课时预约单取消成功,课时已原路退回",$oper_type ?: 'user', $oper_id ?: $order['user_id']);
|
||||
// }else{
|
||||
// OrderLog::log($order['id'],"课时预约单取消成功,课时已原路退回",$oper_type ?: 'user', $oper_id ?: $order['user_id']);
|
||||
// }
|
||||
//
|
||||
// //调用订单取消事件
|
||||
// $data = ['order' => $order];
|
||||
// \think\Hook::listen('classeshour_order_cancel_after', $data);
|
||||
// //执行课时数更新
|
||||
// $res1 = \app\common\model\school\classes\order\Order::statisticsAndUpdateClassesNumber($order['classes_order_id']);
|
||||
|
||||
//得到申请单(没有则创建)
|
||||
$shop = ManystoreShop::where( 'user_id',$user_id)->find();
|
||||
//如果存在申请单,则直接更新这个单的状态
|
||||
//如果不存在则创建一个新单
|
||||
if(!$shop){
|
||||
//创建申请单
|
||||
$shop = $this->creatShop($type,$user_id,$params);
|
||||
}
|
||||
//更新申请单状态为审核中
|
||||
$shop['status']= '0';
|
||||
//清空审核时间
|
||||
$shop['reason']= '';
|
||||
$shop['auth_time']= 0;
|
||||
$shop["admin_id"] = 0;
|
||||
$shop->save();
|
||||
//调用订单事件
|
||||
$data = ['shop' => $shop];
|
||||
\think\Hook::listen('shop_apply_after', $data);
|
||||
|
||||
if($trans){
|
||||
self::commitTrans();
|
||||
|
@ -297,6 +312,169 @@ class ManystoreShop extends BaseModel
|
|||
return $res;
|
||||
}
|
||||
|
||||
/** 机构后台默认密码获取
|
||||
* @param $type
|
||||
* @param $user_id
|
||||
* @param $params
|
||||
*
|
||||
* @throws \think\exception\DbException
|
||||
*/
|
||||
public function getDefaultPassword($type,$user_id,$params){
|
||||
$user = User::get($user_id);
|
||||
$defaultPassword = null;
|
||||
switch ($type) {
|
||||
case '1': //个人
|
||||
//手机号 + 个人id生成的code
|
||||
$defaultPassword = $user["mobile"].en_code($user['id']);
|
||||
// $rule = [
|
||||
// 'name' => 'require',
|
||||
// 'tel' => 'require|number',
|
||||
//// 'desc' => 'require',
|
||||
// 'front_idcard_image' => 'require',
|
||||
// 'reverse_idcard_image' => 'require',
|
||||
// ];
|
||||
// $rule_msg = [
|
||||
// 'name.require' => '姓名必须填写',
|
||||
// 'tel.require' => '服务电话必须填写',
|
||||
// 'tel.number' => '服务电话必须是数字',
|
||||
//// 'desc.require' => '申请备注必须填写',
|
||||
// 'front_idcard_image.require' => '身份证正面必须上传',
|
||||
// 'reverse_idcard_image.require' => '身份证反面必须上传',
|
||||
// ];
|
||||
break;
|
||||
case '2': //机构
|
||||
$defaultPassword = $user["mobile"].en_code($user['id']);
|
||||
// $rule = [
|
||||
// 'name' => 'require',
|
||||
// 'tel' => 'require|number',
|
||||
//// 'desc' => 'require',
|
||||
// 'front_idcard_image' => 'require',
|
||||
// 'reverse_idcard_image' => 'require',
|
||||
// 'images' => 'require',
|
||||
// 'yyzz_images' => 'require',
|
||||
// ];
|
||||
|
||||
// $rule_msg = [
|
||||
// 'name.require' => '机构名称必须填写',
|
||||
// 'tel.require' => '服务电话必须填写',
|
||||
// 'tel.number' => '服务电话必须是数字',
|
||||
//// 'desc.require' => '申请备注必须填写',
|
||||
// 'front_idcard_image.require' => '法人身份证正面必须上传',
|
||||
// 'reverse_idcard_image.require' => '法人身份证反面必须上传',
|
||||
// 'images.require' => '机构环境照片必须上传',
|
||||
// 'yyzz_images.require' => '营业执照照片必须上传',
|
||||
// ];
|
||||
|
||||
break;
|
||||
}
|
||||
return $defaultPassword;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public function creatShop($type,$user_id,$params){
|
||||
|
||||
|
||||
//商家附表
|
||||
$shop = (new self);
|
||||
$shop_info = $shop->allowField(true)->save($params);
|
||||
if($shop_info === false){
|
||||
throw new \Exception($shop->getError());
|
||||
}
|
||||
//账号主表
|
||||
$manystore_params = [
|
||||
"nickname" => $params["name"],
|
||||
];
|
||||
$manystore_params["username"] = $params["tel"] ?: self::$pinyin->permalink($manystore_params["nickname"]);
|
||||
$manystore_params["email"] = $manystore_params["username"] . "@xx.com";
|
||||
|
||||
$manystore_params['password'] = self::getDefaultPassword($type,$user_id,$params);
|
||||
|
||||
$manystore_params['shop_id'] = $shop->id;
|
||||
$manystore_params['salt'] = Random::alnum();
|
||||
$manystore_params['password'] = md5(md5($manystore_params['password']) . $manystore_params['salt']);
|
||||
$manystore_params['avatar'] = '/assets/img/avatar.png'; //设置新管理员默认头像。
|
||||
$manystore_params['is_main'] = 1;
|
||||
$model = new Manystore();
|
||||
|
||||
$result = $model->allowField(true)->save($manystore_params);
|
||||
if ($result === false) {
|
||||
throw new \Exception($model->getError());
|
||||
}
|
||||
|
||||
|
||||
$manystoreAuthGroupModel = new ManystoreAuthGroup();
|
||||
$group = [];
|
||||
|
||||
switch ($type) {
|
||||
case '1': //个人
|
||||
$group['name'] = '个人认证类型';
|
||||
$group['rules'] = '*';
|
||||
break;
|
||||
case '2': //机构
|
||||
$group['name'] = '机构认证类型';
|
||||
$group['rules'] = '*';
|
||||
break;
|
||||
}
|
||||
|
||||
$group['shop_id'] = $shop->id;
|
||||
$group['createtime'] = time();
|
||||
$group['updatetime'] = time();
|
||||
$group_id = $manystoreAuthGroupModel->insertGetId($group);
|
||||
if(!$group_id){
|
||||
$this->error('添加失败');
|
||||
}
|
||||
|
||||
$manystoreAuthGroupAccessModel = new ManystoreAuthGroupAccess();
|
||||
$group_access = [];
|
||||
$group_access['uid'] = $model->id;
|
||||
$group_access['group_id'] = $group_id;
|
||||
|
||||
$manystoreAuthGroupAccessModel->insert($group_access);
|
||||
|
||||
|
||||
//调用订单事件
|
||||
$data = ['shop' => $shop];
|
||||
\think\Hook::listen('shop_create_after', $data);
|
||||
|
||||
|
||||
return $shop;
|
||||
}
|
||||
|
||||
|
||||
/** 机耕申请状态查询
|
||||
*
|
||||
*/
|
||||
public static function getAuthInfo($user_id){
|
||||
$auth_status = '-1'; //-1=未申请,0=待审核,1=审核通过,2=审核失败
|
||||
$shop_id = 0;
|
||||
$type = '1';
|
||||
$reason =""; //失败原因
|
||||
//得到申请单
|
||||
$apply_info = self::where("user_id",$user_id)->where("status","1")->find();
|
||||
if(!$apply_info)$apply_info = self::where("user_id",$user_id)->find();
|
||||
//不存在说明未申请,直接返回
|
||||
if(!$apply_info){
|
||||
return compact('auth_status','shop_id','reason','apply_info',"type");
|
||||
}
|
||||
$type = $apply_info['type'];
|
||||
//从申请单取到申请状态
|
||||
$auth_status = $apply_info['status'];
|
||||
//如果是审核失败,取失败原因
|
||||
if($auth_status == '2'){
|
||||
$reason = $apply_info['reason'];
|
||||
}
|
||||
//如果是申请成功,取店铺id
|
||||
if($auth_status == '1'){
|
||||
$shop_id = $apply_info['shop_id'];
|
||||
}
|
||||
|
||||
|
||||
return compact('auth_status','shop_id','reason','apply_info',"type");
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
<?php
|
||||
|
||||
namespace app\common\model\manystore;
|
||||
|
||||
use think\Model;
|
||||
|
||||
class Shop extends Model
|
||||
{
|
||||
// 表名
|
||||
protected $name = 'manystore_shop';
|
||||
|
||||
}
|
|
@ -0,0 +1,110 @@
|
|||
<?php
|
||||
|
||||
namespace app\common\model\manystore;
|
||||
|
||||
use think\Model;
|
||||
|
||||
|
||||
class ShopLog extends Model
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// 表名
|
||||
protected $name = 'manystore_shop_log';
|
||||
|
||||
// 自动写入时间戳字段
|
||||
protected $autoWriteTimestamp = false;
|
||||
|
||||
// 定义时间戳字段名
|
||||
protected $createTime = false;
|
||||
protected $updateTime = false;
|
||||
protected $deleteTime = false;
|
||||
|
||||
// 追加属性
|
||||
protected $append = [
|
||||
'type_text',
|
||||
'status_text',
|
||||
'auth_time_text',
|
||||
'create_time_text',
|
||||
'update_time_text'
|
||||
];
|
||||
|
||||
|
||||
|
||||
public function getTypeList()
|
||||
{
|
||||
return ['1' => __('Type 1'), '2' => __('Type 2')];
|
||||
}
|
||||
|
||||
public function getStatusList()
|
||||
{
|
||||
return ['0' => __('Status 0'), '1' => __('Status 1'), '2' => __('Status 2')];
|
||||
}
|
||||
|
||||
|
||||
public function getTypeTextAttr($value, $data)
|
||||
{
|
||||
$value = $value ? $value : (isset($data['type']) ? $data['type'] : '');
|
||||
$list = $this->getTypeList();
|
||||
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 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 shop()
|
||||
{
|
||||
return $this->belongsTo('Shop', 'shop_id', 'id', [], 'LEFT')->setEagerlyType(0);
|
||||
}
|
||||
|
||||
|
||||
public function user()
|
||||
{
|
||||
return $this->belongsTo('app\admin\model\User', 'user_id', 'id', [], 'LEFT')->setEagerlyType(0);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,83 @@
|
|||
<?php
|
||||
|
||||
namespace app\common\model\manystore;
|
||||
|
||||
use think\Model;
|
||||
|
||||
|
||||
class UserAuth extends Model
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// 表名
|
||||
protected $name = 'manystore_user_auth';
|
||||
|
||||
// 自动写入时间戳字段
|
||||
protected $autoWriteTimestamp = 'integer';
|
||||
|
||||
// 定义时间戳字段名
|
||||
protected $createTime = 'createtime';
|
||||
protected $updateTime = false;
|
||||
protected $deleteTime = false;
|
||||
|
||||
// 追加属性
|
||||
protected $append = [
|
||||
'status_text',
|
||||
'auth_time_text',
|
||||
'update_time_text'
|
||||
];
|
||||
|
||||
|
||||
|
||||
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 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 setUpdateTimeAttr($value)
|
||||
{
|
||||
return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
|
||||
}
|
||||
|
||||
|
||||
public function shop()
|
||||
{
|
||||
return $this->belongsTo('Shop', 'shop_id', 'id', [], 'LEFT')->setEagerlyType(0);
|
||||
}
|
||||
|
||||
|
||||
public function user()
|
||||
{
|
||||
return $this->belongsTo('app\admin\model\User', 'user_id', 'id', [], 'LEFT')->setEagerlyType(0);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,152 @@
|
|||
<?php
|
||||
|
||||
namespace app\common\model\school;
|
||||
|
||||
use think\Model;
|
||||
|
||||
|
||||
class Message extends Model
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// 表名
|
||||
protected $name = 'school_message';
|
||||
|
||||
// 自动写入时间戳字段
|
||||
protected $autoWriteTimestamp = 'integer';
|
||||
|
||||
// 定义时间戳字段名
|
||||
protected $createTime = 'createtime';
|
||||
protected $updateTime = false;
|
||||
protected $deleteTime = false;
|
||||
|
||||
// 追加属性
|
||||
protected $append = [
|
||||
'platform_text',
|
||||
'oper_type_text',
|
||||
'to_type_text',
|
||||
'status_text',
|
||||
'mini_type_text'
|
||||
];
|
||||
|
||||
|
||||
|
||||
public function getPlatformList()
|
||||
{
|
||||
return ['admin' => __('Platform admin'), 'user' => __('Platform user'), 'shop' => __('Platform shop')];
|
||||
}
|
||||
|
||||
public function getOperTypeList()
|
||||
{
|
||||
return ['admin' => __('Oper_type admin'), 'user' => __('Oper_type user'), 'system' => __('Oper_type system'), 'shop' => __('Oper_type shop')];
|
||||
}
|
||||
|
||||
public function getToTypeList()
|
||||
{
|
||||
return ['admin' => __('To_type admin'), 'user' => __('To_type user'), 'system' => __('To_type system'), 'shop' => __('To_type shop')];
|
||||
}
|
||||
|
||||
public function getStatusList()
|
||||
{
|
||||
return ['system' => __('Status system'), 'classes' => __('Status classes'), 'order' => __('Status order')];
|
||||
}
|
||||
|
||||
public function getMiniTypeList()
|
||||
{
|
||||
return ['order_notice' => __('Mini_type order_notice'), 'classes_auth' => __('Mini_type classes_auth'), 'classes_apply' => __('Mini_type classes_apply'), 'shop_apply' => __('Mini_type shop_apply'), 'classes_order_notice' => __('Mini_type classes_order_notice'), 'user_auth' => __('Mini_type user_auth'), 'aftercare' => __('Mini_type aftercare'), 'other' => __('Mini_type other')];
|
||||
}
|
||||
|
||||
|
||||
public function getPlatformTextAttr($value, $data)
|
||||
{
|
||||
$value = $value ?: ($data['platform'] ?? '');
|
||||
$valueArr = explode(',', $value);
|
||||
$list = $this->getPlatformList();
|
||||
return implode(',', array_intersect_key($list, array_flip($valueArr)));
|
||||
}
|
||||
|
||||
|
||||
public function getOperTypeTextAttr($value, $data)
|
||||
{
|
||||
$value = $value ? $value : (isset($data['oper_type']) ? $data['oper_type'] : '');
|
||||
$list = $this->getOperTypeList();
|
||||
return isset($list[$value]) ? $list[$value] : '';
|
||||
}
|
||||
|
||||
|
||||
public function getToTypeTextAttr($value, $data)
|
||||
{
|
||||
$value = $value ? $value : (isset($data['to_type']) ? $data['to_type'] : '');
|
||||
$list = $this->getToTypeList();
|
||||
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 getMiniTypeTextAttr($value, $data)
|
||||
{
|
||||
$value = $value ? $value : (isset($data['mini_type']) ? $data['mini_type'] : '');
|
||||
$list = $this->getMiniTypeList();
|
||||
return isset($list[$value]) ? $list[$value] : '';
|
||||
}
|
||||
|
||||
protected function setPlatformAttr($value)
|
||||
{
|
||||
return is_array($value) ? implode(',', $value) : $value;
|
||||
}
|
||||
|
||||
|
||||
public function admin()
|
||||
{
|
||||
return $this->belongsTo('app\admin\model\Admin', 'oper_id', 'id', [], 'LEFT')->setEagerlyType(0);
|
||||
}
|
||||
|
||||
|
||||
public function user()
|
||||
{
|
||||
return $this->belongsTo('app\admin\model\User', 'to_id', 'id', [], 'LEFT')->setEagerlyType(0);
|
||||
}
|
||||
|
||||
/** 发送站内信
|
||||
* @param $title 站内信标题
|
||||
* @param $desc 内容
|
||||
* @param $mini_type 消息子类型
|
||||
* @param $to_id 接收者id
|
||||
* @param $to_type 接收者类型
|
||||
* @param $status 消息大类型
|
||||
* @param $platform 发送平台
|
||||
* @param $params 额外参数
|
||||
* @param $oper_id 发送人id
|
||||
* @param $oper_type 发送人类型
|
||||
*
|
||||
*/
|
||||
public static function send($title,$desc,$mini_type,$to_id,$to_type="user",$status="system",$platform="user",$params=[],$oper_id=0,$oper_type="system"){
|
||||
$data = [
|
||||
'title' => $title,
|
||||
'desc' => $desc,
|
||||
'params' => json_encode($params),
|
||||
'platform' => $platform,
|
||||
'oper_id' => $oper_id,
|
||||
'oper_type' => $oper_type,
|
||||
'to_id' => $to_id,
|
||||
'to_type' => $to_type,
|
||||
'status' => $status,
|
||||
'mini_type' => $mini_type,
|
||||
];
|
||||
$message = new self();
|
||||
$message->save($data);
|
||||
return $message;
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,40 @@
|
|||
<?php
|
||||
|
||||
namespace app\common\model\school;
|
||||
|
||||
use think\Model;
|
||||
use traits\model\SoftDelete;
|
||||
|
||||
class SearchCity extends Model
|
||||
{
|
||||
|
||||
use SoftDelete;
|
||||
|
||||
|
||||
|
||||
// 表名
|
||||
protected $name = 'school_search_city';
|
||||
|
||||
// 自动写入时间戳字段
|
||||
protected $autoWriteTimestamp = false;
|
||||
|
||||
// 定义时间戳字段名
|
||||
protected $createTime = false;
|
||||
protected $updateTime = false;
|
||||
protected $deleteTime = 'deletetime';
|
||||
|
||||
// 追加属性
|
||||
protected $append = [
|
||||
|
||||
];
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -2,10 +2,11 @@
|
|||
|
||||
namespace app\common\model\school\classes;
|
||||
|
||||
use app\common\model\BaseModel;
|
||||
use think\Model;
|
||||
use traits\model\SoftDelete;
|
||||
|
||||
class Cate extends Model
|
||||
class Cate extends BaseModel
|
||||
{
|
||||
|
||||
use SoftDelete;
|
||||
|
@ -56,4 +57,62 @@ class Cate extends Model
|
|||
|
||||
|
||||
|
||||
/**得到基础条件
|
||||
* @param $status
|
||||
* @param null $model
|
||||
* @param string $alisa
|
||||
*/
|
||||
public static function getBaseWhere($whereData = [], $model = null, $alisa = '',$with = false)
|
||||
{
|
||||
|
||||
if (!$model) {
|
||||
$model = new static;
|
||||
if ($alisa&&!$with) $model = $model->alias($alisa);
|
||||
}
|
||||
if ($alisa) $alisa = $alisa . '.';
|
||||
$tableFields = (new static)->getTableFields();
|
||||
foreach ($tableFields as $fields)
|
||||
{
|
||||
if(in_array($fields, ['status',"hot"]))continue;
|
||||
// if (isset($whereData[$fields]) && $whereData[$fields]) $model = $model->where("{$alisa}{$fields}", '=', $whereData[$fields]);
|
||||
|
||||
if (isset($whereData[$fields]) && $whereData[$fields]){
|
||||
if(is_array($whereData[$fields])){
|
||||
$model = $model->where("{$alisa}{$fields}", $whereData[$fields][0], $whereData[$fields][1]);
|
||||
}else{
|
||||
$model = $model->where("{$alisa}{$fields}", '=', $whereData[$fields]);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
if (isset($whereData['status'])) $model = $model->where("{$alisa}status", 'in', $whereData['status']);
|
||||
if (isset($whereData['keywords'])&&$whereData['keywords']) $model = $model->where("{$alisa}id|{$alisa}name", 'Like', "%{$whereData['keywords']}%");
|
||||
if (isset($whereData['time'])&&$whereData['time']){
|
||||
$model = $model->time($whereData['time']);
|
||||
}
|
||||
|
||||
if (isset($whereData['hot'])) $model = $model->where("{$alisa}hot", 'in', $whereData['hot']);
|
||||
|
||||
return $model;
|
||||
}
|
||||
|
||||
|
||||
public static function showList($page, $limit,$keywords,$hot=null){
|
||||
$field = ['*'];
|
||||
|
||||
|
||||
$sort = "field(hot,'1','0') asc,weigh desc,id desc";
|
||||
$serch_where = ['keywords'=>$keywords,"status"=>"1"];
|
||||
if($hot==="0" || $hot==="1"){
|
||||
$serch_where['hot'] = $hot;
|
||||
}
|
||||
|
||||
return (new self)->getBaseList($serch_where, $page, $limit,$sort,$field);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -41,9 +41,28 @@ class ClassesLib extends BaseModel
|
|||
'recommend_text',
|
||||
'hot_text',
|
||||
'new_text',
|
||||
'selfhot_text'
|
||||
'selfhot_text',
|
||||
'distance_text',
|
||||
];
|
||||
|
||||
public function getDistanceTextAttr($value, $data) {
|
||||
$distance_text = '';
|
||||
$distance = $data['distance'] ?? 0;
|
||||
|
||||
switch (true) {
|
||||
case $distance >= 1000;
|
||||
$distance_text = round(($distance / 1000), 2) . 'km';
|
||||
break;
|
||||
default :
|
||||
$distance_text = $distance . 'm';
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
return $distance_text;
|
||||
}
|
||||
|
||||
|
||||
|
||||
protected static function init()
|
||||
{
|
||||
|
@ -187,6 +206,8 @@ class ClassesLib extends BaseModel
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
public function getHeadimageAttr($value, $data)
|
||||
{
|
||||
if (!empty($value)) return cdnurl($value, true);
|
||||
|
@ -389,4 +410,180 @@ class ClassesLib extends BaseModel
|
|||
return $this->classes_lib_ids;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取所有课程列表
|
||||
*/
|
||||
public static function getVaildList($params) {
|
||||
extract($params);
|
||||
$a = (new self)->getWithAlisaName().'.';
|
||||
// 查询自提点
|
||||
if(isset($status) && in_array($status, ['1','2','3'])){
|
||||
$selfetch = self::with(['teacher']);
|
||||
}else{
|
||||
$selfetch = self::with(['teacher'])->where($a.'status', '1')->where("{$a}auth_status",1);
|
||||
}
|
||||
|
||||
|
||||
$order = $order?? 'normal';
|
||||
$per_page = $params['page'] ?? 10;
|
||||
|
||||
|
||||
$field = "{$a}id,{$a}shop_id,{$a}user_id,{$a}teacher_id,{$a}classes_cate_ids,{$a}classes_label_ids,{$a}self_label_tag,{$a}title,{$a}headimage,{$a}type,{$a}classes_date_text,{$a}classes_time_text,{$a}virtual_num,{$a}sale,{$a}price,{$a}underline_price,{$a}virtual_collect,{$a}status,{$a}auth_status,{$a}weigh,{$a}recommend,{$a}hot,{$a}new,{$a}selfhot,{$a}createtime,{$a}virtual_people,{$a}feel,{$a}limit_num,{$a}sign_num,{$a}verification_num";
|
||||
|
||||
//得到距离
|
||||
if (isset($latitude) && isset($longitude) && $latitude && $longitude) {
|
||||
$field .= ', '.getDistanceBuilder($latitude, $longitude);
|
||||
}else{
|
||||
$field .= ', 0 as distance';
|
||||
}
|
||||
|
||||
//得到每个
|
||||
|
||||
|
||||
$selfetch = $selfetch->field($field);
|
||||
if (isset($keyword) && $keyword) {
|
||||
$selfetch = $selfetch->where("{$a}title|{$a}address|{$a}address_detail|{$a}address_city", 'like', '%' . $keyword . '%');
|
||||
}
|
||||
|
||||
if (isset($manystore_id) && $manystore_id) {
|
||||
$selfetch = $selfetch->where("{$a}manystore_id", 'in', ''.$manystore_id);
|
||||
}
|
||||
|
||||
if (isset($shop_id) && $shop_id) {
|
||||
$selfetch = $selfetch->where("{$a}shop_id", 'in', ''.$shop_id);
|
||||
}
|
||||
|
||||
if (isset($user_id) && $user_id) {
|
||||
$selfetch = $selfetch->where("{$a}user_id", 'in', ''.$user_id);
|
||||
}
|
||||
|
||||
if (isset($teacher_id) && $teacher_id) {
|
||||
$selfetch = $selfetch->where("{$a}teacher_id", 'in', ''.$teacher_id);
|
||||
}
|
||||
|
||||
if (isset($type) && $type) {
|
||||
$selfetch = $selfetch->where("{$a}type", 'in', ''.$type);
|
||||
}
|
||||
|
||||
if (isset($address_type) && $address_type) {
|
||||
$selfetch = $selfetch->where("{$a}address_type", 'in', ''.$address_type);
|
||||
}
|
||||
|
||||
|
||||
if (isset($recommend) && $recommend) {
|
||||
$selfetch = $selfetch->where("{$a}recommend", 'in', ''.$recommend);
|
||||
}
|
||||
|
||||
|
||||
if (isset($hot) && $hot) {
|
||||
$selfetch = $selfetch->where("{$a}hot", 'in', ''.$hot);
|
||||
}
|
||||
|
||||
|
||||
if (isset($new) && $new) {
|
||||
$selfetch = $selfetch->where("{$a}new", 'in', ''.$new);
|
||||
}
|
||||
|
||||
if (isset($feel) && $feel) {
|
||||
$selfetch = $selfetch->where("{$a}feel", 'in', ''.$feel);
|
||||
}
|
||||
|
||||
|
||||
|
||||
//区域搜索
|
||||
if (isset($province) && $province) {
|
||||
$selfetch = $selfetch->where("{$a}province", 'in', ''.$province);
|
||||
}
|
||||
|
||||
|
||||
if (isset($city) && $city) {
|
||||
$selfetch = $selfetch->where("{$a}city", 'in', ''.$city);
|
||||
}
|
||||
|
||||
if (isset($district) && $district) {
|
||||
$selfetch = $selfetch->where("{$a}district", 'in', ''.$district);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if (isset($self_label_tag) && $self_label_tag) {
|
||||
$self_label_tag = implode("|",explode(',',$self_label_tag));
|
||||
$selfetch = $selfetch->whereRaw(" {$a}self_label_tag REGEXP '({$self_label_tag})'");
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
if (isset($classes_cate_ids) && $classes_cate_ids) {
|
||||
$classes_cate_ids = implode("|",explode(',',$classes_cate_ids));
|
||||
$selfetch = $selfetch->whereRaw(" {$a}classes_cate_ids REGEXP '({$classes_cate_ids})'");
|
||||
}
|
||||
|
||||
if (isset($classes_label_ids) && $classes_label_ids) {
|
||||
$classes_label_ids = implode("|",explode(',',$classes_label_ids));
|
||||
$selfetch = $selfetch->whereRaw(" {$a}classes_label_ids REGEXP '({$classes_label_ids})'");
|
||||
}
|
||||
|
||||
|
||||
|
||||
//排序
|
||||
switch ($order) {
|
||||
case "normal": //综合排序(推薦優先)
|
||||
$selfetch = $selfetch->order("{$a}recommend desc,{$a}weigh desc,{$a}verification_num desc,{$a}sale desc,{$a}sign_num desc");
|
||||
break;
|
||||
case "distance": //距离优先 权重
|
||||
$selfetch = $selfetch->order("distance asc,{$a}recommend desc,{$a}weigh desc,{$a}verification_num desc,{$a}sale desc,{$a}sign_num desc");
|
||||
break;
|
||||
case "hot": //熱門优先
|
||||
$selfetch = $selfetch->order("{$a}hot desc,{$a}recommend desc,{$a}weigh desc,{$a}verification_num desc,{$a}sale desc,{$a}sign_num desc");
|
||||
break;
|
||||
|
||||
case "new": //平台最新优先
|
||||
$selfetch = $selfetch->order("{$a}new desc,{$a}recommend desc,{$a}weigh desc,{$a}verification_num desc,{$a}sale desc,{$a}sign_num desc");
|
||||
break;
|
||||
case "selfhot": //机构热门优先
|
||||
$selfetch = $selfetch->order("{$a}selfhot desc,{$a}recommend desc,{$a}weigh desc,{$a}verification_num desc,{$a}sale desc,{$a}sign_num desc");
|
||||
break;
|
||||
|
||||
case "sale": //銷量优先
|
||||
$selfetch = $selfetch->order("{$a}sale desc,{$a}verification_num desc,{$a}sign_num desc,{$a}recommend desc,{$a}weigh desc");
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
throw new \Exception("不支持的排序类型");
|
||||
}
|
||||
|
||||
if(isset($nearby) && $nearby) {
|
||||
$selfetch = $selfetch->having("distance <= {$nearby}");
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
$selfetch = $selfetch->paginate($per_page);
|
||||
//额外附加数据
|
||||
|
||||
return $selfetch;
|
||||
}
|
||||
|
||||
|
||||
public static function update_classes($classes_lib_id){
|
||||
//更新课程规格库存
|
||||
$classes_lib = self::get($classes_lib_id);
|
||||
if($classes_lib){
|
||||
//所有课时加起来
|
||||
$classes_lib->limit_num = ClassesSpec::where("classes_lib_id",$classes_lib_id)->sum( "limit_num");
|
||||
$classes_lib->save();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -2,10 +2,11 @@
|
|||
|
||||
namespace app\common\model\school\classes;
|
||||
|
||||
use app\common\model\BaseModel;
|
||||
use think\Model;
|
||||
use traits\model\SoftDelete;
|
||||
|
||||
class Label extends Model
|
||||
class Label extends BaseModel
|
||||
{
|
||||
|
||||
use SoftDelete;
|
||||
|
@ -55,5 +56,53 @@ class Label extends Model
|
|||
|
||||
|
||||
|
||||
/**得到基础条件
|
||||
* @param $status
|
||||
* @param null $model
|
||||
* @param string $alisa
|
||||
*/
|
||||
public static function getBaseWhere($whereData = [], $model = null, $alisa = '',$with = false)
|
||||
{
|
||||
|
||||
if (!$model) {
|
||||
$model = new static;
|
||||
if ($alisa&&!$with) $model = $model->alias($alisa);
|
||||
}
|
||||
if ($alisa) $alisa = $alisa . '.';
|
||||
$tableFields = (new static)->getTableFields();
|
||||
foreach ($tableFields as $fields)
|
||||
{
|
||||
if(in_array($fields, ['status']))continue;
|
||||
// if (isset($whereData[$fields]) && $whereData[$fields]) $model = $model->where("{$alisa}{$fields}", '=', $whereData[$fields]);
|
||||
|
||||
if (isset($whereData[$fields]) && $whereData[$fields]){
|
||||
if(is_array($whereData[$fields])){
|
||||
$model = $model->where("{$alisa}{$fields}", $whereData[$fields][0], $whereData[$fields][1]);
|
||||
}else{
|
||||
$model = $model->where("{$alisa}{$fields}", '=', $whereData[$fields]);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
if (isset($whereData['status'])) $model = $model->where("{$alisa}status", 'in', $whereData['status']);
|
||||
if (isset($whereData['keywords'])&&$whereData['keywords']) $model = $model->where("{$alisa}id|{$alisa}name", 'Like', "%{$whereData['keywords']}%");
|
||||
if (isset($whereData['time'])&&$whereData['time']){
|
||||
$model = $model->time($whereData['time']);
|
||||
}
|
||||
return $model;
|
||||
}
|
||||
|
||||
|
||||
public static function showList($page, $limit,$keywords){
|
||||
$field = ['*'];
|
||||
$sort = "weigh desc,id desc";
|
||||
$serch_where = ['keywords'=>$keywords,"status"=>"1"];
|
||||
return (new self)->getBaseList($serch_where, $page, $limit,$sort,$field);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -446,14 +446,13 @@ class Order extends BaseModel
|
|||
if(!$classesOrder)throw new \Exception("订单不存在!");
|
||||
//代下单时将下单人修正成课程下单人,不影响后续判断
|
||||
$user_id = $classesOrder["user_id"];
|
||||
|
||||
//用户操作权限检测
|
||||
self::checkOptionAuth($classes_order_id,$param["help_user_id"],$param["help_type"]);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
//默认校验订单是否已创建
|
||||
if($check){
|
||||
//判断订单是否已创建
|
||||
|
@ -461,6 +460,7 @@ class Order extends BaseModel
|
|||
if($order_info) throw new \Exception("订单已生成,如需重新下单请退出页面重新进入!");
|
||||
if(!$classes_lib_spec_id)throw new \Exception("请选择您要预约的课时信息!");
|
||||
}
|
||||
|
||||
//校验订单参数
|
||||
//更新最近次数后进行验证
|
||||
\app\common\model\school\classes\order\Order::statisticsAndUpdateClassesNumber($classes_order_id);
|
||||
|
@ -483,7 +483,7 @@ class Order extends BaseModel
|
|||
|
||||
//判断课时信息
|
||||
if($classes_lib_spec_id){
|
||||
self::checkLibSpec($user_id,$detail["classes_lib_id"],$classes_lib_spec_id);
|
||||
self::checkLibSpec($user_id,$detail["classes_lib_id"],$classes_lib_spec_id,true);
|
||||
}
|
||||
|
||||
|
||||
|
@ -800,7 +800,7 @@ class Order extends BaseModel
|
|||
* @throws \think\db\exception\ModelNotFoundException
|
||||
* @throws \think\exception\DbException
|
||||
*/
|
||||
public static function checkLibSpec($user_id,$classes_lib_id,$classes_lib_spec_id){
|
||||
public static function checkLibSpec($user_id,$classes_lib_id,$classes_lib_spec_id,$add=false,$order=null){
|
||||
if(!$classes_lib_spec_id || !$classes_lib_id)throw new \Exception("缺少必要信息!");
|
||||
|
||||
$classes_lib_spec_info = ClassesSpec::where('id',$classes_lib_spec_id)
|
||||
|
@ -816,6 +816,31 @@ class Order extends BaseModel
|
|||
->where('user_id',$user_id)
|
||||
->find();
|
||||
if($order_info) throw new \Exception("该课时已预约,请勿重复预约!");
|
||||
|
||||
//新增或更换课时时判断
|
||||
//是否达成限制人数
|
||||
//允许人数为0说明不限制
|
||||
if($classes_lib_spec_info['limit_num'] > 0){
|
||||
//得到当前课时已参与人数
|
||||
$sign_num = self::where("classes_lib_spec_id",$classes_lib_spec_id)->where("status","in",["-1","0"])->count();
|
||||
|
||||
if($add){
|
||||
//订单新增课时
|
||||
//判断是否达到限制人数
|
||||
if($sign_num >= $classes_lib_spec_info['limit_num']){
|
||||
throw new \Exception("该课时已满,请选择其他课时!");
|
||||
}
|
||||
|
||||
}else{
|
||||
//订单更换课时
|
||||
//判断是否达到限制人数
|
||||
if($sign_num >= $classes_lib_spec_info['limit_num']){
|
||||
throw new \Exception("该课时已满,请选择其他课时!");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -1116,7 +1141,7 @@ class Order extends BaseModel
|
|||
//用户操作权限检测
|
||||
self::checkOptionAuth($order['classes_order_id'],$user_id ?: $oper_id,$oper_type);
|
||||
}
|
||||
self::checkLibSpec($order['user_id'],$order["classes_lib_id"],$classes_lib_spec_id);
|
||||
|
||||
|
||||
//判断逻辑
|
||||
if($trans){
|
||||
|
@ -1124,6 +1149,15 @@ class Order extends BaseModel
|
|||
}
|
||||
$res = true;
|
||||
try{
|
||||
//执行课时数更新
|
||||
$res1 = \app\common\model\school\classes\order\Order::statisticsAndUpdateClassesNumber($order['classes_order_id']);
|
||||
|
||||
if($classes_lib_spec_id == $order["classes_lib_spec_id"])throw new \Exception("请勿重复提交!");
|
||||
|
||||
|
||||
self::checkLibSpec($order['user_id'],$order["classes_lib_id"],$classes_lib_spec_id,false,$res1);
|
||||
|
||||
|
||||
//事务逻辑
|
||||
//更新订单状态
|
||||
|
||||
|
|
|
@ -899,7 +899,7 @@ class Order extends BaseModel
|
|||
$lib = $order->lib;
|
||||
if($lib){
|
||||
$lib->sale = self::where("classes_lib_id",$lib["id"])->where("status","<>","-3")->count();
|
||||
$lib->save();
|
||||
|
||||
//遍历课程课时规格,更新课时统计数据
|
||||
$specs = $lib->specs;
|
||||
if($specs){
|
||||
|
@ -912,6 +912,10 @@ class Order extends BaseModel
|
|||
}
|
||||
|
||||
}
|
||||
//统计课程总报名和总核销
|
||||
$lib->sign_num = \app\common\model\school\classes\hourorder\Order::where("classes_lib_id",$lib["id"])->where("status","in",["-1","0"])->count();
|
||||
$lib->verification_num = \app\common\model\school\classes\hourorder\Order::where("classes_lib_id",$lib["id"])->where("status","=","3")->count();
|
||||
$lib->save();
|
||||
}
|
||||
|
||||
//检测订单完成状态
|
||||
|
|
|
@ -0,0 +1,76 @@
|
|||
<?php
|
||||
|
||||
namespace app\manystore\controller\manystore;
|
||||
|
||||
use app\common\controller\ManystoreBase;
|
||||
|
||||
/**
|
||||
* 店铺更新log管理
|
||||
*
|
||||
* @icon fa fa-circle-o
|
||||
*/
|
||||
class ShopLog extends ManystoreBase
|
||||
{
|
||||
|
||||
/**
|
||||
* ShopLog模型对象
|
||||
* @var \app\manystore\model\manystore\ShopLog
|
||||
*/
|
||||
protected $model = null;
|
||||
|
||||
public function _initialize()
|
||||
{
|
||||
parent::_initialize();
|
||||
$this->model = new \app\manystore\model\manystore\ShopLog;
|
||||
$this->view->assign("typeList", $this->model->getTypeList());
|
||||
$this->view->assign("statusList", $this->model->getStatusList());
|
||||
}
|
||||
|
||||
public function import()
|
||||
{
|
||||
parent::import();
|
||||
}
|
||||
|
||||
/**
|
||||
* 默认生成的控制器所继承的父类中有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(['manystoreshop','user'])
|
||||
->where($where)
|
||||
->order($sort, $order)
|
||||
->paginate($limit);
|
||||
|
||||
foreach ($list as $row) {
|
||||
|
||||
$row->getRelation('manystoreshop')->visible(['name']);
|
||||
$row->getRelation('user')->visible(['nickname','mobile','avatar']);
|
||||
}
|
||||
|
||||
$result = array("total" => $list->total(), "rows" => $list->items());
|
||||
|
||||
return json($result);
|
||||
}
|
||||
return $this->view->fetch();
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,75 @@
|
|||
<?php
|
||||
|
||||
namespace app\manystore\controller\manystore;
|
||||
|
||||
use app\common\controller\ManystoreBase;
|
||||
|
||||
/**
|
||||
* 授权机构用户
|
||||
*
|
||||
* @icon fa fa-circle-o
|
||||
*/
|
||||
class UserAuth extends ManystoreBase
|
||||
{
|
||||
|
||||
/**
|
||||
* UserAuth模型对象
|
||||
* @var \app\manystore\model\manystore\UserAuth
|
||||
*/
|
||||
protected $model = null;
|
||||
|
||||
public function _initialize()
|
||||
{
|
||||
parent::_initialize();
|
||||
$this->model = new \app\manystore\model\manystore\UserAuth;
|
||||
$this->view->assign("statusList", $this->model->getStatusList());
|
||||
}
|
||||
|
||||
public function import()
|
||||
{
|
||||
parent::import();
|
||||
}
|
||||
|
||||
/**
|
||||
* 默认生成的控制器所继承的父类中有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(['manystoreshop','user'])
|
||||
->where($where)
|
||||
->order($sort, $order)
|
||||
->paginate($limit);
|
||||
|
||||
foreach ($list as $row) {
|
||||
|
||||
$row->getRelation('manystoreshop')->visible(['name']);
|
||||
$row->getRelation('user')->visible(['nickname','avatar']);
|
||||
}
|
||||
|
||||
$result = array("total" => $list->total(), "rows" => $list->items());
|
||||
|
||||
return json($result);
|
||||
}
|
||||
return $this->view->fetch();
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,79 @@
|
|||
<?php
|
||||
|
||||
namespace app\manystore\controller\school;
|
||||
|
||||
use app\common\controller\ManystoreBase;
|
||||
|
||||
/**
|
||||
* 夜校站内信
|
||||
*
|
||||
* @icon fa fa-circle-o
|
||||
*/
|
||||
class Message extends ManystoreBase
|
||||
{
|
||||
|
||||
/**
|
||||
* Message模型对象
|
||||
* @var \app\manystore\model\school\Message
|
||||
*/
|
||||
protected $model = null;
|
||||
|
||||
public function _initialize()
|
||||
{
|
||||
parent::_initialize();
|
||||
$this->model = new \app\manystore\model\school\Message;
|
||||
$this->view->assign("platformList", $this->model->getPlatformList());
|
||||
$this->view->assign("operTypeList", $this->model->getOperTypeList());
|
||||
$this->view->assign("toTypeList", $this->model->getToTypeList());
|
||||
$this->view->assign("statusList", $this->model->getStatusList());
|
||||
$this->view->assign("miniTypeList", $this->model->getMiniTypeList());
|
||||
}
|
||||
|
||||
public function import()
|
||||
{
|
||||
parent::import();
|
||||
}
|
||||
|
||||
/**
|
||||
* 默认生成的控制器所继承的父类中有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','user'])
|
||||
->where($where)
|
||||
->order($sort, $order)
|
||||
->paginate($limit);
|
||||
|
||||
foreach ($list as $row) {
|
||||
|
||||
$row->getRelation('admin')->visible(['nickname','avatar']);
|
||||
$row->getRelation('user')->visible(['nickname','avatar']);
|
||||
}
|
||||
|
||||
$result = array("total" => $list->total(), "rows" => $list->items());
|
||||
|
||||
return json($result);
|
||||
}
|
||||
return $this->view->fetch();
|
||||
}
|
||||
|
||||
}
|
|
@ -3,6 +3,12 @@
|
|||
namespace app\manystore\controller\school\classes;
|
||||
|
||||
use app\common\controller\ManystoreBase;
|
||||
use app\common\model\User;
|
||||
use app\manystore\model\Manystore;
|
||||
use think\Db;
|
||||
use think\Exception;
|
||||
use think\exception\PDOException;
|
||||
use think\exception\ValidateException;
|
||||
|
||||
/**
|
||||
* 机构课程课时规格
|
||||
|
@ -21,6 +27,12 @@ class ClassesSpec extends ManystoreBase
|
|||
protected $qSwitch = true;
|
||||
protected $qFields = ["classes_lib_id"];
|
||||
|
||||
|
||||
protected $no_auth_fields = ['name','limit_num','status','weigh'];
|
||||
protected $have_auth = false;
|
||||
|
||||
|
||||
|
||||
public function _initialize()
|
||||
{
|
||||
$this->model = new \app\manystore\model\school\classes\ClassesSpec;
|
||||
|
@ -75,4 +87,234 @@ class ClassesSpec extends ManystoreBase
|
|||
return $this->view->fetch();
|
||||
}
|
||||
|
||||
|
||||
protected function update_classes($classes_lib_id){
|
||||
\app\common\model\school\classes\ClassesLib::update_classes($classes_lib_id);
|
||||
}
|
||||
|
||||
|
||||
protected function no_auth_fields_check($params,$row){
|
||||
|
||||
foreach ($params as $k=>$v){
|
||||
|
||||
//说明数值有变动
|
||||
//$params[$k] 去掉两端空格
|
||||
$params[$k] = trim($v);
|
||||
|
||||
if($row[$k]!=$params[$k]){
|
||||
//当修改参数不在允许修改的字段中
|
||||
if(!in_array($k,$this->no_auth_fields)){
|
||||
|
||||
$this->have_auth = true;break;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return $this->have_auth;
|
||||
|
||||
}
|
||||
|
||||
protected function updateCheck($id,$params=[],$row=null){
|
||||
if($params && $row){
|
||||
|
||||
if(!$this->no_auth_fields_check($params,$row)){
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
// 课程存在售后订单则不允许操作
|
||||
$order = \app\common\model\school\classes\hour\Order::where("classes_lib_spec_id",$id)->where("status","in","-1,0")->find();
|
||||
if($order)$this->error("存在正在使用中的课时订单报名学员,课时规格无法继续操作,如规格有误请下架!");
|
||||
}
|
||||
|
||||
|
||||
protected function update_check(&$params,$row=null)
|
||||
{
|
||||
|
||||
$shop_id = SHOP_ID;
|
||||
$manystore = Manystore::where("shop_id", $shop_id)->find();
|
||||
if (!$manystore) {
|
||||
$this->error("店铺不存在");
|
||||
}
|
||||
|
||||
//修改
|
||||
if($row){
|
||||
$this->updateCheck($row->id,$params,$row);
|
||||
|
||||
}else{
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*
|
||||
* @return string
|
||||
* @throws \think\Exception
|
||||
*/
|
||||
public function add()
|
||||
{
|
||||
if ($this->request->isPost()) {
|
||||
$params = $this->request->post("row/a");
|
||||
if ($params) {
|
||||
$params = $this->preExcludeFields($params);
|
||||
|
||||
if($this->storeIdFieldAutoFill && STORE_ID ){
|
||||
$params['store_id'] = STORE_ID;
|
||||
}
|
||||
|
||||
if($this->shopIdAutoCondition && SHOP_ID){
|
||||
$params['shop_id'] = SHOP_ID;
|
||||
}
|
||||
|
||||
$result = false;
|
||||
Db::startTrans();
|
||||
try {
|
||||
//是否采用模型验证
|
||||
if ($this->modelValidate) {
|
||||
$name = str_replace("\\model\\", "\\validate\\", get_class($this->model));
|
||||
$validate = is_bool($this->modelValidate) ? ($this->modelSceneValidate ? $name . '.add' : $name) : $this->modelValidate;
|
||||
$this->model->validateFailException(true)->validate($validate);
|
||||
}
|
||||
$this->update_check($params,$row=null);
|
||||
$result = $this->model->allowField(true)->save($params);
|
||||
$this->update_classes($this->model["classes_lib_id"]);
|
||||
|
||||
Db::commit();
|
||||
} catch (ValidateException $e) {
|
||||
Db::rollback();
|
||||
$this->error($e->getMessage());
|
||||
} catch (PDOException $e) {
|
||||
Db::rollback();
|
||||
$this->error($e->getMessage());
|
||||
} catch (Exception $e) {
|
||||
Db::rollback();
|
||||
$this->error($e->getMessage());
|
||||
}
|
||||
if ($result !== false) {
|
||||
$this->success();
|
||||
} else {
|
||||
$this->error(__('No rows were inserted'));
|
||||
}
|
||||
}
|
||||
$this->error(__('Parameter %s can not be empty', ''));
|
||||
}
|
||||
return $this->view->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*/
|
||||
public function edit($ids = null)
|
||||
{
|
||||
if($this->shopIdAutoCondition){
|
||||
$this->model->where(array('shop_id'=>SHOP_ID));
|
||||
}
|
||||
$row = $this->model->where(array('id'=>$ids))->find();
|
||||
if (!$row) {
|
||||
$this->error(__('No Results were found'));
|
||||
}
|
||||
|
||||
if ($this->request->isPost()) {
|
||||
$params = $this->request->post("row/a");
|
||||
if ($params) {
|
||||
$params = $this->preExcludeFields($params);
|
||||
$result = false;
|
||||
Db::startTrans();
|
||||
try {
|
||||
//是否采用模型验证
|
||||
if ($this->modelValidate) {
|
||||
$name = str_replace("\\model\\", "\\validate\\", get_class($this->model));
|
||||
$validate = is_bool($this->modelValidate) ? ($this->modelSceneValidate ? $name . '.edit' : $name) : $this->modelValidate;
|
||||
$row->validateFailException(true)->validate($validate);
|
||||
}
|
||||
$this->update_check($params,$row);
|
||||
|
||||
|
||||
$result = $row->allowField(true)->save($params);
|
||||
$this->update_classes($row["classes_lib_id"]);
|
||||
|
||||
Db::commit();
|
||||
} catch (ValidateException $e) {
|
||||
Db::rollback();
|
||||
$this->error($e->getMessage());
|
||||
} catch (PDOException $e) {
|
||||
Db::rollback();
|
||||
$this->error($e->getMessage());
|
||||
} catch (Exception $e) {
|
||||
Db::rollback();
|
||||
$this->error($e->getMessage());
|
||||
}
|
||||
if ($result !== false) {
|
||||
$this->success();
|
||||
} else {
|
||||
$this->error(__('No rows were updated'));
|
||||
}
|
||||
}
|
||||
$this->error(__('Parameter %s can not be empty', ''));
|
||||
}
|
||||
|
||||
|
||||
$user = User::where("id", $row["user_id"])->find();
|
||||
// if(!$user) $this->error("未找到用户请先让用户登录小程序再提交表单");
|
||||
$row["user_id"] = $user["mobile"]?? ""; //nickname|realname|mobile
|
||||
$this->view->assign("row", $row);
|
||||
return $this->view->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
public function del($ids = "")
|
||||
{
|
||||
if (!$this->request->isPost()) {
|
||||
$this->error(__("Invalid parameters"));
|
||||
}
|
||||
$ids = $ids ? $ids : $this->request->post("ids");
|
||||
if ($ids) {
|
||||
$pk = $this->model->getPk();
|
||||
if($this->shopIdAutoCondition){
|
||||
$this->model->where(array('shop_id'=>SHOP_ID));
|
||||
}
|
||||
$list = $this->model->where($pk, 'in', $ids)->select();
|
||||
$datas = [];
|
||||
foreach ($list as $item) {
|
||||
$this->updateCheck($item->id);
|
||||
$datas[] = $item->classes_lib_id;
|
||||
}
|
||||
$count = 0;
|
||||
Db::startTrans();
|
||||
try {
|
||||
foreach ($list as $k => $v) {
|
||||
$count += $v->delete();
|
||||
}
|
||||
foreach ($datas as $classes_lib_id) {
|
||||
$this->update_classes($classes_lib_id);
|
||||
}
|
||||
|
||||
|
||||
Db::commit();
|
||||
} catch (PDOException $e) {
|
||||
Db::rollback();
|
||||
$this->error($e->getMessage());
|
||||
} catch (Exception $e) {
|
||||
Db::rollback();
|
||||
$this->error($e->getMessage());
|
||||
}
|
||||
if ($count) {
|
||||
$this->success();
|
||||
} else {
|
||||
$this->error(__('No rows were deleted'));
|
||||
}
|
||||
}
|
||||
$this->error(__('Parameter %s can not be empty', 'ids'));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,42 @@
|
|||
<?php
|
||||
|
||||
return [
|
||||
'Id' => 'ID',
|
||||
'Shop_id' => '机构店铺id',
|
||||
'User_id' => '机构前端用户',
|
||||
'Name' => '店铺名称',
|
||||
'Logo' => '品牌LOGO',
|
||||
'Image' => '封面图',
|
||||
'Images' => '店铺环境照片',
|
||||
'Address_city' => '城市选择',
|
||||
'Province' => '省编号',
|
||||
'City' => '市编号',
|
||||
'District' => '县区编号',
|
||||
'Address' => '店铺地址',
|
||||
'Address_detail' => '店铺详细地址',
|
||||
'Longitude' => '经度',
|
||||
'Latitude' => '纬度',
|
||||
'Yyzzdm' => '营业执照',
|
||||
'Yyzz_images' => '营业执照照片',
|
||||
'Front_idcard_image' => '法人身份证正面',
|
||||
'Reverse_idcard_image' => '法人身份证反面',
|
||||
'Tel' => '服务电话',
|
||||
'Content' => '店铺详情',
|
||||
'Type' => '类型',
|
||||
'Type 1' => '个人',
|
||||
'Type 2' => '机构',
|
||||
'Desc' => '申请备注',
|
||||
'Status' => '审核状态',
|
||||
'Status 0' => '待审核',
|
||||
'Status 1' => '审核通过',
|
||||
'Status 2' => '审核失败',
|
||||
'Reason' => '审核不通过原因',
|
||||
'Auth_time' => '审核时间',
|
||||
'Admin_id' => '审核管理员id',
|
||||
'Create_time' => '创建时间',
|
||||
'Update_time' => '修改时间',
|
||||
'Manystoreshop.name' => '店铺名称',
|
||||
'User.nickname' => '昵称',
|
||||
'User.mobile' => '手机号',
|
||||
'User.avatar' => '头像'
|
||||
];
|
|
@ -0,0 +1,16 @@
|
|||
<?php
|
||||
|
||||
return [
|
||||
'Shop_id' => '机构shopid',
|
||||
'User_id' => '授权用户',
|
||||
'Status' => '授权状态',
|
||||
'Status 0' => '待确认',
|
||||
'Status 1' => '通过',
|
||||
'Status 2' => '拒绝',
|
||||
'Auth_time' => '授权确认时间',
|
||||
'Createtime' => '发起时间',
|
||||
'Update_time' => '修改时间',
|
||||
'Manystoreshop.name' => '店铺名称',
|
||||
'User.nickname' => '昵称',
|
||||
'User.avatar' => '头像'
|
||||
];
|
|
@ -79,5 +79,8 @@ return [
|
|||
'User.mobile' => '手机号',
|
||||
'User.avatar' => '头像',
|
||||
'Admin.nickname' => '昵称',
|
||||
'Admin.avatar' => '头像'
|
||||
'Admin.avatar' => '头像',
|
||||
'Limit_num' => '总限定人数',
|
||||
'Sign_num' => '总已报名人数',
|
||||
'Verification_num' => '总已核销人数',
|
||||
];
|
||||
|
|
|
@ -0,0 +1,41 @@
|
|||
<?php
|
||||
|
||||
return [
|
||||
'Platform' => '消息平台',
|
||||
'Platform admin' => '总后台',
|
||||
'Platform user' => '用户端',
|
||||
'Platform shop' => '机构后台',
|
||||
'Oper_type' => '发送人类型',
|
||||
'Oper_type admin' => '管理员',
|
||||
'Oper_type user' => '用户',
|
||||
'Oper_type system' => '系统',
|
||||
'Oper_type shop' => '机构',
|
||||
'Oper_id' => '发送人id',
|
||||
'To_type' => '接收人类型',
|
||||
'To_type admin' => '管理员',
|
||||
'To_type user' => '用户',
|
||||
'To_type system' => '系统',
|
||||
'To_type shop' => '机构',
|
||||
'To_id' => '接收人id',
|
||||
'Status' => '消息总类型',
|
||||
'Status system' => '系统消息',
|
||||
'Status classes' => '课程消息',
|
||||
'Status order' => '订单消息',
|
||||
'Mini_type' => '小消息类型',
|
||||
'Mini_type order_notice' => '课程订单通知',
|
||||
'Mini_type classes_auth' => '课程报名审核',
|
||||
'Mini_type classes_apply' => '课程上新审核',
|
||||
'Mini_type shop_apply' => '机构审核',
|
||||
'Mini_type classes_order_notice' => '课时预约',
|
||||
'Mini_type user_auth' => '机构授权用户信息',
|
||||
'Mini_type aftercare' => '售后服务',
|
||||
'Mini_type other' => '其他',
|
||||
'Title' => '消息标题',
|
||||
'Desc' => '消息内容',
|
||||
'Params' => '消息额外参数(json)',
|
||||
'Createtime' => '创建时间',
|
||||
'Admin.nickname' => '昵称',
|
||||
'Admin.avatar' => '头像',
|
||||
'User.nickname' => '昵称',
|
||||
'User.avatar' => '头像'
|
||||
];
|
|
@ -0,0 +1,110 @@
|
|||
<?php
|
||||
|
||||
namespace app\manystore\model\manystore;
|
||||
|
||||
use think\Model;
|
||||
|
||||
|
||||
class ShopLog extends Model
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// 表名
|
||||
protected $name = 'manystore_shop_log';
|
||||
|
||||
// 自动写入时间戳字段
|
||||
protected $autoWriteTimestamp = false;
|
||||
|
||||
// 定义时间戳字段名
|
||||
protected $createTime = false;
|
||||
protected $updateTime = false;
|
||||
protected $deleteTime = false;
|
||||
|
||||
// 追加属性
|
||||
protected $append = [
|
||||
'type_text',
|
||||
'status_text',
|
||||
'auth_time_text',
|
||||
'create_time_text',
|
||||
'update_time_text'
|
||||
];
|
||||
|
||||
|
||||
|
||||
public function getTypeList()
|
||||
{
|
||||
return ['1' => __('Type 1'), '2' => __('Type 2')];
|
||||
}
|
||||
|
||||
public function getStatusList()
|
||||
{
|
||||
return ['0' => __('Status 0'), '1' => __('Status 1'), '2' => __('Status 2')];
|
||||
}
|
||||
|
||||
|
||||
public function getTypeTextAttr($value, $data)
|
||||
{
|
||||
$value = $value ? $value : (isset($data['type']) ? $data['type'] : '');
|
||||
$list = $this->getTypeList();
|
||||
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 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 manystoreshop()
|
||||
{
|
||||
return $this->belongsTo('app\manystore\model\ManystoreShop', 'shop_id', 'id', [], 'LEFT')->setEagerlyType(0);
|
||||
}
|
||||
|
||||
|
||||
public function user()
|
||||
{
|
||||
return $this->belongsTo('app\manystore\model\User', 'user_id', 'id', [], 'LEFT')->setEagerlyType(0);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,83 @@
|
|||
<?php
|
||||
|
||||
namespace app\manystore\model\manystore;
|
||||
|
||||
use think\Model;
|
||||
|
||||
|
||||
class UserAuth extends Model
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// 表名
|
||||
protected $name = 'manystore_user_auth';
|
||||
|
||||
// 自动写入时间戳字段
|
||||
protected $autoWriteTimestamp = 'int';
|
||||
|
||||
// 定义时间戳字段名
|
||||
protected $createTime = 'createtime';
|
||||
protected $updateTime = false;
|
||||
protected $deleteTime = false;
|
||||
|
||||
// 追加属性
|
||||
protected $append = [
|
||||
'status_text',
|
||||
'auth_time_text',
|
||||
'update_time_text'
|
||||
];
|
||||
|
||||
|
||||
|
||||
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 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 setUpdateTimeAttr($value)
|
||||
{
|
||||
return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
|
||||
}
|
||||
|
||||
|
||||
public function manystoreshop()
|
||||
{
|
||||
return $this->belongsTo('app\manystore\model\ManystoreShop', 'shop_id', 'id', [], 'LEFT')->setEagerlyType(0);
|
||||
}
|
||||
|
||||
|
||||
public function user()
|
||||
{
|
||||
return $this->belongsTo('app\manystore\model\User', 'user_id', 'id', [], 'LEFT')->setEagerlyType(0);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,119 @@
|
|||
<?php
|
||||
|
||||
namespace app\manystore\model\school;
|
||||
|
||||
use think\Model;
|
||||
|
||||
|
||||
class Message extends Model
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// 表名
|
||||
protected $name = 'school_message';
|
||||
|
||||
// 自动写入时间戳字段
|
||||
protected $autoWriteTimestamp = 'int';
|
||||
|
||||
// 定义时间戳字段名
|
||||
protected $createTime = 'createtime';
|
||||
protected $updateTime = false;
|
||||
protected $deleteTime = false;
|
||||
|
||||
// 追加属性
|
||||
protected $append = [
|
||||
'platform_text',
|
||||
'oper_type_text',
|
||||
'to_type_text',
|
||||
'status_text',
|
||||
'mini_type_text'
|
||||
];
|
||||
|
||||
|
||||
|
||||
public function getPlatformList()
|
||||
{
|
||||
return ['admin' => __('Platform admin'), 'user' => __('Platform user'), 'shop' => __('Platform shop')];
|
||||
}
|
||||
|
||||
public function getOperTypeList()
|
||||
{
|
||||
return ['admin' => __('Oper_type admin'), 'user' => __('Oper_type user'), 'system' => __('Oper_type system'), 'shop' => __('Oper_type shop')];
|
||||
}
|
||||
|
||||
public function getToTypeList()
|
||||
{
|
||||
return ['admin' => __('To_type admin'), 'user' => __('To_type user'), 'system' => __('To_type system'), 'shop' => __('To_type shop')];
|
||||
}
|
||||
|
||||
public function getStatusList()
|
||||
{
|
||||
return ['system' => __('Status system'), 'classes' => __('Status classes'), 'order' => __('Status order')];
|
||||
}
|
||||
|
||||
public function getMiniTypeList()
|
||||
{
|
||||
return ['order_notice' => __('Mini_type order_notice'), 'classes_auth' => __('Mini_type classes_auth'), 'classes_apply' => __('Mini_type classes_apply'), 'shop_apply' => __('Mini_type shop_apply'), 'classes_order_notice' => __('Mini_type classes_order_notice'), 'user_auth' => __('Mini_type user_auth'), 'aftercare' => __('Mini_type aftercare'), 'other' => __('Mini_type other')];
|
||||
}
|
||||
|
||||
|
||||
public function getPlatformTextAttr($value, $data)
|
||||
{
|
||||
$value = $value ? $value : (isset($data['platform']) ? $data['platform'] : '');
|
||||
$valueArr = explode(',', $value);
|
||||
$list = $this->getPlatformList();
|
||||
return implode(',', array_intersect_key($list, array_flip($valueArr)));
|
||||
}
|
||||
|
||||
|
||||
public function getOperTypeTextAttr($value, $data)
|
||||
{
|
||||
$value = $value ? $value : (isset($data['oper_type']) ? $data['oper_type'] : '');
|
||||
$list = $this->getOperTypeList();
|
||||
return isset($list[$value]) ? $list[$value] : '';
|
||||
}
|
||||
|
||||
|
||||
public function getToTypeTextAttr($value, $data)
|
||||
{
|
||||
$value = $value ? $value : (isset($data['to_type']) ? $data['to_type'] : '');
|
||||
$list = $this->getToTypeList();
|
||||
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 getMiniTypeTextAttr($value, $data)
|
||||
{
|
||||
$value = $value ? $value : (isset($data['mini_type']) ? $data['mini_type'] : '');
|
||||
$list = $this->getMiniTypeList();
|
||||
return isset($list[$value]) ? $list[$value] : '';
|
||||
}
|
||||
|
||||
protected function setPlatformAttr($value)
|
||||
{
|
||||
return is_array($value) ? implode(',', $value) : $value;
|
||||
}
|
||||
|
||||
|
||||
public function admin()
|
||||
{
|
||||
return $this->belongsTo('app\manystore\model\Admin', 'oper_id', 'id', [], 'LEFT')->setEagerlyType(0);
|
||||
}
|
||||
|
||||
|
||||
public function user()
|
||||
{
|
||||
return $this->belongsTo('app\manystore\model\User', 'to_id', 'id', [], 'LEFT')->setEagerlyType(0);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,27 @@
|
|||
<?php
|
||||
|
||||
namespace app\manystore\validate\manystore;
|
||||
|
||||
use think\Validate;
|
||||
|
||||
class ShopLog extends Validate
|
||||
{
|
||||
/**
|
||||
* 验证规则
|
||||
*/
|
||||
protected $rule = [
|
||||
];
|
||||
/**
|
||||
* 提示消息
|
||||
*/
|
||||
protected $message = [
|
||||
];
|
||||
/**
|
||||
* 验证场景
|
||||
*/
|
||||
protected $scene = [
|
||||
'add' => [],
|
||||
'edit' => [],
|
||||
];
|
||||
|
||||
}
|
|
@ -0,0 +1,27 @@
|
|||
<?php
|
||||
|
||||
namespace app\manystore\validate\manystore;
|
||||
|
||||
use think\Validate;
|
||||
|
||||
class UserAuth extends Validate
|
||||
{
|
||||
/**
|
||||
* 验证规则
|
||||
*/
|
||||
protected $rule = [
|
||||
];
|
||||
/**
|
||||
* 提示消息
|
||||
*/
|
||||
protected $message = [
|
||||
];
|
||||
/**
|
||||
* 验证场景
|
||||
*/
|
||||
protected $scene = [
|
||||
'add' => [],
|
||||
'edit' => [],
|
||||
];
|
||||
|
||||
}
|
|
@ -0,0 +1,27 @@
|
|||
<?php
|
||||
|
||||
namespace app\manystore\validate\school;
|
||||
|
||||
use think\Validate;
|
||||
|
||||
class Message extends Validate
|
||||
{
|
||||
/**
|
||||
* 验证规则
|
||||
*/
|
||||
protected $rule = [
|
||||
];
|
||||
/**
|
||||
* 提示消息
|
||||
*/
|
||||
protected $message = [
|
||||
];
|
||||
/**
|
||||
* 验证场景
|
||||
*/
|
||||
protected $scene = [
|
||||
'add' => [],
|
||||
'edit' => [],
|
||||
];
|
||||
|
||||
}
|
|
@ -0,0 +1,224 @@
|
|||
<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">{:__('User_id')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<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">{:__('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" 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" 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" 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" 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" 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" 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" 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" 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" 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" 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" 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" 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" 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" 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" 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">{:__('Front_idcard_image')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<div class="input-group">
|
||||
<input id="c-front_idcard_image" class="form-control" size="50" name="row[front_idcard_image]" type="text">
|
||||
<div class="input-group-addon no-border no-padding">
|
||||
<span><button type="button" id="faupload-front_idcard_image" class="btn btn-danger faupload" data-input-id="c-front_idcard_image" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp" data-multiple="false" data-preview-id="p-front_idcard_image"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
|
||||
<span><button type="button" id="fachoose-front_idcard_image" class="btn btn-primary fachoose" data-input-id="c-front_idcard_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-front_idcard_image"></span>
|
||||
</div>
|
||||
<ul class="row list-inline faupload-preview" id="p-front_idcard_image"></ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Reverse_idcard_image')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<div class="input-group">
|
||||
<input id="c-reverse_idcard_image" class="form-control" size="50" name="row[reverse_idcard_image]" type="text">
|
||||
<div class="input-group-addon no-border no-padding">
|
||||
<span><button type="button" id="faupload-reverse_idcard_image" class="btn btn-danger faupload" data-input-id="c-reverse_idcard_image" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp" data-multiple="false" data-preview-id="p-reverse_idcard_image"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
|
||||
<span><button type="button" id="fachoose-reverse_idcard_image" class="btn btn-primary fachoose" data-input-id="c-reverse_idcard_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-reverse_idcard_image"></span>
|
||||
</div>
|
||||
<ul class="row list-inline faupload-preview" id="p-reverse_idcard_image"></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">{:__('Type')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
|
||||
<select id="c-type" data-rule="required" class="form-control selectpicker" name="row[type]">
|
||||
{foreach name="typeList" item="vo"}
|
||||
<option value="{$key}" {in name="key" value="2"}selected{/in}>{$vo}</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Desc')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-desc" class="form-control" name="row[desc]" type="text" value="">
|
||||
</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">{:__('Admin_id')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-admin_id" data-rule="required" data-source="auth/admin/selectpage" class="form-control selectpage" name="row[admin_id]" type="text" value="">
|
||||
</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" 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" 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-success btn-embossed disabled">{:__('OK')}</button>
|
||||
<button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
|
@ -0,0 +1,224 @@
|
|||
<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">{:__('User_id')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<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">{:__('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" 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" 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" 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" 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" 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" 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" 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" 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" 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" 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" 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" 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" 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" 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" 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">{:__('Front_idcard_image')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<div class="input-group">
|
||||
<input id="c-front_idcard_image" class="form-control" size="50" name="row[front_idcard_image]" type="text" value="{$row.front_idcard_image|htmlentities}">
|
||||
<div class="input-group-addon no-border no-padding">
|
||||
<span><button type="button" id="faupload-front_idcard_image" class="btn btn-danger faupload" data-input-id="c-front_idcard_image" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp" data-multiple="false" data-preview-id="p-front_idcard_image"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
|
||||
<span><button type="button" id="fachoose-front_idcard_image" class="btn btn-primary fachoose" data-input-id="c-front_idcard_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-front_idcard_image"></span>
|
||||
</div>
|
||||
<ul class="row list-inline faupload-preview" id="p-front_idcard_image"></ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Reverse_idcard_image')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<div class="input-group">
|
||||
<input id="c-reverse_idcard_image" class="form-control" size="50" name="row[reverse_idcard_image]" type="text" value="{$row.reverse_idcard_image|htmlentities}">
|
||||
<div class="input-group-addon no-border no-padding">
|
||||
<span><button type="button" id="faupload-reverse_idcard_image" class="btn btn-danger faupload" data-input-id="c-reverse_idcard_image" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp" data-multiple="false" data-preview-id="p-reverse_idcard_image"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
|
||||
<span><button type="button" id="fachoose-reverse_idcard_image" class="btn btn-primary fachoose" data-input-id="c-reverse_idcard_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-reverse_idcard_image"></span>
|
||||
</div>
|
||||
<ul class="row list-inline faupload-preview" id="p-reverse_idcard_image"></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">{:__('Type')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
|
||||
<select id="c-type" data-rule="required" class="form-control selectpicker" name="row[type]">
|
||||
{foreach name="typeList" item="vo"}
|
||||
<option value="{$key}" {in name="key" value="$row.type"}selected{/in}>{$vo}</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Desc')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-desc" class="form-control" name="row[desc]" type="text" value="{$row.desc|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">
|
||||
|
||||
<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">{:__('Admin_id')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-admin_id" data-rule="required" data-source="auth/admin/selectpage" class="form-control selectpage" name="row[admin_id]" type="text" value="{$row.admin_id|htmlentities}">
|
||||
</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" 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" 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-success btn-embossed disabled">{:__('OK')}</button>
|
||||
<button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
|
@ -0,0 +1,44 @@
|
|||
<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('manystore/shop_log/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('manystore/shop_log/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('manystore/shop_log/del')?'':'hide'}" title="{:__('Delete')}" ><i class="fa fa-trash"></i> {:__('Delete')}</a>
|
||||
|
||||
<div class="dropdown btn-group {:$auth->check('manystore/shop_log/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">
|
||||
<li><a class="btn btn-link btn-multi btn-disabled disabled" href="javascript:;" data-params="status=normal"><i class="fa fa-eye"></i> {:__('Set to normal')}</a></li>
|
||||
<li><a class="btn btn-link btn-multi btn-disabled disabled" href="javascript:;" data-params="status=hidden"><i class="fa fa-eye-slash"></i> {:__('Set to hidden')}</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<table id="table" class="table table-striped table-bordered table-hover table-nowrap"
|
||||
data-operate-edit="{:$auth->check('manystore/shop_log/edit')}"
|
||||
data-operate-del="{:$auth->check('manystore/shop_log/del')}"
|
||||
width="100%">
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
|
@ -0,0 +1,40 @@
|
|||
<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">{:__('User_id')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<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">{:__('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">{:__('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">{:__('Update_time')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-update_time" data-rule="required" 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-success btn-embossed disabled">{:__('OK')}</button>
|
||||
<button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
|
@ -0,0 +1,40 @@
|
|||
<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">{:__('User_id')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<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">{:__('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">{:__('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">{:__('Update_time')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-update_time" data-rule="required" 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-success btn-embossed disabled">{:__('OK')}</button>
|
||||
<button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
|
@ -0,0 +1,44 @@
|
|||
<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('manystore/user_auth/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('manystore/user_auth/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('manystore/user_auth/del')?'':'hide'}" title="{:__('Delete')}" ><i class="fa fa-trash"></i> {:__('Delete')}</a>
|
||||
|
||||
<div class="dropdown btn-group {:$auth->check('manystore/user_auth/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">
|
||||
<li><a class="btn btn-link btn-multi btn-disabled disabled" href="javascript:;" data-params="status=normal"><i class="fa fa-eye"></i> {:__('Set to normal')}</a></li>
|
||||
<li><a class="btn btn-link btn-multi btn-disabled disabled" href="javascript:;" data-params="status=hidden"><i class="fa fa-eye-slash"></i> {:__('Set to hidden')}</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<table id="table" class="table table-striped table-bordered table-hover table-nowrap"
|
||||
data-operate-edit="{:$auth->check('manystore/user_auth/edit')}"
|
||||
data-operate-del="{:$auth->check('manystore/user_auth/del')}"
|
||||
width="100%">
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
|
@ -0,0 +1,100 @@
|
|||
<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">{:__('Platform')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
|
||||
<select id="c-platform" class="form-control selectpicker" multiple="" name="row[platform][]">
|
||||
{foreach name="platformList" item="vo"}
|
||||
<option value="{$key}" {in name="key" value=""}selected{/in}>{$vo}</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Oper_type')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
|
||||
<select id="c-oper_type" data-rule="required" class="form-control selectpicker" name="row[oper_type]">
|
||||
{foreach name="operTypeList" item="vo"}
|
||||
<option value="{$key}" {in name="key" value="system"}selected{/in}>{$vo}</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Oper_id')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-oper_id" data-rule="required" data-source="oper/index" class="form-control selectpage" name="row[oper_id]" type="text" value="">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('To_type')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
|
||||
<select id="c-to_type" data-rule="required" class="form-control selectpicker" name="row[to_type]">
|
||||
{foreach name="toTypeList" item="vo"}
|
||||
<option value="{$key}" {in name="key" value="system"}selected{/in}>{$vo}</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('To_id')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-to_id" data-rule="required" data-source="to/index" class="form-control selectpage" name="row[to_id]" type="text" value="">
|
||||
</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="system"}checked{/in} /> {$vo}</label>
|
||||
{/foreach}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Mini_type')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
|
||||
<select id="c-mini_type" data-rule="required" class="form-control selectpicker" name="row[mini_type]">
|
||||
{foreach name="miniTypeList" item="vo"}
|
||||
<option value="{$key}" {in name="key" value="other"}selected{/in}>{$vo}</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
|
||||
</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">
|
||||
<input id="c-title" data-rule="required" class="form-control" name="row[title]" type="text">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Desc')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-desc" data-rule="required" class="form-control" name="row[desc]" type="text">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Params')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-params" class="form-control" name="row[params]" type="text">
|
||||
</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-success btn-embossed disabled">{:__('OK')}</button>
|
||||
<button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
|
@ -0,0 +1,100 @@
|
|||
<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">{:__('Platform')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
|
||||
<select id="c-platform" class="form-control selectpicker" multiple="" name="row[platform][]">
|
||||
{foreach name="platformList" item="vo"}
|
||||
<option value="{$key}" {in name="key" value="$row.platform"}selected{/in}>{$vo}</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Oper_type')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
|
||||
<select id="c-oper_type" data-rule="required" class="form-control selectpicker" name="row[oper_type]">
|
||||
{foreach name="operTypeList" item="vo"}
|
||||
<option value="{$key}" {in name="key" value="$row.oper_type"}selected{/in}>{$vo}</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Oper_id')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-oper_id" data-rule="required" data-source="oper/index" class="form-control selectpage" name="row[oper_id]" type="text" value="{$row.oper_id|htmlentities}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('To_type')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
|
||||
<select id="c-to_type" data-rule="required" class="form-control selectpicker" name="row[to_type]">
|
||||
{foreach name="toTypeList" item="vo"}
|
||||
<option value="{$key}" {in name="key" value="$row.to_type"}selected{/in}>{$vo}</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('To_id')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-to_id" data-rule="required" data-source="to/index" class="form-control selectpage" name="row[to_id]" type="text" value="{$row.to_id|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">
|
||||
|
||||
<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">{:__('Mini_type')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
|
||||
<select id="c-mini_type" data-rule="required" class="form-control selectpicker" name="row[mini_type]">
|
||||
{foreach name="miniTypeList" item="vo"}
|
||||
<option value="{$key}" {in name="key" value="$row.mini_type"}selected{/in}>{$vo}</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
|
||||
</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">
|
||||
<input id="c-title" data-rule="required" class="form-control" name="row[title]" type="text" value="{$row.title|htmlentities}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Desc')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-desc" data-rule="required" class="form-control" name="row[desc]" type="text" value="{$row.desc|htmlentities}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Params')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-params" class="form-control" name="row[params]" type="text" value="{$row.params|htmlentities}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group layer-footer">
|
||||
<label class="control-label col-xs-12 col-sm-2"></label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<button type="submit" class="btn btn-success btn-embossed disabled">{:__('OK')}</button>
|
||||
<button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
|
@ -0,0 +1,44 @@
|
|||
<div class="panel panel-default panel-intro">
|
||||
|
||||
<div class="panel-heading">
|
||||
{:build_heading(null,FALSE)}
|
||||
<ul class="nav nav-tabs" data-field="status">
|
||||
<li class="{:$Think.get.status === null ? 'active' : ''}"><a href="#t-all" data-value="" data-toggle="tab">{:__('All')}</a></li>
|
||||
{foreach name="statusList" item="vo"}
|
||||
<li class="{:$Think.get.status === (string)$key ? 'active' : ''}"><a href="#t-{$key}" data-value="{$key}" data-toggle="tab">{$vo}</a></li>
|
||||
{/foreach}
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="panel-body">
|
||||
<div id="myTabContent" class="tab-content">
|
||||
<div class="tab-pane fade active in" id="one">
|
||||
<div class="widget-body no-padding">
|
||||
<div id="toolbar" class="toolbar">
|
||||
<a href="javascript:;" class="btn btn-primary btn-refresh" title="{:__('Refresh')}" ><i class="fa fa-refresh"></i> </a>
|
||||
<a href="javascript:;" class="btn btn-success btn-add {:$auth->check('school/message/add')?'':'hide'}" title="{:__('Add')}" ><i class="fa fa-plus"></i> {:__('Add')}</a>
|
||||
<a href="javascript:;" class="btn btn-success btn-edit btn-disabled disabled {:$auth->check('school/message/edit')?'':'hide'}" title="{:__('Edit')}" ><i class="fa fa-pencil"></i> {:__('Edit')}</a>
|
||||
<a href="javascript:;" class="btn btn-danger btn-del btn-disabled disabled {:$auth->check('school/message/del')?'':'hide'}" title="{:__('Delete')}" ><i class="fa fa-trash"></i> {:__('Delete')}</a>
|
||||
|
||||
<div class="dropdown btn-group {:$auth->check('school/message/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">
|
||||
<li><a class="btn btn-link btn-multi btn-disabled disabled" href="javascript:;" data-params="status=normal"><i class="fa fa-eye"></i> {:__('Set to normal')}</a></li>
|
||||
<li><a class="btn btn-link btn-multi btn-disabled disabled" href="javascript:;" data-params="status=hidden"><i class="fa fa-eye-slash"></i> {:__('Set to hidden')}</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<table id="table" class="table table-striped table-bordered table-hover table-nowrap"
|
||||
data-operate-edit="{:$auth->check('school/message/edit')}"
|
||||
data-operate-del="{:$auth->check('school/message/del')}"
|
||||
width="100%">
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
|
@ -0,0 +1,82 @@
|
|||
define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
|
||||
|
||||
var Controller = {
|
||||
index: function () {
|
||||
// 初始化表格参数配置
|
||||
Table.api.init({
|
||||
extend: {
|
||||
index_url: 'manystore/shop_log/index' + location.search,
|
||||
add_url: 'manystore/shop_log/add',
|
||||
edit_url: 'manystore/shop_log/edit',
|
||||
del_url: 'manystore/shop_log/del',
|
||||
multi_url: 'manystore/shop_log/multi',
|
||||
import_url: 'manystore/shop_log/import',
|
||||
table: 'manystore_shop_log',
|
||||
}
|
||||
});
|
||||
|
||||
var table = $("#table");
|
||||
|
||||
// 初始化表格
|
||||
table.bootstrapTable({
|
||||
url: $.fn.bootstrapTable.defaults.extend.index_url,
|
||||
pk: 'id',
|
||||
sortName: 'id',
|
||||
fixedColumns: true,
|
||||
fixedRightNumber: 1,
|
||||
columns: [
|
||||
[
|
||||
{checkbox: true},
|
||||
{field: 'id', title: __('Id')},
|
||||
{field: 'shop_id', title: __('Shop_id')},
|
||||
{field: 'user_id', title: __('User_id')},
|
||||
{field: 'name', title: __('Name'), operate: 'LIKE'},
|
||||
{field: 'logo', title: __('Logo'), operate: 'LIKE'},
|
||||
{field: 'image', title: __('Image'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image},
|
||||
{field: 'address_city', title: __('Address_city'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
|
||||
{field: 'province', title: __('Province')},
|
||||
{field: 'city', title: __('City')},
|
||||
{field: 'district', title: __('District')},
|
||||
{field: 'address', title: __('Address'), operate: 'LIKE'},
|
||||
{field: 'address_detail', title: __('Address_detail'), operate: 'LIKE'},
|
||||
{field: 'longitude', title: __('Longitude'), operate: 'LIKE'},
|
||||
{field: 'latitude', title: __('Latitude'), operate: 'LIKE'},
|
||||
{field: 'yyzzdm', title: __('Yyzzdm'), operate: 'LIKE'},
|
||||
{field: 'yyzz_images', title: __('Yyzz_images'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.images},
|
||||
{field: 'front_idcard_image', title: __('Front_idcard_image'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image},
|
||||
{field: 'reverse_idcard_image', title: __('Reverse_idcard_image'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image},
|
||||
{field: 'tel', title: __('Tel'), operate: 'LIKE'},
|
||||
{field: 'type', title: __('Type'), searchList: {"1":__('Type 1'),"2":__('Type 2')}, formatter: Table.api.formatter.normal},
|
||||
{field: 'desc', title: __('Desc'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
|
||||
{field: 'status', title: __('Status'), searchList: {"0":__('Status 0'),"1":__('Status 1'),"2":__('Status 2')}, formatter: Table.api.formatter.status},
|
||||
{field: 'reason', title: __('Reason'), operate: 'LIKE'},
|
||||
{field: 'auth_time', title: __('Auth_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
|
||||
{field: 'admin_id', title: __('Admin_id')},
|
||||
{field: 'create_time', title: __('Create_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
|
||||
{field: 'update_time', title: __('Update_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
|
||||
{field: 'shop.name', title: __('Shop.name'), operate: 'LIKE'},
|
||||
{field: 'user.nickname', title: __('User.nickname'), operate: 'LIKE'},
|
||||
{field: 'user.mobile', title: __('User.mobile'), operate: 'LIKE'},
|
||||
{field: 'user.avatar', title: __('User.avatar'), operate: 'LIKE', 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}
|
||||
]
|
||||
]
|
||||
});
|
||||
|
||||
// 为表格绑定事件
|
||||
Table.api.bindevent(table);
|
||||
},
|
||||
add: function () {
|
||||
Controller.api.bindevent();
|
||||
},
|
||||
edit: function () {
|
||||
Controller.api.bindevent();
|
||||
},
|
||||
api: {
|
||||
bindevent: function () {
|
||||
Form.api.bindevent($("form[role=form]"));
|
||||
}
|
||||
}
|
||||
};
|
||||
return Controller;
|
||||
});
|
|
@ -0,0 +1,59 @@
|
|||
define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
|
||||
|
||||
var Controller = {
|
||||
index: function () {
|
||||
// 初始化表格参数配置
|
||||
Table.api.init({
|
||||
extend: {
|
||||
index_url: 'manystore/user_auth/index' + location.search,
|
||||
add_url: 'manystore/user_auth/add',
|
||||
edit_url: 'manystore/user_auth/edit',
|
||||
del_url: 'manystore/user_auth/del',
|
||||
multi_url: 'manystore/user_auth/multi',
|
||||
import_url: 'manystore/user_auth/import',
|
||||
table: 'manystore_user_auth',
|
||||
}
|
||||
});
|
||||
|
||||
var table = $("#table");
|
||||
|
||||
// 初始化表格
|
||||
table.bootstrapTable({
|
||||
url: $.fn.bootstrapTable.defaults.extend.index_url,
|
||||
pk: 'id',
|
||||
sortName: 'id',
|
||||
columns: [
|
||||
[
|
||||
{checkbox: true},
|
||||
{field: 'id', title: __('Id')},
|
||||
{field: 'shop_id', title: __('Shop_id')},
|
||||
{field: 'user_id', title: __('User_id')},
|
||||
{field: 'status', title: __('Status'), searchList: {"0":__('Status 0'),"1":__('Status 1'),"2":__('Status 2')}, formatter: Table.api.formatter.status},
|
||||
{field: 'auth_time', title: __('Auth_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: 'update_time', title: __('Update_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
|
||||
{field: 'shop.name', title: __('Shop.name'), operate: 'LIKE'},
|
||||
{field: 'user.nickname', title: __('User.nickname'), operate: 'LIKE'},
|
||||
{field: 'user.avatar', title: __('User.avatar'), operate: 'LIKE', 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}
|
||||
]
|
||||
]
|
||||
});
|
||||
|
||||
// 为表格绑定事件
|
||||
Table.api.bindevent(table);
|
||||
},
|
||||
add: function () {
|
||||
Controller.api.bindevent();
|
||||
},
|
||||
edit: function () {
|
||||
Controller.api.bindevent();
|
||||
},
|
||||
api: {
|
||||
bindevent: function () {
|
||||
Form.api.bindevent($("form[role=form]"));
|
||||
}
|
||||
}
|
||||
};
|
||||
return Controller;
|
||||
});
|
|
@ -115,6 +115,11 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
|||
|
||||
{field: 'type', title: __('Type'), searchList: {"out":__('Type out'),"in":__('Type in')}, formatter: Table.api.formatter.normal},
|
||||
{field: 'classes_num', title: __('Classes_num')},
|
||||
|
||||
{field: 'limit_num', title: __('Limit_num')},
|
||||
{field: 'sign_num', title: __('Sign_num')},
|
||||
{field: 'verification_num', title: __('Verification_num')},
|
||||
|
||||
{field: 'address_type', title: __('Address_type'), searchList: {"1":__('Address_type 1'),"2":__('Address_type 2')}, formatter: Table.api.formatter.normal},
|
||||
{field: 'sale', title: __('Sale')},
|
||||
{field: 'price', title: __('Price'), operate:'BETWEEN'},
|
||||
|
|
|
@ -0,0 +1,67 @@
|
|||
define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
|
||||
|
||||
var Controller = {
|
||||
index: function () {
|
||||
// 初始化表格参数配置
|
||||
Table.api.init({
|
||||
extend: {
|
||||
index_url: 'school/message/index' + location.search,
|
||||
add_url: 'school/message/add',
|
||||
edit_url: 'school/message/edit',
|
||||
del_url: 'school/message/del',
|
||||
multi_url: 'school/message/multi',
|
||||
import_url: 'school/message/import',
|
||||
table: 'school_message',
|
||||
}
|
||||
});
|
||||
|
||||
var table = $("#table");
|
||||
|
||||
// 初始化表格
|
||||
table.bootstrapTable({
|
||||
url: $.fn.bootstrapTable.defaults.extend.index_url,
|
||||
pk: 'id',
|
||||
sortName: 'id',
|
||||
fixedColumns: true,
|
||||
fixedRightNumber: 1,
|
||||
columns: [
|
||||
[
|
||||
{checkbox: true},
|
||||
{field: 'id', title: __('Id')},
|
||||
{field: 'platform', title: __('Platform'), searchList: {"admin":__('Platform admin'),"user":__('Platform user'),"shop":__('Platform shop')}, operate:'FIND_IN_SET', formatter: Table.api.formatter.label},
|
||||
{field: 'oper_type', title: __('Oper_type'), searchList: {"admin":__('Oper_type admin'),"user":__('Oper_type user'),"system":__('Oper_type system'),"shop":__('Oper_type shop')}, formatter: Table.api.formatter.normal},
|
||||
{field: 'oper_id', title: __('Oper_id')},
|
||||
{field: 'to_type', title: __('To_type'), searchList: {"admin":__('To_type admin'),"user":__('To_type user'),"system":__('To_type system'),"shop":__('To_type shop')}, formatter: Table.api.formatter.normal},
|
||||
{field: 'to_id', title: __('To_id')},
|
||||
{field: 'status', title: __('Status'), searchList: {"system":__('Status system'),"classes":__('Status classes'),"order":__('Status order')}, formatter: Table.api.formatter.status},
|
||||
{field: 'mini_type', title: __('Mini_type'), searchList: {"order_notice":__('Mini_type order_notice'),"classes_auth":__('Mini_type classes_auth'),"classes_apply":__('Mini_type classes_apply'),"shop_apply":__('Mini_type shop_apply'),"classes_order_notice":__('Mini_type classes_order_notice'),"user_auth":__('Mini_type user_auth'),"aftercare":__('Mini_type aftercare'),"other":__('Mini_type other')}, formatter: Table.api.formatter.normal},
|
||||
{field: 'title', title: __('Title'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
|
||||
{field: 'desc', title: __('Desc'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
|
||||
// {field: 'params', title: __('Params'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
|
||||
{field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
|
||||
{field: 'admin.nickname', title: __('Admin.nickname'), operate: 'LIKE'},
|
||||
{field: 'admin.avatar', title: __('Admin.avatar'), operate: 'LIKE', events: Table.api.events.image, formatter: Table.api.formatter.image},
|
||||
{field: 'user.nickname', title: __('User.nickname'), operate: 'LIKE'},
|
||||
{field: 'user.avatar', title: __('User.avatar'), operate: 'LIKE', 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}
|
||||
]
|
||||
]
|
||||
});
|
||||
|
||||
// 为表格绑定事件
|
||||
Table.api.bindevent(table);
|
||||
},
|
||||
add: function () {
|
||||
Controller.api.bindevent();
|
||||
},
|
||||
edit: function () {
|
||||
Controller.api.bindevent();
|
||||
},
|
||||
api: {
|
||||
bindevent: function () {
|
||||
Form.api.bindevent($("form[role=form]"));
|
||||
}
|
||||
}
|
||||
};
|
||||
return Controller;
|
||||
});
|
|
@ -0,0 +1,80 @@
|
|||
define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
|
||||
|
||||
var Controller = {
|
||||
index: function () {
|
||||
// 初始化表格参数配置
|
||||
Table.api.init({
|
||||
extend: {
|
||||
index_url: 'manystore/shop_log/index' + location.search,
|
||||
add_url: 'manystore/shop_log/add',
|
||||
edit_url: 'manystore/shop_log/edit',
|
||||
del_url: 'manystore/shop_log/del',
|
||||
multi_url: 'manystore/shop_log/multi',
|
||||
import_url: 'manystore/shop_log/import',
|
||||
table: 'manystore_shop_log',
|
||||
}
|
||||
});
|
||||
|
||||
var table = $("#table");
|
||||
|
||||
// 初始化表格
|
||||
table.bootstrapTable({
|
||||
url: $.fn.bootstrapTable.defaults.extend.index_url,
|
||||
pk: 'id',
|
||||
sortName: 'id',
|
||||
columns: [
|
||||
[
|
||||
{checkbox: true},
|
||||
{field: 'id', title: __('Id')},
|
||||
{field: 'shop_id', title: __('Shop_id')},
|
||||
{field: 'user_id', title: __('User_id')},
|
||||
{field: 'name', title: __('Name'), operate: 'LIKE'},
|
||||
{field: 'logo', title: __('Logo'), operate: 'LIKE'},
|
||||
{field: 'image', title: __('Image'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image},
|
||||
{field: 'address_city', title: __('Address_city'), operate: 'LIKE'},
|
||||
{field: 'province', title: __('Province')},
|
||||
{field: 'city', title: __('City')},
|
||||
{field: 'district', title: __('District')},
|
||||
{field: 'address', title: __('Address'), operate: 'LIKE'},
|
||||
{field: 'address_detail', title: __('Address_detail'), operate: 'LIKE'},
|
||||
{field: 'longitude', title: __('Longitude'), operate: 'LIKE'},
|
||||
{field: 'latitude', title: __('Latitude'), operate: 'LIKE'},
|
||||
{field: 'yyzzdm', title: __('Yyzzdm'), operate: 'LIKE'},
|
||||
{field: 'yyzz_images', title: __('Yyzz_images'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.images},
|
||||
{field: 'front_idcard_image', title: __('Front_idcard_image'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image},
|
||||
{field: 'reverse_idcard_image', title: __('Reverse_idcard_image'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image},
|
||||
{field: 'tel', title: __('Tel'), operate: 'LIKE'},
|
||||
{field: 'type', title: __('Type'), searchList: {"1":__('Type 1'),"2":__('Type 2')}, formatter: Table.api.formatter.normal},
|
||||
{field: 'desc', title: __('Desc'), operate: 'LIKE'},
|
||||
{field: 'status', title: __('Status'), searchList: {"0":__('Status 0'),"1":__('Status 1'),"2":__('Status 2')}, formatter: Table.api.formatter.status},
|
||||
{field: 'reason', title: __('Reason'), operate: 'LIKE'},
|
||||
{field: 'auth_time', title: __('Auth_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
|
||||
{field: 'admin_id', title: __('Admin_id')},
|
||||
{field: 'create_time', title: __('Create_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
|
||||
{field: 'update_time', title: __('Update_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
|
||||
{field: 'manystoreshop.name', title: __('Manystoreshop.name'), operate: 'LIKE'},
|
||||
{field: 'user.nickname', title: __('User.nickname'), operate: 'LIKE'},
|
||||
{field: 'user.mobile', title: __('User.mobile'), operate: 'LIKE'},
|
||||
{field: 'user.avatar', title: __('User.avatar'), operate: 'LIKE', 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}
|
||||
]
|
||||
]
|
||||
});
|
||||
|
||||
// 为表格绑定事件
|
||||
Table.api.bindevent(table);
|
||||
},
|
||||
add: function () {
|
||||
Controller.api.bindevent();
|
||||
},
|
||||
edit: function () {
|
||||
Controller.api.bindevent();
|
||||
},
|
||||
api: {
|
||||
bindevent: function () {
|
||||
Form.api.bindevent($("form[role=form]"));
|
||||
}
|
||||
}
|
||||
};
|
||||
return Controller;
|
||||
});
|
|
@ -0,0 +1,59 @@
|
|||
define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
|
||||
|
||||
var Controller = {
|
||||
index: function () {
|
||||
// 初始化表格参数配置
|
||||
Table.api.init({
|
||||
extend: {
|
||||
index_url: 'manystore/user_auth/index' + location.search,
|
||||
add_url: 'manystore/user_auth/add',
|
||||
edit_url: 'manystore/user_auth/edit',
|
||||
del_url: 'manystore/user_auth/del',
|
||||
multi_url: 'manystore/user_auth/multi',
|
||||
import_url: 'manystore/user_auth/import',
|
||||
table: 'manystore_user_auth',
|
||||
}
|
||||
});
|
||||
|
||||
var table = $("#table");
|
||||
|
||||
// 初始化表格
|
||||
table.bootstrapTable({
|
||||
url: $.fn.bootstrapTable.defaults.extend.index_url,
|
||||
pk: 'id',
|
||||
sortName: 'id',
|
||||
columns: [
|
||||
[
|
||||
{checkbox: true},
|
||||
{field: 'id', title: __('Id')},
|
||||
{field: 'shop_id', title: __('Shop_id')},
|
||||
{field: 'user_id', title: __('User_id')},
|
||||
{field: 'status', title: __('Status'), searchList: {"0":__('Status 0'),"1":__('Status 1'),"2":__('Status 2')}, formatter: Table.api.formatter.status},
|
||||
{field: 'auth_time', title: __('Auth_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: 'update_time', title: __('Update_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
|
||||
{field: 'manystoreshop.name', title: __('Manystoreshop.name'), operate: 'LIKE'},
|
||||
{field: 'user.nickname', title: __('User.nickname'), operate: 'LIKE'},
|
||||
{field: 'user.avatar', title: __('User.avatar'), operate: 'LIKE', 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}
|
||||
]
|
||||
]
|
||||
});
|
||||
|
||||
// 为表格绑定事件
|
||||
Table.api.bindevent(table);
|
||||
},
|
||||
add: function () {
|
||||
Controller.api.bindevent();
|
||||
},
|
||||
edit: function () {
|
||||
Controller.api.bindevent();
|
||||
},
|
||||
api: {
|
||||
bindevent: function () {
|
||||
Form.api.bindevent($("form[role=form]"));
|
||||
}
|
||||
}
|
||||
};
|
||||
return Controller;
|
||||
});
|
|
@ -115,6 +115,13 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
|||
|
||||
{field: 'type', title: __('Type'), searchList: {"out":__('Type out'),"in":__('Type in')}, formatter: Table.api.formatter.normal},
|
||||
{field: 'classes_num', title: __('Classes_num')},
|
||||
|
||||
{field: 'limit_num', title: __('Limit_num')},
|
||||
{field: 'sign_num', title: __('Sign_num')},
|
||||
{field: 'verification_num', title: __('Verification_num')},
|
||||
|
||||
|
||||
|
||||
{field: 'address_type', title: __('Address_type'), searchList: {"1":__('Address_type 1'),"2":__('Address_type 2')}, formatter: Table.api.formatter.normal},
|
||||
{field: 'sale', title: __('Sale')},
|
||||
{field: 'price', title: __('Price'), operate:'BETWEEN'},
|
||||
|
|
|
@ -0,0 +1,65 @@
|
|||
define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
|
||||
|
||||
var Controller = {
|
||||
index: function () {
|
||||
// 初始化表格参数配置
|
||||
Table.api.init({
|
||||
extend: {
|
||||
index_url: 'school/message/index' + location.search,
|
||||
add_url: 'school/message/add',
|
||||
edit_url: 'school/message/edit',
|
||||
del_url: 'school/message/del',
|
||||
multi_url: 'school/message/multi',
|
||||
import_url: 'school/message/import',
|
||||
table: 'school_message',
|
||||
}
|
||||
});
|
||||
|
||||
var table = $("#table");
|
||||
|
||||
// 初始化表格
|
||||
table.bootstrapTable({
|
||||
url: $.fn.bootstrapTable.defaults.extend.index_url,
|
||||
pk: 'id',
|
||||
sortName: 'id',
|
||||
columns: [
|
||||
[
|
||||
{checkbox: true},
|
||||
{field: 'id', title: __('Id')},
|
||||
{field: 'platform', title: __('Platform'), searchList: {"admin":__('Platform admin'),"user":__('Platform user'),"shop":__('Platform shop')}, operate:'FIND_IN_SET', formatter: Table.api.formatter.label},
|
||||
{field: 'oper_type', title: __('Oper_type'), searchList: {"admin":__('Oper_type admin'),"user":__('Oper_type user'),"system":__('Oper_type system'),"shop":__('Oper_type shop')}, formatter: Table.api.formatter.normal},
|
||||
{field: 'oper_id', title: __('Oper_id')},
|
||||
{field: 'to_type', title: __('To_type'), searchList: {"admin":__('To_type admin'),"user":__('To_type user'),"system":__('To_type system'),"shop":__('To_type shop')}, formatter: Table.api.formatter.normal},
|
||||
{field: 'to_id', title: __('To_id')},
|
||||
{field: 'status', title: __('Status'), searchList: {"system":__('Status system'),"classes":__('Status classes'),"order":__('Status order')}, formatter: Table.api.formatter.status},
|
||||
{field: 'mini_type', title: __('Mini_type'), searchList: {"order_notice":__('Mini_type order_notice'),"classes_auth":__('Mini_type classes_auth'),"classes_apply":__('Mini_type classes_apply'),"shop_apply":__('Mini_type shop_apply'),"classes_order_notice":__('Mini_type classes_order_notice'),"user_auth":__('Mini_type user_auth'),"aftercare":__('Mini_type aftercare'),"other":__('Mini_type other')}, formatter: Table.api.formatter.normal},
|
||||
{field: 'title', title: __('Title'), operate: 'LIKE'},
|
||||
{field: 'desc', title: __('Desc'), operate: 'LIKE'},
|
||||
{field: 'params', title: __('Params'), operate: 'LIKE'},
|
||||
{field: 'createtime', title: __('Createtime')},
|
||||
{field: 'admin.nickname', title: __('Admin.nickname'), operate: 'LIKE'},
|
||||
{field: 'admin.avatar', title: __('Admin.avatar'), operate: 'LIKE', events: Table.api.events.image, formatter: Table.api.formatter.image},
|
||||
{field: 'user.nickname', title: __('User.nickname'), operate: 'LIKE'},
|
||||
{field: 'user.avatar', title: __('User.avatar'), operate: 'LIKE', 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}
|
||||
]
|
||||
]
|
||||
});
|
||||
|
||||
// 为表格绑定事件
|
||||
Table.api.bindevent(table);
|
||||
},
|
||||
add: function () {
|
||||
Controller.api.bindevent();
|
||||
},
|
||||
edit: function () {
|
||||
Controller.api.bindevent();
|
||||
},
|
||||
api: {
|
||||
bindevent: function () {
|
||||
Form.api.bindevent($("form[role=form]"));
|
||||
}
|
||||
}
|
||||
};
|
||||
return Controller;
|
||||
});
|
Loading…
Reference in New Issue