1,首页装修数据后台管理(总后台端)

2,首页装修数据接口
3,机构申请审核管理(总后台端)
4,机构申请审核管理(机构后台端)-进行中
This commit is contained in:
15090180611 2024-11-16 18:01:16 +08:00
parent 72132ff273
commit 87b471510b
38 changed files with 1448 additions and 60 deletions

View File

@ -40,11 +40,12 @@ class Config extends Backend
/**
* 查看
*/
public function index()
public function index($group = null)
{
$siteList = [];
$groupList = ConfigModel::getGroupList();
$groupList = ConfigModel::getGroupList($group);
foreach ($groupList as $k => $v) {
if($group && $group!=$k)continue;
$siteList[$k]['name'] = $k;
$siteList[$k]['title'] = $v;
$siteList[$k]['list'] = [];
@ -147,7 +148,9 @@ class Config extends Backend
} else {
$value = is_array($value) ? implode(',', $value) : $value;
}
$v['value'] = $value;
//$value去掉两端空格
$value = trim($value);
$v['value'] = $value ;
$configList[] = $v->toArray();
}
}

View File

@ -2,6 +2,8 @@
namespace app\admin\controller\manystore;
use app\admin\model\User;
use app\common\model\school\classes\Order;
use app\manystore\model\Manystore;
use app\manystore\model\ManystoreShop;
use app\manystore\model\ManystoreAuthGroup;
@ -31,12 +33,28 @@ class Index extends Backend
protected $childrenGroupIds = [];
protected $childrenAdminIds = [];
//不用审核允许修改的字段
protected $no_auth_fields = ['image','images','address_city','province',"city","district","address","address_detail",
"longitude","latitude","content","desc"
];
//更新数据是否需要触发审核开关
protected $need_auth = false;
protected $have_auth = false;
protected $success_auth = false;
protected $error_auth = false;
public function _initialize()
{
parent::_initialize();
$this->model = new Manystore();
$this->shopModel = new ManystoreShop();
$this->view->assign("statusList", $this->shopModel->getStatusList());
$this->view->assign("typeList", $this->shopModel->getTypeList());
}
/**
@ -44,6 +62,10 @@ class Index extends Backend
*/
public function index()
{
//当前是否为关联查询
$this->relationSearch = true;
//设置过滤方法
$this->request->filter(['strip_tags', 'trim']);
if ($this->request->isAjax()) {
//如果发送的来源是Selectpage则转发到Selectpage
if ($this->request->request('keyField')) {
@ -51,16 +73,21 @@ class Index extends Backend
}
list($where, $sort, $order, $offset, $limit) = $this->buildparams();
$total = $this->model
->with(['shop',"user"])
->where($where)
->where(array('is_main'=>1))
->order($sort, $order)
->count();
$list = $this->model
->with(['shop',"user"])
->where($where)
->where(array('is_main'=>1))
->field(['password', 'salt', 'token'], true)
// ->field(['password', 'salt', 'token'], true)
->order($sort, $order)
->limit($offset, $limit)
->select();
@ -72,6 +99,160 @@ class Index extends Backend
return $this->view->fetch();
}
protected function authClasses(&$params,&$shop,$row=null){
//审核失败需填写原因
if($shop["status"] == '2' && empty($shop["reason"])){
$this->error("审核失败需填写原因");
}
if($shop["status"] == '2'){
//审核不通过会平台下架
$params["status"] = 'hidden';
}
//更新
if($row){
if($shop["status"] != '1' && $row["status"] == '1'){
$this->error("审核已通过的课程不允许再修改审核状态!");
}
if($shop["status"] != '0' && $row["status"] == '0'){
//填写审核时间和审核人
$shop["auth_time"] = time();
$shop["admin_id"] = $this->auth->id;
if($shop["status"] == '1'){
//审核通过
$this->success_auth = true;
}
if($shop["status"] == '2'){
//审核通过
$this->error_auth = true;
}
}
//审核通过
if($this->success_auth){
//如果是平台下架,则更新成正常下架
if($params["status"] == 'hidden') $params["status"] = 'normal';
//调用通过事件
$data = ['shop' => $row];
\think\Hook::listen('shop_auth_success_after', $data);
}
if($this->error_auth){
//审核不通过会平台下架
$params["status"] = 'hidden';
//调用通过事件
//调用通过事件
$data = ['shop' => $row];
\think\Hook::listen('shop_auth_fail_after', $data);
}
}else{
//新增
}
}
protected function updateCheck($id,$params=[],$shop=[],$row=null){
if($shop && $row){
if(!$this->no_auth_fields_check($shop,$row)){
return true;
}
}
// 课程存在未完成订单则不允许操作
$order = Order::where("manystore_id",$id)->where("status","in","0,3")->find();
if($order)$this->error("存在正在使用中的课程订单或存在正在售后中的课程订单无法继续操作!");
// 课程存在售后订单则不允许操作
}
protected function update_check(&$params,&$shop,$row=null)
{
$shop["user_id"] = $params["user_id"];
if(!$shop["user_id"])throw new \Exception("认证用户不存在!");
$user = User::get($shop["user_id"]);
if(!$user) throw new \Exception("认证用户不存在!");
//独立地点需传定位信息
// if(empty($params["address_city"])
// || empty($params["province"])
// || empty($params["city"])
// || empty($params["district"])
// || empty($params["longitude"])
// || empty($params["latitude"])) $this->error("独立地点需传定位信息");
//特有认证判断
$this->authClasses($params,$shop,$row);
// var_dump($row);die;
//更新
if($row){
$this->have_auth = false;
if($this->need_auth){
//判断更新的变动数据
$this->no_auth_fields_check($params,$shop,$row);
if($this->have_auth){
//注释掉先不一刀切
// $params['status'] = "hidden";
$shop['status'] = "0";
}
}
$this->updateCheck($row->id,$params,$shop,$row);
//名称title不能与其他课程重复
$check_title = $this->shopModel->where('id','<>',$row["id"])->where('name',$shop["name"])->find();
if($check_title){
$this->error("机构或个人认证名称已存在或被其他机构占用,请更改!");
}
//user_id不能与其他机构重复
$check_user_id = $this->shopModel->where('id','<>',$row["id"])->where('user_id',$shop["user_id"])->find();
if($check_user_id){
$this->error("机构或个人认证用户已存在或被其他机构占用,请更改!");
}
}else{
//新增
//名称title不能重复
$check_title = $this->shopModel->where('name',$shop["name"])->find();
if($check_title){
$this->error("机构或个人认证名称已存在或被其他机构占用,请更改!");
}
//user_id不能与其他机构重复
$check_user_id = $this->shopModel->where('user_id',$shop["user_id"])->find();
if($check_user_id){
$this->error("机构或个人认证用户已存在或被其他机构占用,请更改!");
}
}
}
/**
* 添加
*/
@ -88,6 +269,8 @@ class Index extends Backend
db()->startTrans();
try{
$shop["user_id"] = $params['user_id'];
$this->update_check($params,$shop,$row=null);
$shop_info = $this->shopModel->save($shop);
if($shop_info === false){
$this->error($this->shopModel->getError());
@ -157,7 +340,8 @@ class Index extends Backend
$params = $this->request->post("row/a");
$shop = $this->request->post("shop/a");
if ($params) {
$shop["user_id"] = $params['user_id'];
$this->update_check($params,$shop,$shop_info);
$result = $shop_info->save($shop);
if($result === false){
$this->error(__("修改商家信息资料失败"));
@ -213,6 +397,9 @@ class Index extends Backend
if(!$row){
$this->error(__('No Results were found'));
}
$this->updateCheck($ids);
db()->startTrans();
try{
$result = $row->delete();

View File

@ -186,6 +186,9 @@ class ClassesLib extends Backend
if(!$manystore){
$this->error("店铺不存在");
}
if(!(new \app\common\model\dyqc\ManystoreShop)->checkFull($shop_id))$this->error("对方的认证信息未完善,请您先去帮忙完善!");
$params["manystore_id"] = $manystore["id"];
@ -258,6 +261,7 @@ class ClassesLib extends Backend
$params["feel"] = "0";
}
//更新
if($row){
$this->have_auth = false;

View File

@ -41,6 +41,7 @@ class Teacher extends Backend
parent::_initialize();
$this->view->assign("statusList", $this->model->getStatusList());
$this->view->assign("recommendList", $this->model->getRecommendList());
}

View File

@ -0,0 +1,37 @@
<?php
namespace app\admin\controller\style;
use app\common\controller\Backend;
/**
* 夜校首页轮播图
*
* @icon fa fa-circle-o
*/
class HomeImages extends Backend
{
/**
* HomeImages模型对象
* @var \app\admin\model\style\HomeImages
*/
protected $model = null;
public function _initialize()
{
parent::_initialize();
$this->model = new \app\admin\model\style\HomeImages;
$this->view->assign("typeList", $this->model->getTypeList());
}
/**
* 默认生成的控制器所继承的父类中有index/add/edit/del/multi五个基础方法、destroy/restore/recyclebin三个回收站方法
* 因此在当前控制器中可不用编写增删改查的代码,除非需要自己控制这部分逻辑
* 需要将application/admin/library/traits/Backend.php中对应的方法复制到当前控制器,然后进行修改
*/
}

View File

@ -9,27 +9,45 @@ return [
'Please input correct nickname' => '昵称仅支持输入中文、英文字母(大小写)、数字、下划线',
'Please input length nickname' => '昵称请最多填写10个字符',
'Logo' => '商家Logo',
'Name' => '店铺名称',
'Image' => '店铺封面图',
'Images' => '店铺环境图片',
'user_id' => '申请用户',
'Logo' => 'Logo',
'Name' => '申请人姓名|机构名称',
'Image' => '封面图',
'Images' => '环境图片',
'Address_city' => '城市选择',
'Province' => '省编号',
'City' => '市编号',
'District' => '县区编号',
'Address' => '店铺地址',
'Address_detail' => '店铺详细地址',
'Address' => '地址',
'Address_detail' => '详细地址',
'Longitude' => '经度',
'Latitude' => '纬度',
'Yyzzdm' => '营业执照',
'Yyzz_images' => '营业执照照片',
'Yyzzdm' => '营业执照号(个人认证不需要)',
'Yyzz_images' => '营业执照照片(个人认证不需要)',
'hidden' => '禁用',
'Front_idcard_image' => '身份证正面',
'Reverse_idcard_image' => '身份证反面',
'Tel' => '服务电话',
'Content' => '店铺详情',
'Status' => '审核状态',
'Content' => '详情',
'Status' => '账号状态',
'Status 0' => '待审核',
'Status 1' => '审核通过',
'Status 2' => '审核失败',
'Status 2' => '审核不通过',
'Reason' => '审核不通过原因',
'Create_time' => '创建时间',
'Update_time' => '修改时间'
'Update_time' => '修改时间',
'Auth_status' => '审核状态',
'Auth_status 0' => '待审核',
'Auth_status 1' => '审核通过',
'Auth_status 2' => '审核不通过',
'Auth_time' => '审核时间',
'Admin_id' => '审核管理员id',
'User.nickname' => '昵称',
'User.mobile' => '手机号',
'User.avatar' => '头像',
'Type' => '认证类型',
'Type 1' => '个人认证',
'Type 2' => '机构认证',
'Desc' => '申请备注',
];

View File

@ -0,0 +1,52 @@
<?php
return [
'Group' => '所属组别',
'Loginfailure' => '登录失败次数',
'Login time' => '最后登录',
'Please input correct username' => '用户名只能由3-12位数字、字母、下划线组合',
'Please input correct password' => '密码长度必须在6-16位之间不能包含空格',
'Please input correct nickname' => '昵称仅支持输入中文、英文字母(大小写)、数字、下划线',
'Please input length nickname' => '昵称请最多填写10个字符',
'Logo' => 'Logo',
'Name' => '名称',
'Image' => '封面图',
'Images' => '环境图片',
'Address_city' => '城市选择',
'Province' => '省编号',
'City' => '市编号',
'District' => '县区编号',
'Address' => '地址',
'Address_detail' => '详细地址',
'Longitude' => '经度',
'Latitude' => '纬度',
'Yyzzdm' => '营业执照号',
'Yyzz_images' => '营业执照照片',
'hidden' => '禁用',
'Front_idcard_image' => '身份证正面',
'Reverse_idcard_image' => '身份证反面',
'Tel' => '服务电话',
'Content' => '详情',
'Status' => '账号状态',
'Status 0' => '待审核',
'Status 1' => '审核通过',
'Status 2' => '审核不通过',
'Reason' => '审核不通过原因',
'Create_time' => '创建时间',
'Update_time' => '修改时间',
'Auth_status' => '审核状态',
'Auth_status 0' => '待审核',
'Auth_status 1' => '审核通过',
'Auth_status 2' => '审核不通过',
'Auth_time' => '审核时间',
'Admin_id' => '审核管理员id',
'User.nickname' => '昵称',
'User.mobile' => '手机号',
'User.avatar' => '头像',
'Type' => '类型',
'Type 1' => '个人',
'Type 2' => '机构',
'Desc' => '申请备注',
];

View File

@ -0,0 +1,52 @@
<?php
return [
'Group' => '所属组别',
'Loginfailure' => '登录失败次数',
'Login time' => '最后登录',
'Please input correct username' => '用户名只能由3-12位数字、字母、下划线组合',
'Please input correct password' => '密码长度必须在6-16位之间不能包含空格',
'Please input correct nickname' => '昵称仅支持输入中文、英文字母(大小写)、数字、下划线',
'Please input length nickname' => '昵称请最多填写10个字符',
'Logo' => 'Logo',
'Name' => '名称',
'Image' => '封面图',
'Images' => '环境图片',
'Address_city' => '城市选择',
'Province' => '省编号',
'City' => '市编号',
'District' => '县区编号',
'Address' => '地址',
'Address_detail' => '详细地址',
'Longitude' => '经度',
'Latitude' => '纬度',
'Yyzzdm' => '营业执照号',
'Yyzz_images' => '营业执照照片',
'hidden' => '禁用',
'Front_idcard_image' => '身份证正面',
'Reverse_idcard_image' => '身份证反面',
'Tel' => '服务电话',
'Content' => '详情',
'Status' => '账号状态',
'Status 0' => '待审核',
'Status 1' => '审核通过',
'Status 2' => '审核不通过',
'Reason' => '审核不通过原因',
'Create_time' => '创建时间',
'Update_time' => '修改时间',
'Auth_status' => '审核状态',
'Auth_status 0' => '待审核',
'Auth_status 1' => '审核通过',
'Auth_status 2' => '审核不通过',
'Auth_time' => '审核时间',
'Admin_id' => '审核管理员id',
'User.nickname' => '昵称',
'User.mobile' => '手机号',
'User.avatar' => '头像',
'Type' => '类型',
'Type 1' => '个人',
'Type 2' => '机构',
'Desc' => '申请备注',
];

View File

@ -30,5 +30,8 @@ return [
'Shop.city' => '市编号',
'Shop.district' => '县区编号',
'Shop.address' => '店铺地址',
'Shop.address_detail' => '店铺详细地址'
'Shop.address_detail' => '店铺详细地址',
'Recommend' => '平台首页推荐',
'Recommend 0' => '否',
'Recommend 1' => '是',
];

View File

@ -0,0 +1,12 @@
<?php
return [
'Image' => '展示图',
'Type' => '跳转类型',
'Type in' => '内部跳转',
'Type out' => '外部跳转',
'Url' => '跳转链接',
'Weigh' => '权重',
'Createtime' => '创建时间',
'Deletetime' => '删除时间'
];

View File

@ -25,7 +25,8 @@ class Teacher extends Model
// 追加属性
protected $append = [
'status_text'
'status_text',
'recommend_text',
];
@ -39,7 +40,17 @@ class Teacher extends Model
if (!empty($value)) return cdnurl($value, true);
}
public function getRecommendList()
{
return ['0' => __('Recommend 0'), '1' => __('Recommend 1')];
}
public function getRecommendTextAttr($value, $data)
{
$value = $value ? $value : (isset($data['recommend']) ? $data['recommend'] : '');
$list = $this->getRecommendList();
return isset($list[$value]) ? $list[$value] : '';
}
protected static function init()

View File

@ -0,0 +1,59 @@
<?php
namespace app\admin\model\style;
use think\Model;
use traits\model\SoftDelete;
class HomeImages extends Model
{
use SoftDelete;
// 表名
protected $name = 'school_home_images';
// 自动写入时间戳字段
protected $autoWriteTimestamp = 'integer';
// 定义时间戳字段名
protected $createTime = 'createtime';
protected $updateTime = false;
protected $deleteTime = 'deletetime';
// 追加属性
protected $append = [
'type_text'
];
protected static function init()
{
self::afterInsert(function ($row) {
if (!$row['weigh']) {
$pk = $row->getPk();
$row->getQuery()->where($pk, $row[$pk])->update(['weigh' => $row[$pk]]);
}
});
}
public function getTypeList()
{
return ['in' => __('Type in'), 'out' => __('Type out')];
}
public function getTypeTextAttr($value, $data)
{
$value = $value ? $value : (isset($data['type']) ? $data['type'] : '');
$list = $this->getTypeList();
return isset($list[$value]) ? $list[$value] : '';
}
}

View File

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

View File

@ -35,6 +35,13 @@
<input type="password" class="form-control" id="password" name="row[password]" autocomplete="new-password" value="" data-rule="required;password" placeholder="请输入{:__('Password')}" />
</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">
@ -51,13 +58,27 @@
<div class="panel panel-default panel-intro">
<div class="panel-heading">
<ul class="nav nav-tabs">
<li class="active"><a href="#basic" data-toggle="tab">商家信息</a></li>
<li class="active"><a href="#basic" data-toggle="tab">机构信息 OR 个人信息</a></li>
</ul>
</div>
<div class="panel-body">
<div id="storeContent" class="tab-content">
<div class="tab-pane fade active in" id="shop_basic">
<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="shop[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">{:__('Name')}:</label>
<div class="col-xs-12 col-sm-8">
@ -86,7 +107,7 @@
<label class="control-label col-xs-12 col-sm-2">{:__('Image')}:</label>
<div class="col-xs-12 col-sm-8">
<div class="input-group">
<input id="c-image" data-rule="required" class="form-control" size="50" name="shop[image]" type="text" value="" placeholder="请上传{:__('Image')}" >
<input id="c-image" class="form-control" size="50" name="shop[image]" type="text" value="" placeholder="请上传{:__('Image')}" >
<div class="input-group-addon no-border no-padding">
<span><button type="button" id="plupload-image" class="btn btn-danger plupload cropper" 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>
@ -114,7 +135,7 @@
<label class="control-label col-xs-12 col-sm-2">{:__('Address_city')}:</label>
<div class="col-xs-12 col-sm-8">
<div class='control-relative'>
<input id="c-address_city" data-rule="required" class="form-control form-control" data-toggle="city-picker" name="shop[address_city]" value="" type="text">
<input id="c-address_city" class="form-control form-control" data-toggle="city-picker" name="shop[address_city]" value="" type="text">
</div>
<input type="hidden" id="province" name="shop[province]" value="" >
<input type="hidden" id="city" name="shop[city]" value="" >
@ -125,7 +146,7 @@
<label class="control-label col-xs-12 col-sm-2">{:__('Address')}:</label>
<div class="col-xs-12 col-sm-8">
<div class='control-relative'>
<input id="c-address" data-rule="required" class="form-control form-control"
<input id="c-address" class="form-control form-control"
data-lat-id="c-latitude" data-lng-id="c-longitude" readonly data-input-id="c-address" data-toggle="addresspicker" name="shop[address]" value="" type="text" placeholder="请地图选址。如调起地图失败请检查插件《地图位置(经纬度)选择》是否安装">
</div>
</div>
@ -139,24 +160,28 @@
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Longitude')}:</label>
<div class="col-xs-12 col-sm-3">
<input id="c-longitude" data-rule="required" readonly class="form-control" name="shop[longitude]" type="text" value="">
<input id="c-longitude" readonly class="form-control" name="shop[longitude]" type="text" value="">
</div>
<label class="control-label col-xs-12 col-sm-2">{:__('Latitude')}:</label>
<div class="col-xs-12 col-sm-3">
<input id="c-latitude" data-rule="required" readonly class="form-control" name="shop[latitude]" type="text" value="">
<input id="c-latitude" readonly class="form-control" name="shop[latitude]" type="text" value="">
</div>
</div>
<div class="shop_auth">
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Yyzzdm')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-yyzzdm" data-rule="required" class="form-control" name="shop[yyzzdm]" type="text" value="" placeholder="请输入{:__('Yyzzdm')}">
<input id="c-yyzzdm" class="form-control" name="shop[yyzzdm]" type="text" value="" placeholder="请输入{:__('Yyzzdm')}">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Yyzz_images')}:</label>
<div class="col-xs-12 col-sm-8">
<div class="input-group">
<input id="c-yyzz_images" data-rule="required" class="form-control" size="50" name="shop[yyzz_images]" type="text" value="" placeholder="请输入{:__('Yyzz_images')}">
<input id="c-yyzz_images" class="form-control" size="50" name="shop[yyzz_images]" type="text" value="" placeholder="请输入{:__('Yyzz_images')}">
<div class="input-group-addon no-border no-padding">
<span><button type="button" id="plupload-yyzz_images" class="btn btn-danger plupload" 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>
@ -166,10 +191,46 @@
<ul class="row list-inline plupload-preview" id="p-yyzz_images"></ul>
</div>
</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" data-rule="required" class="form-control" size="50" name="shop[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" data-rule="required" class="form-control" size="50" name="shop[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="shop[tel]" type="text" value="" placeholder="请输入{:__('Tel')}">
<input id="c-tel" class="form-control" data-rule="required" name="shop[tel]" type="text" value="" placeholder="请输入{:__('Tel')}">
</div>
</div>
@ -179,12 +240,41 @@
<textarea id="c-content" class="form-control editor" rows="5" name="shop[content]" cols="50" placeholder="请输入{:__('Content')}"></textarea>
</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="shop[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">
{:build_radios('shop[status]', ['0'=>__('Status 0'), '1'=>__('Status 1'), '2'=>__('Status 2')],1)}
</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="shop[reason]" type="text" value="">
</div>
</div>
</div>
</div>
</div>

View File

@ -35,6 +35,14 @@
<input type="password" class="form-control" id="password" name="row[password]" autocomplete="new-password" value="" data-rule="password" placeholder="不修改则留空" />
</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 for="loginfailure" class="control-label col-xs-12 col-sm-2">{:__('Loginfailure')}:</label>
<div class="col-xs-12 col-sm-8">
@ -58,13 +66,28 @@
<div class="panel panel-default panel-intro">
<div class="panel-heading">
<ul class="nav nav-tabs">
<li class="active"><a href="#basic" data-toggle="tab">商家信息</a></li>
<li class="active"><a href="#basic" data-toggle="tab">机构信息 OR 个人信息</a></li>
</ul>
</div>
<div class="panel-body">
<div id="storeContent" class="tab-content">
<div class="tab-pane fade active in" id="shop_basic">
<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="shop[type]">
{foreach name="typeList" item="vo"}
<option value="{$key}" {in name="key" value="$shop.type"}selected{/in}>{$vo}</option>
{/foreach}
</select>
</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">
@ -93,7 +116,7 @@
<label class="control-label col-xs-12 col-sm-2">{:__('Image')}:</label>
<div class="col-xs-12 col-sm-8">
<div class="input-group">
<input id="c-image" data-rule="required" class="form-control" size="50" name="shop[image]" type="text" value="{$shop.image}" placeholder="请上传{:__('Image')}" >
<input id="c-image" class="form-control" size="50" name="shop[image]" type="text" value="{$shop.image}" placeholder="请上传{:__('Image')}" >
<div class="input-group-addon no-border no-padding">
<span><button type="button" id="plupload-image" class="btn btn-danger plupload cropper" 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>
@ -121,18 +144,18 @@
<label class="control-label col-xs-12 col-sm-2">{:__('Address_city')}:</label>
<div class="col-xs-12 col-sm-8">
<div class='control-relative'>
<input id="c-address_city" data-rule="required" class="form-control form-control" data-toggle="city-picker" name="shop[address_city]" value="{$shop.address_city}" type="text">
<input id="c-address_city" class="form-control form-control" data-toggle="city-picker" name="shop[address_city]" value="{$shop.address_city}" type="text">
</div>
<input type="hidden" id="province" name="shop[province]" value="" >
<input type="hidden" id="city" name="shop[city]" value="" >
<input type="hidden" id="district" name="shop[district]" value="" >
<input type="hidden" id="province" name="shop[province]" value="{$shop.province}" >
<input type="hidden" id="city" name="shop[city]" value="{$shop.city}" >
<input type="hidden" id="district" name="shop[district]" value="{$shop.district}" >
</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">
<div class='control-relative'>
<input id="c-address" data-rule="required" class="form-control form-control"
<input id="c-address" class="form-control form-control"
data-lat-id="c-latitude" data-lng-id="c-longitude" readonly data-input-id="c-address" data-toggle="addresspicker" name="shop[address]" value="{$shop.address}" type="text" placeholder="请地图选址。如调起地图失败请检查插件《地图位置(经纬度)选择》是否安装">
</div>
</div>
@ -146,24 +169,27 @@
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Longitude')}:</label>
<div class="col-xs-12 col-sm-3">
<input id="c-longitude" data-rule="required" readonly class="form-control" name="shop[longitude]" type="text" value="{$shop.longitude}">
<input id="c-longitude" readonly class="form-control" name="shop[longitude]" type="text" value="{$shop.longitude}">
</div>
<label class="control-label col-xs-12 col-sm-2">{:__('Latitude')}:</label>
<div class="col-xs-12 col-sm-3">
<input id="c-latitude" data-rule="required" readonly class="form-control" name="shop[latitude]" type="text" value="{$shop.latitude}">
<input id="c-latitude" readonly class="form-control" name="shop[latitude]" type="text" value="{$shop.latitude}">
</div>
</div>
<div class="shop_auth" >
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Yyzzdm')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-yyzzdm" data-rule="required" class="form-control" name="shop[yyzzdm]" type="text" value="{$shop.yyzzdm}" placeholder="请输入{:__('Yyzzdm')}">
<input id="c-yyzzdm" class="form-control" name="shop[yyzzdm]" type="text" value="{$shop.yyzzdm}" placeholder="请输入{:__('Yyzzdm')}">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Yyzz_images')}:</label>
<div class="col-xs-12 col-sm-8">
<div class="input-group">
<input id="c-yyzz_images" data-rule="required" class="form-control" size="50" name="shop[yyzz_images]" type="text" value="{$shop.yyzz_images}" placeholder="请输入{:__('Yyzz_images')}">
<input id="c-yyzz_images" class="form-control" size="50" name="shop[yyzz_images]" type="text" value="{$shop.yyzz_images}" placeholder="请输入{:__('Yyzz_images')}">
<div class="input-group-addon no-border no-padding">
<span><button type="button" id="plupload-yyzz_images" class="btn btn-danger plupload" 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>
@ -173,10 +199,51 @@
<ul class="row list-inline plupload-preview" id="p-yyzz_images"></ul>
</div>
</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" data-rule="required" class="form-control" size="50" name="shop[front_idcard_image]" type="text" value="{$shop.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" data-rule="required" class="form-control" size="50" name="shop[reverse_idcard_image]" type="text" value="{$shop.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="shop[tel]" type="text" value="{$shop.tel}" placeholder="请输入{:__('Tel')}">
<input id="c-tel" class="form-control" data-rule="required" name="shop[tel]" type="text" value="{$shop.tel}" placeholder="请输入{:__('Tel')}">
</div>
</div>
@ -187,12 +254,39 @@
</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="shop[desc]" type="text" value="{$shop.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">
{:build_radios('shop[status]', ['0'=>__('Status 0'), '1'=>__('Status 1'), '2'=>__('Status 2')], $shop['status'])}
</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="shop[reason]" type="text" value="{$shop.reason|htmlentities}">
</div>
</div>
</div>
</div>
</div>

View File

@ -1,5 +1,13 @@
<div class="panel panel-default panel-intro">
{:build_heading()}
<div class="panel-heading">
{:build_heading(null,FALSE)}
<ul class="nav nav-tabs" data-field="shop.status">
<li class="{:$Think.get.shop.status === null ? 'active' : ''}"><a href="#t-all" data-value="" data-toggle="tab">{:__('All')}</a></li>
{foreach name="statusList" item="vo"}
<li class="{:$Think.get.shop.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">

View File

@ -134,7 +134,7 @@
<div id="c_position">
<div id="c_position" {eq name="$row.address_type" value="1"} style="display: none" {/eq} >
<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">

View File

@ -56,6 +56,20 @@
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Recommend')}:</label>
<div class="col-xs-12 col-sm-8">
<select id="c-recommend" class="form-control selectpicker" name="row[recommend]">
{foreach name="recommendList" item="vo"}
<option value="{$key}" {in name="key" value="0"}selected{/in}>{$vo}</option>
{/foreach}
</select>
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Expert_image')}:</label>
<div class="col-xs-12 col-sm-8">

View File

@ -56,6 +56,21 @@
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Recommend')}:</label>
<div class="col-xs-12 col-sm-8">
<select id="c-recommend" class="form-control selectpicker" name="row[recommend]">
{foreach name="recommendList" item="vo"}
<option value="{$key}" {in name="key" value="$row.recommend"}selected{/in}>{$vo}</option>
{/foreach}
</select>
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Expert_image')}:</label>
<div class="col-xs-12 col-sm-8">

View File

@ -0,0 +1,47 @@
<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">{:__('Image')}:</label>
<div class="col-xs-12 col-sm-8">
<div class="input-group">
<input id="c-image" data-rule="required" class="form-control" size="50" name="row[image]" type="text">
<div class="input-group-addon no-border no-padding">
<span><button type="button" id="faupload-image" class="btn btn-danger faupload" data-input-id="c-image" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp,image/webp" data-multiple="false" data-preview-id="p-image"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
<span><button type="button" id="fachoose-image" class="btn btn-primary fachoose" data-input-id="c-image" data-mimetype="image/*" data-multiple="false"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
</div>
<span class="msg-box n-right" for="c-image"></span>
</div>
<ul class="row list-inline faupload-preview" id="p-image"></ul>
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('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="1"}selected{/in}>{$vo}</option>
{/foreach}
</select>
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Url')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-url" data-rule="required" class="form-control" name="row[url]" type="text">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Weigh')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-weigh" class="form-control" name="row[weigh]" type="number" value="0">
</div>
</div>
<div class="form-group layer-footer">
<label class="control-label col-xs-12 col-sm-2"></label>
<div class="col-xs-12 col-sm-8">
<button type="submit" class="btn btn-primary btn-embossed disabled">{:__('OK')}</button>
</div>
</div>
</form>

View File

@ -0,0 +1,47 @@
<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">{:__('Image')}:</label>
<div class="col-xs-12 col-sm-8">
<div class="input-group">
<input id="c-image" data-rule="required" class="form-control" size="50" name="row[image]" type="text" value="{$row.image|htmlentities}">
<div class="input-group-addon no-border no-padding">
<span><button type="button" id="faupload-image" class="btn btn-danger faupload" data-input-id="c-image" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp,image/webp" data-multiple="false" data-preview-id="p-image"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
<span><button type="button" id="fachoose-image" class="btn btn-primary fachoose" data-input-id="c-image" data-mimetype="image/*" data-multiple="false"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
</div>
<span class="msg-box n-right" for="c-image"></span>
</div>
<ul class="row list-inline faupload-preview" id="p-image"></ul>
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('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">{:__('Url')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-url" data-rule="required" class="form-control" name="row[url]" type="text" value="{$row.url|htmlentities}">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Weigh')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-weigh" class="form-control" name="row[weigh]" type="number" value="{$row.weigh|htmlentities}">
</div>
</div>
<div class="form-group layer-footer">
<label class="control-label col-xs-12 col-sm-2"></label>
<div class="col-xs-12 col-sm-8">
<button type="submit" class="btn btn-primary btn-embossed disabled">{:__('OK')}</button>
</div>
</div>
</form>

View File

@ -0,0 +1,29 @@
<div class="panel panel-default panel-intro">
{:build_heading()}
<div class="panel-body">
<div id="myTabContent" class="tab-content">
<div class="tab-pane fade active in" id="one">
<div class="widget-body no-padding">
<div id="toolbar" class="toolbar">
<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('style/home_images/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('style/home_images/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('style/home_images/del')?'':'hide'}" title="{:__('Delete')}" ><i class="fa fa-trash"></i> {:__('Delete')}</a>
<a class="btn btn-success btn-recyclebin btn-dialog {:$auth->check('style/home_images/recyclebin')?'':'hide'}" href="style/home_images/recyclebin" title="{:__('Recycle bin')}"><i class="fa fa-recycle"></i> {:__('Recycle bin')}</a>
</div>
<table id="table" class="table table-striped table-bordered table-hover table-nowrap"
data-operate-edit="{:$auth->check('style/home_images/edit')}"
data-operate-del="{:$auth->check('style/home_images/del')}"
width="100%">
</table>
</div>
</div>
</div>
</div>
</div>

View File

@ -0,0 +1,25 @@
<div class="panel panel-default panel-intro">
{:build_heading()}
<div class="panel-body">
<div id="myTabContent" class="tab-content">
<div class="tab-pane fade active in" id="one">
<div class="widget-body no-padding">
<div id="toolbar" class="toolbar">
{:build_toolbar('refresh')}
<a class="btn btn-info btn-multi btn-disabled disabled {:$auth->check('style/home_images/restore')?'':'hide'}" href="javascript:;" data-url="style/home_images/restore" data-action="restore"><i class="fa fa-rotate-left"></i> {:__('Restore')}</a>
<a class="btn btn-danger btn-multi btn-disabled disabled {:$auth->check('style/home_images/destroy')?'':'hide'}" href="javascript:;" data-url="style/home_images/destroy" data-action="destroy"><i class="fa fa-times"></i> {:__('Destroy')}</a>
<a class="btn btn-success btn-restoreall {:$auth->check('style/home_images/restore')?'':'hide'}" href="javascript:;" data-url="style/home_images/restore" title="{:__('Restore all')}"><i class="fa fa-rotate-left"></i> {:__('Restore all')}</a>
<a class="btn btn-danger btn-destroyall {:$auth->check('style/home_images/destroy')?'':'hide'}" href="javascript:;" data-url="style/home_images/destroy" title="{:__('Destroy all')}"><i class="fa fa-times"></i> {:__('Destroy all')}</a>
</div>
<table id="table" class="table table-striped table-bordered table-hover"
data-operate-restore="{:$auth->check('style/home_images/restore')}"
data-operate-destroy="{:$auth->check('style/home_images/destroy')}"
width="100%">
</table>
</div>
</div>
</div>
</div>
</div>

View File

@ -3,6 +3,7 @@
namespace app\api\controller;
use app\common\controller\Api;
use app\common\model\style\HomeImages;
/**
* 首页接口
@ -21,6 +22,22 @@ class Index extends Api
$this->success('请求成功');
}
/**
* 各种协议文章
* @ApiSummary(about_us 关于夜校 site.entry_agreement 入驻协议)
* @ApiMethod (GET)
*/
public function agreement()
{
$data = [
'about_us' => config("site.about_us"),
'entry_agreement' => config("site.entry_agreement")
];
$this->success(__('查询成功'), $data);
}
@ -37,7 +54,24 @@ class Index extends Api
*/
public function init() {
$this->success('',[]);
$home_data = [];
$home_data['top_image'] = [
'type' => config('site.home_top_type'),
'image' => cdnurl(config('site.home_top_image'), true),
'url' => config('site.home_top_url'),
];
//首页轮播图
$home_data['top_images'] = HomeImages::allList(1, 20);
$base_info = [
"site_name"=>config('site.name'),
// "site_logo"=>cdnurl(config('site.logo'), true),
"site_beian"=>config('site.beian'),
"site_version"=>''.config('site.version'),
"site_city"=>config('site.the_city'),
"site_timezone"=>config('site.timezone'),
];
$this->success('',["base_info"=>$base_info,"home_data"=>$home_data]);
}

View File

@ -9,7 +9,7 @@ use app\common\model\school\classes\Teacher as Teachermodel;
*/
class Teacher extends Base
{
protected $noNeedLogin = ["detail",'people','spec'];
protected $noNeedLogin = ["detail",'people','spec',"teacher_list"];
protected $noNeedRight = '*';
protected $model = null;
@ -53,5 +53,60 @@ class Teacher extends Base
}
$this->success('获取成功', ['detail' => $res]);
}
/**
* @ApiTitle( 老师或专家列表(取决于搜索条件))
* @ApiSummary(老师或专家列表(取决于搜索条件))
* @ApiRoute(/api/school/teacher/teacher_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 = "status", type = "string",required=false,description = "查展示专家请传1非专家也查请传0")
* @ApiParams(name = "recommend", type = "string",required=false,description = "平台首页推荐:0=否,1=是")
* @ApiParams(name = "shop_id", type = "string",required=false,description = "机构店铺id")
* @ApiParams(name = "user_id", type = "string",required=false,description = "教师用户id")
* @ApiReturn({
*
*})
*/
public function teacher_list()
{
$user_id = 0;
$user = $this->auth->getUser();//登录用户
if($user)$user_id = $user['id'];
$params=[];
$page = $this->request->get('page/d', 0); //页数
$limit = $this->request->get('limit/d', 0); //条数
$params['keywords'] = $this->request->get('keywords/s', ''); //搜索关键字
$params['status'] = $this->request->get('status/s', ''); //搜索关键字
$params['recommend'] = $this->request->get('recommend/s', ''); //搜索关键字
$params['shop_id'] = $this->request->get('shop_id/d', ''); //搜索关键字
$params['user_id'] = $this->request->get('user_id/d', ''); //搜索关键字
// $type = $this->request->get('type/s', ''); //筛选学员和教练单
try{
//当前申请状态
$res = $this->model::allList($page, $limit,$params);
// if($user_id =='670153'){
// file_put_contents("ceshi66.txt",(new AppointmentOrder())->getLastSql());
// }
}catch (\Exception $e){
$this->error($e->getMessage());
}
$this->success('查询成功', $res);
}
}

View File

@ -117,6 +117,32 @@ class Backend extends Controller
protected $have_auth = false;
protected $no_auth_fields = [];
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 checkAssemblyParameters(){
if(!$this->qSwitch)return false;
//得到所有get参数

View File

@ -6,6 +6,7 @@ use app\admin\controller\famysql\Field;
use app\common\model\dyqc\ManystoreShop;
use app\manystore\library\Auth;
use app\common\model\ManystoreConfig;
use app\manystore\model\Manystore;
use think\Config;
use think\Controller;
use think\Hook;
@ -121,6 +122,34 @@ class ManystoreBase extends Controller
protected $have_auth = false;
protected $no_auth_fields = [];
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 checkAssemblyParameters(){
if(!$this->qSwitch)return false;
@ -206,6 +235,9 @@ class ManystoreBase extends Controller
$this->error(__('Please login first'), url('index/login', ['url' => $url]));
}
// 判断是否需要验证权限
if (!$this->auth->match($this->noNeedRight)) {
// 判断控制器和方法判断是否有对应权限
@ -221,8 +253,21 @@ class ManystoreBase extends Controller
define('SHOP_ID', $this->auth->shop_id);
}
$manystoreShop = ManystoreShop::where("id",$this->auth->shop_id)->find();
if($manystoreShop){
$url = Session::get('referer');
$url = $url ? $url : $this->request->url();
if($manystoreShop["status"] !=1) {
$this->error(__('账号正处于审核中,无法进行任何操作!!'), url('index/login', ['url' => $url]));
}
$manystore = Manystore::where("id",$this->auth->id)->find();
if($manystore) {
if($manystore["status"]!="normal") $this->error(__('账号正处于审核中,无法进行任何操作!!'), url('index/login', ['url' => $url]));
}
}
if(!defined('SHOP_USER_ID')) {
define('SHOP_USER_ID', $manystoreShop->user_id ?:0);
define('SHOP_USER_ID', $manystoreShop->user_id ?? 0);
}

View File

@ -95,12 +95,23 @@ class Config extends Model
* 读取分类分组列表
* @return array
*/
public static function getGroupList()
public static function getGroupList($cates = null,$space = "-")
{
$groupList = config('site.configgroup');
foreach ($groupList as $k => &$v) {
$v = __($v);
}
//array_intersect
if($cates){
$cates = explode($space,$cates);
$cate_datas = [];
foreach ($cates as $cate) {
$cate_datas[$cate] = $cate ;
}
$groupList = array_intersect_key($groupList,$cate_datas);
}
return $groupList;
}

View File

@ -164,6 +164,26 @@ class ManystoreShop extends BaseModel
}
public function checkFull($id){
$self = $this->get($id,['teachers']);
// var_dump($self->toArray());
if(empty($self["address_city"])
|| empty($self["province"])
|| empty($self["city"])
|| empty($self["district"])
|| empty($self["longitude"])
|| empty($self["latitude"])
|| empty($self["name"])
|| empty($self["image"])
|| empty($self["images"])
|| empty($self["content"])
|| empty($self["tel"])
) return false;
return true;
}
/** 机构详情
@ -172,6 +192,9 @@ class ManystoreShop extends BaseModel
*/
public function detail($id){
$self = $this->get($id,['teachers']);
if(!$this->checkFull($id))throw new \Exception("当前机构未完善信息,暂时无法展示!");
//一对多隐藏字段方法
// foreach ($self['teachers'] as $k=>$v){
// $v->visible(['id','name','expert_image','expert_content']);
@ -296,6 +319,12 @@ class ManystoreShop extends BaseModel
$shop['auth_time']= 0;
$shop["admin_id"] = 0;
$shop->save();
$store = Manystore::where("shop_id",$shop['id'])->find();
$store["status"] = 'hidden';
$store->save();
//调用订单事件
$data = ['shop' => $shop];
\think\Hook::listen('shop_apply_after', $data);
@ -374,7 +403,7 @@ public function getDefaultPassword($type,$user_id,$params){
public function creatShop($type,$user_id,$params){
$params["user_id"] = $user_id;
//商家附表
$shop = (new self);
$shop_info = $shop->allowField(true)->save($params);
@ -384,6 +413,7 @@ public function creatShop($type,$user_id,$params){
//账号主表
$manystore_params = [
"nickname" => $params["name"],
"user_id"=>$user_id,
];
$manystore_params["username"] = $params["tel"] ?: self::$pinyin->permalink($manystore_params["nickname"]);
$manystore_params["email"] = $manystore_params["username"] . "@xx.com";
@ -395,6 +425,7 @@ public function creatShop($type,$user_id,$params){
$manystore_params['password'] = md5(md5($manystore_params['password']) . $manystore_params['salt']);
$manystore_params['avatar'] = '/assets/img/avatar.png'; //设置新管理员默认头像。
$manystore_params['is_main'] = 1;
$manystore_params['status'] = "hidden";
$model = new Manystore();
$result = $model->allowField(true)->save($manystore_params);
@ -466,7 +497,7 @@ public static function getAuthInfo($user_id){
}
//如果是申请成功取店铺id
if($auth_status == '1'){
$shop_id = $apply_info['shop_id'];
$shop_id = $apply_info['id'];
}

View File

@ -2,10 +2,11 @@
namespace app\common\model\school\classes;
use app\common\model\BaseModel;
use think\Model;
use traits\model\SoftDelete;
class Teacher extends Model
class Teacher extends BaseModel
{
use SoftDelete;
@ -92,4 +93,74 @@ class Teacher 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']) && $whereData['status']) $model = $model->where("{$alisa}status", 'in', $whereData['status']);
if (isset($whereData['not_status']) && $whereData['not_status']) $model = $model->where("{$alisa}status", 'not in', $whereData['not_status']);
if (isset($whereData['recommend']) && ($whereData['recommend'] ==='0' || $whereData['recommend'] ==='1')) $model = $model->where("{$alisa}recommend", 'in', $whereData['recommend']);
if (isset($whereData['keywords'])&&$whereData['keywords']) $model = $model->where("{$alisa}name|{$alisa}id", '=', $whereData['keywords']);
if (isset($whereData['time'])&&$whereData['time']){
$model = $model->time($whereData['time']);
}
if (isset($whereData['user_id']) && $whereData['user_id']) $model = $model->where("{$alisa}user_id", '=', $whereData['user_id']);
if (isset($whereData['shop_id']) && $whereData['shop_id']) $model = $model->where("{$alisa}shop_id", 'in', $whereData['shop_id']);
return $model;
}
public static function allList($page, $limit,$params=[]){
$with_field = [
'user'=>['nickname','mobile','avatar','realname'],
'base'=>['*'],
];
$alisa = (new self)->getWithAlisaName();
$sort = "{$alisa}.recommend desc,{$alisa}.weigh desc,{$alisa}.id desc";
// if(!empty($params['status'])){
// $params['status'] = '1';
// }
return (new self)->getBaseList($params, $page, $limit,$sort,$with_field);
}
}

View File

@ -0,0 +1,76 @@
<?php
namespace app\common\model\style;
use app\common\model\BaseModel;
use think\Model;
use traits\model\SoftDelete;
class HomeImages extends BaseModel
{
use SoftDelete;
// 表名
protected $name = 'school_home_images';
// 自动写入时间戳字段
protected $autoWriteTimestamp = 'integer';
// 定义时间戳字段名
protected $createTime = 'createtime';
protected $updateTime = false;
protected $deleteTime = 'deletetime';
// 追加属性
protected $append = [
'type_text'
];
protected static function init()
{
self::afterInsert(function ($row) {
if (!$row['weigh']) {
$pk = $row->getPk();
$row->getQuery()->where($pk, $row[$pk])->update(['weigh' => $row[$pk]]);
}
});
}
public function getTypeList()
{
return ['in' => __('Type in'), 'out' => __('Type out')];
}
public function getTypeTextAttr($value, $data)
{
$value = $value ? $value : (isset($data['type']) ? $data['type'] : '');
$list = $this->getTypeList();
return isset($list[$value]) ? $list[$value] : '';
}
public function getImageAttr($value, $data)
{
if (!empty($value)) return cdnurl($value, true);
}
public static function allList($page, $limit,$params=[]){
$sort = "weigh desc,id desc";
// if(!empty($params['status'])){
// $params['status'] = '1';
// }
return (new self)->getBaseList($params, $page, $limit,$sort);
}
}

View File

@ -201,7 +201,7 @@ class ClassesLib extends ManystoreBase
$this->error("店铺不存在");
}
$params["manystore_id"] = $manystore["id"];
if(!(new \app\common\model\dyqc\ManystoreShop)->checkFull($shop_id))$this->error("您的认证信息未完善,请您先去完善!");
//验证老师id
$teacher_id = $params['teacher_id'];

View File

@ -31,4 +31,15 @@ class Manystore extends Model
return $encrypt($password . $salt);
}
public function shop()
{
return $this->belongsTo('app\admin\model\manystore\Shop', 'shop_id', 'id', [], 'LEFT')->setEagerlyType(0);
}
public function user()
{
return $this->belongsTo('app\admin\model\User', 'user_id', 'id', [], 'LEFT')->setEagerlyType(0);
}
}

View File

@ -22,12 +22,60 @@ class ManystoreShop extends Model
// 追加属性
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 getTypeTextAttr($value, $data)
{
$value = $value ? $value : (isset($data['type']) ? $data['type'] : '');
$list = $this->getTypeList();
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);
}
public function getStatusList()
{
return ['0' => __('Status 0'), '1' => __('Status 1'), '2' => __('Status 2')];
@ -49,11 +97,6 @@ class ManystoreShop extends Model
}
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 setCreateTimeAttr($value)
{

View File

@ -134,7 +134,7 @@
<div id="c_position">
<div id="c_position" {eq name="$row.address_type" value="1"} style="display: none" {/eq} >
<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">

View File

@ -18,18 +18,51 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
// 初始化表格
table.bootstrapTable({
url: $.fn.bootstrapTable.defaults.extend.index_url,
pk: 'id',
fixedColumns: true,
fixedRightNumber: 1,
columns: [
[
{field: 'state', checkbox: true, },
{checkbox: true},
{field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
,
{field: 'id', title: 'ID'},
{field: 'username', title: __('Username')},
{field: 'nickname', title: __('Nickname')},
{field: 'email', title: __('Email')},
{field: 'status', title: __("Status"), formatter: Table.api.formatter.status},
{field: 'shop.status', title: __('Auth_status'), searchList: {"0":__('Auth_status 0'),"1":__('Auth_status 1'),"2":__('Auth_status 2')}, formatter: Table.api.formatter.status},
{field: 'user_id', title: __('User_id'),visible:false},
{field: 'shop.type', title: __('Type'), searchList: {"1":__('Type 1'),"2":__('Type 2')}, formatter: Table.api.formatter.normal},
{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: 'shop.name', title: __('申请姓名|机构名'), operate: 'LIKE'},
{field: 'shop.logo', title: __('Logo'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image},
{field: 'shop.image', title: __('Image'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image},
{field: 'shop.address_city', title: __('Address_city'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
{field: 'shop.province', title: __('Province'),visible:false},
{field: 'shop.city', title: __('City'),visible:false},
{field: 'shop.district', title: __('District'),visible:false},
{field: 'shop.address', title: __('Address'), operate: 'LIKE',visible:false},
{field: 'shop.address_detail', title: __('Address_detail'), operate: 'LIKE',visible:false},
{field: 'shop.yyzz_images', title: __('Yyzz_images'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.images},
{field: 'shop.front_idcard_image', title: __('身份证正面'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image},
{field: 'shop.reverse_idcard_image', title: __('身份证反面'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image},
{field: 'shop.tel', title: __('Tel'), operate: 'LIKE'},
{field: 'logintime', title: __('Login time'), formatter: Table.api.formatter.datetime, operate: 'RANGE', addclass: 'datetimerange', sortable: true},
{field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: function (value, row, index) {
return Table.api.formatter.operate.call(this, value, row, index);
}}
]
]
});

View File

@ -34,6 +34,8 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
{field: 'name', title: __('Name'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
{field: 'head_image', title: __('Head_image'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image},
{field: 'status', title: __('Status'), searchList: {"1":__('Status 1'),"2":__('Status 2')}, formatter: Table.api.formatter.status},
{field: 'recommend', title: __('Recommend'), searchList: {"0":__('Recommend 0'),"1":__('Recommend 1')}, formatter: Table.api.formatter.normal},
{field: 'expert_image', title: __('Expert_image'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image},
{field: 'weigh', title: __('Weigh'), operate: false},
{field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},

View File

@ -0,0 +1,115 @@
define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
var Controller = {
index: function () {
// 初始化表格参数配置
Table.api.init({
extend: {
index_url: 'style/home_images/index' + location.search,
add_url: 'style/home_images/add',
edit_url: 'style/home_images/edit',
del_url: 'style/home_images/del',
multi_url: 'style/home_images/multi',
import_url: 'style/home_images/import',
table: 'school_home_images',
}
});
var table = $("#table");
// 初始化表格
table.bootstrapTable({
url: $.fn.bootstrapTable.defaults.extend.index_url,
pk: 'id',
sortName: 'weigh',
columns: [
[
{checkbox: true},
{field: 'id', title: __('Id')},
{field: 'image', title: __('Image'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image},
{field: 'type', title: __('Type'), searchList: {"in":__('Type in'),"out":__('Type out')}, formatter: Table.api.formatter.normal},
{field: 'url', title: __('Url'), operate: 'LIKE', formatter: Table.api.formatter.url},
{field: 'weigh', title: __('Weigh'), operate: false},
{field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
{field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
]
]
});
// 为表格绑定事件
Table.api.bindevent(table);
},
recyclebin: function () {
// 初始化表格参数配置
Table.api.init({
extend: {
'dragsort_url': ''
}
});
var table = $("#table");
// 初始化表格
table.bootstrapTable({
url: 'style/home_images/recyclebin' + location.search,
pk: 'id',
sortName: 'id',
columns: [
[
{checkbox: true},
{field: 'id', title: __('Id')},
{
field: 'deletetime',
title: __('Deletetime'),
operate: 'RANGE',
addclass: 'datetimerange',
formatter: Table.api.formatter.datetime
},
{
field: 'operate',
width: '140px',
title: __('Operate'),
table: table,
events: Table.api.events.operate,
buttons: [
{
name: 'Restore',
text: __('Restore'),
classname: 'btn btn-xs btn-info btn-ajax btn-restoreit',
icon: 'fa fa-rotate-left',
url: 'style/home_images/restore',
refresh: true
},
{
name: 'Destroy',
text: __('Destroy'),
classname: 'btn btn-xs btn-danger btn-ajax btn-destroyit',
icon: 'fa fa-times',
url: 'style/home_images/destroy',
refresh: true
}
],
formatter: Table.api.formatter.operate
}
]
]
});
// 为表格绑定事件
Table.api.bindevent(table);
},
add: function () {
Controller.api.bindevent();
},
edit: function () {
Controller.api.bindevent();
},
api: {
bindevent: function () {
Form.api.bindevent($("form[role=form]"));
}
}
};
return Controller;
});