入驻机构完成,自动将申请人绑定为该机构的老师
商家,可主动发起,已完成订单的退款流程 课程操作接口(增加,删除,修改) 修复一些bug
This commit is contained in:
parent
b11bf14f00
commit
839555dd0f
|
@ -2,7 +2,11 @@
|
|||
|
||||
namespace app\admin\controller\manystore;
|
||||
|
||||
use app\admin\model\school\classes\ClassesLib;
|
||||
use app\admin\model\school\classes\Teacher;
|
||||
use app\admin\model\school\classes\Verification;
|
||||
use app\admin\model\User;
|
||||
use app\common\model\manystore\Shop;
|
||||
use app\common\model\school\classes\Order;
|
||||
|
||||
use app\manystore\model\Manystore;
|
||||
|
@ -146,6 +150,12 @@ class Index extends Backend
|
|||
->order($sort, $order)
|
||||
->limit($offset, $limit)
|
||||
->select();
|
||||
// $this->view->assign('check_full',(new \app\common\model\dyqc\ManystoreShop)->checkFull($shop_info->id));
|
||||
foreach ($list as $k => &$v){
|
||||
|
||||
$v["check_full"] = (new \app\common\model\dyqc\ManystoreShop)->checkFull($v["shop"]["id"]);
|
||||
}
|
||||
|
||||
|
||||
$result = array("total" => $total, "rows" => $list);
|
||||
|
||||
|
@ -231,6 +241,20 @@ class Index extends Backend
|
|||
$order = Order::where("manystore_id",$id)->where("status","in","0,3")->find();
|
||||
if($order)throw new \Exception("存在正在使用中的课程订单或存在正在售后中的课程订单无法继续操作!");
|
||||
// 课程存在售后订单则不允许操作
|
||||
//有课程不允许删
|
||||
$classesLib = ClassesLib::where("manystore_id",$id)->find();
|
||||
if($classesLib)throw new \Exception("请先删除课程后再删除机构!");
|
||||
//有老师不允许删
|
||||
$teacher = Teacher::where("manystore_id",$id)->find();
|
||||
if($teacher)throw new \Exception("请先删除老师后再删除机构!");
|
||||
//有核销员不允许删
|
||||
$verification = Verification::where("manystore_id",$id)->find();
|
||||
if($verification)throw new \Exception("请先删除核销员后再删除机构!");
|
||||
$shop_id = Manystore::where("id",$id)->value("shop_id");
|
||||
//有授权用户不允许删
|
||||
$auth = \app\common\model\manystore\UserAuth::where("shop_id",$shop_id)->find();
|
||||
if($auth)throw new \Exception("请先删除授权用户后再删除机构!");
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
@ -245,7 +269,11 @@ class Index extends Backend
|
|||
if(!$shop["user_id"])throw new \Exception("认证用户不存在!");
|
||||
$user = User::get($shop["user_id"]);
|
||||
if(!$user) throw new \Exception("认证用户不存在!");
|
||||
if($shop["address_city"] && !$shop["province"])throw new Exception("请选择所在城市");
|
||||
if($shop["address_city"] && !$shop["district"])throw new Exception("请选择所在城市");
|
||||
|
||||
//账号昵称和头像取用户的
|
||||
$params["nickname"] = $user["realname"] ?: $user["nickname"];
|
||||
$params["avatar"] = $user["avatar"] ?:"/assets/img/avatar.png";
|
||||
|
||||
|
||||
|
||||
|
@ -340,7 +368,7 @@ class Index extends Backend
|
|||
$params['shop_id'] = $this->shopModel->id;
|
||||
$params['salt'] = Random::alnum();
|
||||
$params['password'] = md5(md5($params['password']) . $params['salt']);
|
||||
$params['avatar'] = '/assets/img/avatar.png'; //设置新管理员默认头像。
|
||||
if(empty($params['avatar']))$params['avatar'] = '/assets/img/avatar.png'; //设置新管理员默认头像。
|
||||
$params['is_main'] = 1;
|
||||
|
||||
$name = str_replace("\\model\\", "\\validate\\", get_class($this->model));
|
||||
|
@ -485,6 +513,11 @@ class Index extends Backend
|
|||
}
|
||||
$this->view->assign("row", $row);
|
||||
$this->view->assign("shop", $shop_info);
|
||||
$this->view->assign('check_full',(new \app\common\model\dyqc\ManystoreShop)->checkFull($shop_info->id));
|
||||
$this->view->assign('check_full_msg',(new \app\common\model\dyqc\ManystoreShop)->checkFullMsg($shop_info->id));
|
||||
|
||||
|
||||
|
||||
$this->view->assign("groupids", $groupids);
|
||||
return $this->view->fetch();
|
||||
}
|
||||
|
|
|
@ -4,6 +4,7 @@ namespace app\admin\controller\school\classes;
|
|||
|
||||
use app\admin\model\dyqc\ManystoreShop;
|
||||
use app\common\controller\Backend;
|
||||
use app\common\model\school\classes\lib\Spec;
|
||||
use app\common\model\school\classes\Order;
|
||||
use app\manystore\model\Manystore;
|
||||
use think\Db;
|
||||
|
@ -211,6 +212,9 @@ class ClassesLib extends Backend
|
|||
$order = Order::where("classes_lib_id",$id)->where("status","in","0,3")->find();
|
||||
if($order)$this->error("存在正在使用中的课程订单或存在正在售后中的课程订单无法继续操作!");
|
||||
// 课程存在售后订单则不允许操作
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -571,6 +575,10 @@ class ClassesLib extends Backend
|
|||
Db::startTrans();
|
||||
try {
|
||||
foreach ($list as $item) {
|
||||
//删除课程规格
|
||||
Spec::where("classes_lib_id",$item->id)->delete();
|
||||
|
||||
|
||||
$count += $item->delete();
|
||||
}
|
||||
Db::commit();
|
||||
|
|
|
@ -3,6 +3,16 @@
|
|||
namespace app\admin\controller\school\classes;
|
||||
|
||||
use app\common\controller\Backend;
|
||||
use app\common\model\manystore\UserAuth;
|
||||
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;
|
||||
|
||||
/**
|
||||
* 课程反馈管理
|
||||
|
@ -19,7 +29,7 @@ class Evaluate extends Backend
|
|||
protected $model = null;
|
||||
|
||||
protected $qSwitch = true;
|
||||
protected $qFields = ["user_id","classes_lib_id","classes_order_id","manystore_id","shop_id","teacher_id"];
|
||||
protected $qFields = ["user_id","classes_lib_id","classes_order_id","manystore_id","shop_id","teacher_id","image","nickname"];
|
||||
|
||||
public function _initialize()
|
||||
{
|
||||
|
@ -78,4 +88,205 @@ class Evaluate extends Backend
|
|||
return $this->view->fetch();
|
||||
}
|
||||
|
||||
|
||||
|
||||
protected function updateCheck($id,$params=[],$row=null){
|
||||
|
||||
// 课程存在售后订单则不允许操作
|
||||
}
|
||||
|
||||
protected function update_after(&$row)
|
||||
{
|
||||
//重新统计总评分
|
||||
\app\common\model\school\classes\Evaluate::evaluateStatistics($row["id"]);
|
||||
if($row["classes_order_id"]){
|
||||
$order = \app\common\model\school\classes\order\Order::get($row["classes_order_id"]);
|
||||
if($order){
|
||||
if(!$order["classes_evaluate_id"])$order->save(["classes_evaluate_id"=>$row["classes_order_id"]]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
protected function update_check(&$params,$row=null)
|
||||
{
|
||||
|
||||
$shop_id = $params["shop_id"];
|
||||
$manystore = Manystore::where("shop_id",$shop_id)->find();
|
||||
if(!$manystore){
|
||||
$this->error("店铺不存在");
|
||||
}
|
||||
//用户不存在
|
||||
$user_id = $params["user_id"];
|
||||
$user = User::where("id",$user_id)->find();
|
||||
// if(!$user){
|
||||
// $this->error("用户不存在");
|
||||
// }
|
||||
$params["classes_star"] = bcdiv($params["classes_star"],10,1);
|
||||
$params["teacher_star"] = bcdiv($params["teacher_star"],10,1);
|
||||
$params["shop_star"] = bcdiv($params["shop_star"],10,1);
|
||||
//修改
|
||||
if($row){
|
||||
|
||||
}else{
|
||||
//新增
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
$params["manystore_id"] = $manystore["id"];
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*
|
||||
* @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_after($this->model);
|
||||
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_after($row);
|
||||
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();
|
||||
foreach ($list as $item) {
|
||||
$this->updateCheck($item->id);
|
||||
}
|
||||
|
||||
|
||||
$count = 0;
|
||||
Db::startTrans();
|
||||
try {
|
||||
foreach ($list as $item) {
|
||||
$count += $item->delete();
|
||||
}
|
||||
Db::commit();
|
||||
} catch (PDOException|Exception $e) {
|
||||
Db::rollback();
|
||||
$this->error($e->getMessage());
|
||||
}
|
||||
if ($count) {
|
||||
$this->success();
|
||||
}
|
||||
$this->error(__('No rows were deleted'));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -66,7 +66,7 @@ class Order extends Backend
|
|||
$row->getRelation('user')->visible(['nickname','realname','mobile','avatar']);
|
||||
$row->getRelation('shop')->visible(['name','image','address_city','province','city','district','address','address_detail']);
|
||||
$row->getRelation('lib')->visible(['title','headimage']);
|
||||
$row->getRelation('detail')->visible(['title','headimage',"feel"]);
|
||||
$row->getRelation('detail')->visible(['title','headimage',"feel","teacher_id"]);
|
||||
$row->getRelation('admin')->visible(['nickname','avatar']);
|
||||
}
|
||||
|
||||
|
|
|
@ -9,6 +9,7 @@ return [
|
|||
'Please input correct nickname' => '昵称仅支持输入中文、英文字母(大小写)、数字、下划线',
|
||||
'Please input length nickname' => '昵称请最多填写10个字符',
|
||||
'Loss_ratio' => '课程损耗比(百分制)',
|
||||
"Login successful" => '机构后台已自动登录成功!',
|
||||
|
||||
'user_id' => '申请用户',
|
||||
'Logo' => 'Logo',
|
||||
|
@ -51,4 +52,21 @@ return [
|
|||
'Type 1' => '个人认证',
|
||||
'Type 2' => '机构认证',
|
||||
'Desc' => '申请备注',
|
||||
|
||||
"Establish_time" => '成立时间',
|
||||
"People" => '员工人数',
|
||||
"Legal_entity" => '法人姓名',
|
||||
"Gender" => '性别',
|
||||
"Nation" => '民族',
|
||||
"Out_look" => '政治面貌',
|
||||
"Birthtime" => '出生日期',
|
||||
"Native_place" => '籍贯',
|
||||
"Card_number" => '身份证号码',
|
||||
"Diploma" => '学历',
|
||||
"Post" => '职务',
|
||||
"Social_position" => '社会职务',
|
||||
//Male'), '0'=>__('Female'
|
||||
'Male' => '男',
|
||||
'Female' => '女',
|
||||
|
||||
];
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
return [
|
||||
'Manystore_id' => '机构账号id',
|
||||
'Shop_id' => '机构店铺id',
|
||||
'Shop_id' => '机构id',
|
||||
'User_id' => '主讲师用户id',
|
||||
'Classes_cate_ids' => '标签',
|
||||
'Classes_label_ids' => '热门',
|
||||
|
@ -79,8 +79,8 @@ return [
|
|||
'Shop.province' => '省编号',
|
||||
'Shop.city' => '市编号',
|
||||
'Shop.district' => '县区编号',
|
||||
'Shop.address' => '店铺地址',
|
||||
'Shop.address_detail' => '店铺详细地址',
|
||||
'Shop.address' => '机构地址',
|
||||
'Shop.address_detail' => '机构详细地址',
|
||||
'User.nickname' => '昵称',
|
||||
'User.realname' => '真实姓名',
|
||||
'User.mobile' => '手机号',
|
||||
|
|
|
@ -1,12 +1,13 @@
|
|||
<?php
|
||||
|
||||
return [
|
||||
'User_id' => '评价用户id',
|
||||
'Classes_lib_id' => '课程id',
|
||||
'Classes_order_id' => '课程订单id',
|
||||
'Manystore_id' => '机构账号id',
|
||||
'Shop_id' => '机构店铺id',
|
||||
'Teacher_id' => '老师id',
|
||||
'User_id' => '评价用户',
|
||||
'Add' => '添加虚拟反馈',
|
||||
'Classes_lib_id' => '课程',
|
||||
'Classes_order_id' => '课程订单',
|
||||
'Manystore_id' => '机构账号',
|
||||
'Shop_id' => '机构店铺',
|
||||
'Teacher_id' => '老师',
|
||||
'Image' => '评价人头像',
|
||||
'Nickname' => '评价人昵称',
|
||||
'Classes_star' => '课程评分',
|
||||
|
|
|
@ -62,6 +62,12 @@ class Evaluate extends Model
|
|||
}
|
||||
|
||||
|
||||
protected function setEvaluateTimeAttr($value)
|
||||
{
|
||||
return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
|
||||
}
|
||||
|
||||
|
||||
public function getStatusTextAttr($value, $data)
|
||||
{
|
||||
$value = $value ? $value : (isset($data['status']) ? $data['status'] : '');
|
||||
|
@ -77,10 +83,6 @@ class Evaluate extends Model
|
|||
return isset($list[$value]) ? $list[$value] : '';
|
||||
}
|
||||
|
||||
protected function setEvaluateTimeAttr($value)
|
||||
{
|
||||
return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
|
||||
}
|
||||
|
||||
|
||||
public function user()
|
||||
|
|
|
@ -33,15 +33,15 @@ class Index extends Validate
|
|||
* 验证场景
|
||||
*/
|
||||
protected $scene = [
|
||||
'add' => ['username', 'email', 'nickname', 'password'],
|
||||
'edit' => ['email', 'nickname', 'password'],
|
||||
'add' => ['username', 'email', 'password'],
|
||||
'edit' => ['email', 'password'],
|
||||
];
|
||||
|
||||
public function __construct(array $rules = [], $message = [], $field = [])
|
||||
{
|
||||
$this->field = [
|
||||
'username' => __('Username'),
|
||||
'nickname' => __('Nickname'),
|
||||
// 'nickname' => __('Nickname'),
|
||||
'password' => __('Password'),
|
||||
'email' => __('Email'),
|
||||
];
|
||||
|
|
|
@ -23,12 +23,12 @@
|
|||
<input type="email" class="form-control" id="email" name="row[email]" value="" data-rule="required;email" placeholder="请输入{:__('Email')}" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="nickname" class="control-label col-xs-12 col-sm-2">{:__('Nickname')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input type="text" class="form-control" id="nickname" name="row[nickname]" autocomplete="off" value="" data-rule="required;" placeholder="请输入{:__('Nickname')}" />
|
||||
</div>
|
||||
</div>
|
||||
<!-- <div class="form-group">-->
|
||||
<!-- <label for="nickname" class="control-label col-xs-12 col-sm-2">{:__('Nickname')}:</label>-->
|
||||
<!-- <div class="col-xs-12 col-sm-8">-->
|
||||
<!-- <input type="text" class="form-control" id="nickname" name="row[nickname]" autocomplete="off" value="" data-rule="required;" placeholder="请输入{:__('Nickname')}" />-->
|
||||
<!-- </div>-->
|
||||
<!-- </div>-->
|
||||
<div class="form-group">
|
||||
<label for="password" class="control-label col-xs-12 col-sm-2">{:__('Password')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
|
@ -175,31 +175,6 @@
|
|||
</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" 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" 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>
|
||||
</div>
|
||||
<span class="msg-box n-right" for="c-yyzz_images"></span>
|
||||
</div>
|
||||
<ul class="row list-inline plupload-preview" id="p-yyzz_images"></ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
|
@ -241,6 +216,145 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div id="c_institution" >
|
||||
|
||||
|
||||
<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="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" 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>
|
||||
</div>
|
||||
<span class="msg-box n-right" for="c-yyzz_images"></span>
|
||||
</div>
|
||||
<ul class="row list-inline plupload-preview" id="p-yyzz_images"></ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Establish_time')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-establish_time" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="shop[establish_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">{:__('People')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-people" class="form-control" name="shop[people]" type="number" value="0">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Legal_entity')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-legal_entity" class="form-control" name="shop[legal_entity]" type="text" value="">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
<div id="c_person">
|
||||
|
||||
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2"><span class="c_institution">法人</span>{:__('Gender')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
{:build_radios('shop[gender]', ['1'=>__('Male'), '0'=>__('Female')], 1)}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2"><span class="c_institution">法人</span>{:__('Nation')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-nation" class="form-control" data-rule="required" name="shop[nation]" type="text" value="">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2"><span class="c_institution">法人</span>{:__('Out_look')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-out_look" class="form-control" data-rule="required" name="shop[out_look]" type="text" value="">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2"><span class="c_institution">法人</span>{:__('Birthtime')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-birthtime" data-rule="required" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="shop[birthtime]" 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"><span class="c_institution">法人</span>{:__('Native_place')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-native_place" class="form-control" data-rule="required" name="shop[native_place]" type="text" value="">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2"><span class="c_institution">法人</span>{:__('Card_number')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-card_number" class="form-control" data-rule="required" name="shop[card_number]" type="text" value="">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2"><span class="c_institution">法人</span>{:__('Diploma')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-diploma" class="form-control" name="shop[diploma]" type="text" value="">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2"><span class="c_institution">法人</span>{:__('Post')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-post" class="form-control" name="shop[post]" type="text" value="">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2"><span class="c_institution">法人</span>{:__('Social_position')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-social_position" class="form-control" name="shop[social_position]" type="text" value="">
|
||||
</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">
|
||||
|
|
|
@ -23,12 +23,12 @@
|
|||
<input type="email" class="form-control" id="email" name="row[email]" value="{$row.email|htmlentities}" data-rule="required;email" placeholder="请输入{:__('Email')}" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="nickname" class="control-label col-xs-12 col-sm-2">{:__('Nickname')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input type="text" class="form-control" id="nickname" name="row[nickname]" autocomplete="off" value="{$row.nickname|htmlentities}" data-rule="required;" placeholder="请输入{:__('Nickname')}" />
|
||||
</div>
|
||||
</div>
|
||||
<!-- <div class="form-group">-->
|
||||
<!-- <label for="nickname" class="control-label col-xs-12 col-sm-2">{:__('Nickname')}:</label>-->
|
||||
<!-- <div class="col-xs-12 col-sm-8">-->
|
||||
<!-- <input type="text" class="form-control" id="nickname" name="row[nickname]" autocomplete="off" value="{$row.nickname|htmlentities}" data-rule="required;" placeholder="请输入{:__('Nickname')}" />-->
|
||||
<!-- </div>-->
|
||||
<!-- </div>-->
|
||||
<div class="form-group">
|
||||
<label for="password" class="control-label col-xs-12 col-sm-2">{:__('Password')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
|
@ -80,6 +80,10 @@
|
|||
</div>
|
||||
<div class="panel-body">
|
||||
<div id="storeContent" class="tab-content">
|
||||
|
||||
{$check_full_msg}
|
||||
|
||||
|
||||
<div class="tab-pane fade active in" id="shop_basic">
|
||||
|
||||
|
||||
|
@ -186,32 +190,6 @@
|
|||
</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" 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" 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>
|
||||
</div>
|
||||
<span class="msg-box n-right" for="c-yyzz_images"></span>
|
||||
</div>
|
||||
<ul class="row list-inline plupload-preview" id="p-yyzz_images"></ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -256,6 +234,140 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div id="c_institution" >
|
||||
|
||||
<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="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" 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>
|
||||
</div>
|
||||
<span class="msg-box n-right" for="c-yyzz_images"></span>
|
||||
</div>
|
||||
<ul class="row list-inline plupload-preview" id="p-yyzz_images"></ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Establish_time')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-establish_time" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="shop[establish_time]" type="text" value="{:$shop.establish_time?datetime($shop.establish_time):''}">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('People')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-people" class="form-control" name="shop[people]" type="number" value="{$shop.people}">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Legal_entity')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-legal_entity" class="form-control" name="shop[legal_entity]" type="text" value="{$shop.legal_entity}">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
<div id="c_person">
|
||||
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2"><span class="c_institution">法人</span> {:__('Gender')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
{:build_radios('shop[gender]', ['1'=>__('Male'), '0'=>__('Female')], $shop['gender'])}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2"><span class="c_institution">法人</span>{:__('Nation')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-nation" class="form-control" data-rule="required" name="shop[nation]" type="text" value="{$shop.nation}">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2"><span class="c_institution">法人</span>{:__('Out_look')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-out_look" class="form-control" data-rule="required" name="shop[out_look]" type="text" value="{$shop.out_look}">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2"><span class="c_institution">法人</span>{:__('Birthtime')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-birthtime" data-rule="required" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="shop[birthtime]" type="text" value="{:$shop.birthtime?datetime($shop.birthtime):''}">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2"><span class="c_institution">法人</span>{:__('Native_place')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-native_place" class="form-control" data-rule="required" name="shop[native_place]" type="text" value="{$shop.native_place}">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2"><span class="c_institution">法人</span>{:__('Card_number')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-card_number" class="form-control" data-rule="required" name="shop[card_number]" type="text" value="{$shop.card_number}">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2"><span class="c_institution">法人</span>{:__('Diploma')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-diploma" class="form-control" name="shop[diploma]" type="text" value="{$shop.diploma}">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2"><span class="c_institution">法人</span>{:__('Post')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-post" class="form-control" name="shop[post]" type="text" value="{$shop.post}">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2"><span class="c_institution">法人</span>{:__('Social_position')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-social_position" class="form-control" name="shop[social_position]" type="text" value="{$shop.social_position}">
|
||||
</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">
|
||||
|
|
|
@ -20,10 +20,10 @@
|
|||
|
||||
|
||||
<a href="javascript:;" class="btn btn-primary btn-refresh" title="{:__('Refresh')}" ><i class="fa fa-refresh"></i> </a>
|
||||
<!-- <a href="javascript:;" class="btn btn-success btn-add {:$auth->check('school/classes/classes_lib/add')?'':'hide'}" title="{:__('Add')}" ><i class="fa fa-plus"></i> {:__('Add')}</a>-->
|
||||
<a href="javascript:;" class="btn btn-success btn-add {:$auth->check('school/classes/classes_lib/add')?'':'hide'}" title="{:__('Add')}" ><i class="fa fa-plus"></i> {:__('Add')}</a>
|
||||
|
||||
|
||||
<a href="javascript:;" data-url="school/classes/classes_lib/addnew" class="btn btn-success btn-changeuser {:$auth->check('school/classes/classes_lib/addnew')?'':'hide'}" title="{:__('Add')}" ><i class="fa fa-plus"></i> {:__('Add')}</a>
|
||||
<!-- <a href="javascript:;" data-url="school/classes/classes_lib/addnew" class="btn btn-success btn-changeuser {:$auth->check('school/classes/classes_lib/addnew')?'':'hide'}" title="{:__('Add')}" ><i class="fa fa-plus"></i> {:__('Add')}</a>-->
|
||||
|
||||
<a href="javascript:;" class="btn btn-success btn-edit btn-disabled disabled {:$auth->check('school/classes/classes_lib/edit')?'':'hide'}" title="{:__('Edit')}" ><i class="fa fa-pencil"></i> {:__('Edit')}</a>
|
||||
<a href="javascript:;" class="btn btn-danger btn-del btn-disabled disabled {:$auth->check('school/classes/classes_lib/del')?'':'hide'}" title="{:__('Delete')}" ><i class="fa fa-trash"></i> {:__('Delete')}</a>
|
||||
|
|
|
@ -1,21 +1,39 @@
|
|||
<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>
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Shop_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="">
|
||||
<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="{$q_shop_id}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Teacher_id')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-teacher_id" data-rule="required" data-source="school/classes/teacher/index" data-field="name" class="form-control selectpage" name="row[teacher_id]" type="text" value="{$q_teacher_id}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Classes_lib_id')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-classes_lib_id" data-rule="required" data-source="school/classes/lib/index" class="form-control selectpage" name="row[classes_lib_id]" type="text" value="">
|
||||
<input id="c-classes_lib_id" data-rule="required" data-source="school/classes/classes_lib/index" data-field="title" class="form-control selectpage" name="row[classes_lib_id]" type="text" value="{$q_classes_lib_id}">
|
||||
</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-source="user/user/index" data-field="mobile" data-format-item="{id} - {nickname} - {mobile}" class="form-control selectpage" name="row[user_id]" type="text" value="{$q_user_id}">
|
||||
<span style="color: red">(虚拟反馈则此项无需填写)</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Classes_order_id')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-classes_order_id" data-rule="required" data-source="school/classes/order/index" class="form-control selectpage" name="row[classes_order_id]" type="text" value="">
|
||||
<input id="c-classes_order_id" data-source="school/classes/order/order/index" data-field="order_no" class="form-control selectpage" name="row[classes_order_id]" type="text" value="{$q_classes_order_id}">
|
||||
<span style="color: red">(虚拟反馈则此项无需填写)</span>
|
||||
</div>
|
||||
</div>
|
||||
<!-- <div class="form-group">-->
|
||||
|
@ -24,23 +42,13 @@
|
|||
<!-- <input id="c-manystore_id" data-rule="required" data-source="manystore/index" class="form-control selectpage" name="row[manystore_id]" type="text" value="">-->
|
||||
<!-- </div>-->
|
||||
<!-- </div>-->
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Shop_id')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-shop_id" data-rule="required" data-source="manystore/shop/index" class="form-control selectpage" name="row[shop_id]" type="text" value="">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Teacher_id')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-teacher_id" data-rule="required" data-source="school/teacher/index" class="form-control selectpage" name="row[teacher_id]" type="text" value="">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('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">
|
||||
<input id="c-image" data-rule="required" class="form-control" size="50" name="row[image]" type="text" value="{$q_image}" >
|
||||
<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>
|
||||
|
@ -53,27 +61,44 @@
|
|||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Nickname')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-nickname" data-rule="required" class="form-control" name="row[nickname]" type="text">
|
||||
<input id="c-nickname" data-rule="required" class="form-control" name="row[nickname]" type="text" value="{$q_nickname}">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Classes_star')}: </label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-classes_star" data-rule="required" class="form-control" step="0.1" name="row[classes_star]" type="number" value="0.5">
|
||||
<!-- <input id="c-classes_star" data-rule="required" class="form-control" step="0.1" name="row[classes_star]" type="number" value="{$row.classes_star|htmlentities}">-->
|
||||
|
||||
<input id="c-classes_star" name="row[classes_star]" type="text" data-rule="required" class="form-control slider" data-slider-min="5" data-slider-max="50" data-slider-step="5" data-slider-value="5" data-slider-tooltip="show" />
|
||||
<span style="color: red">(5-50 对应 0.5星-5.0星)</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Teacher_star')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-teacher_star" data-rule="required" class="form-control" step="0.1" name="row[teacher_star]" type="number" value="0.5">
|
||||
<!-- <input id="c-teacher_star" data-rule="required" class="form-control" step="0.1" name="row[teacher_star]" type="number" value="{$row.teacher_star|htmlentities}">-->
|
||||
|
||||
<input id="c-teacher_star" name="row[teacher_star]" type="text" data-rule="required" class="form-control slider" data-slider-min="5" data-slider-max="50" data-slider-step="5" data-slider-value="5" data-slider-tooltip="show" />
|
||||
<span style="color: red">(5-50 对应 0.5星-5.0星)</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Shop_star')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-shop_star" data-rule="required" class="form-control" step="0.1" name="row[shop_star]" type="number" value="0.5">
|
||||
<!-- <input id="c-shop_star" data-rule="required" class="form-control" step="0.1" name="row[shop_star]" type="number" value="{$row.shop_star|htmlentities}">-->
|
||||
|
||||
|
||||
<input id="c-shop_star" name="row[shop_star]" type="text" data-rule="required" class="form-control slider" data-slider-min="5" data-slider-max="50" data-slider-step="5" data-slider-value="5" data-slider-tooltip="show" />
|
||||
<span style="color: red">(5-50 对应 0.5星-5.0星)</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Message_text')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
|
|
|
@ -1,41 +1,50 @@
|
|||
<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">{:__('Classes_lib_id')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-classes_lib_id" data-rule="required" data-source="school/classes/lib/index" class="form-control selectpage" name="row[classes_lib_id]" type="text" value="{$row.classes_lib_id|htmlentities}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Classes_order_id')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-classes_order_id" data-rule="required" data-source="school/classes/order/index" class="form-control selectpage" name="row[classes_order_id]" type="text" value="{$row.classes_order_id|htmlentities}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Manystore_id')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-manystore_id" data-rule="required" data-source="manystore/index" class="form-control selectpage" name="row[manystore_id]" type="text" value="{$row.manystore_id|htmlentities}">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Shop_id')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-shop_id" data-rule="required" data-source="manystore/shop/index" class="form-control selectpage" name="row[shop_id]" type="text" value="{$row.shop_id|htmlentities}">
|
||||
<input id="c-shop_id" data-rule="required" data-source="dyqc/manystore_shop/index" class="form-control selectpage" name="row[shop_id]" type="text" value="{$row.shop_id|htmlentities}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Teacher_id')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-teacher_id" data-rule="required" data-source="school/teacher/index" class="form-control selectpage" name="row[teacher_id]" type="text" value="{$row.teacher_id|htmlentities}">
|
||||
<input id="c-teacher_id" data-rule="required" data-source="school/classes/teacher/index" data-field="name" class="form-control selectpage" name="row[teacher_id]" type="text" value="{$row.teacher_id|htmlentities}">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Classes_lib_id')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-classes_lib_id" data-rule="required" data-source="school/classes/classes_lib/index" data-field="title" class="form-control selectpage" name="row[classes_lib_id]" type="text" value="{$row.classes_lib_id|htmlentities}">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<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-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}">
|
||||
<span style="color: red">(虚拟反馈则此项无需填写)</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Classes_order_id')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-classes_order_id" data-source="school/classes/order/order/index" data-field="order_no" class="form-control selectpage" name="row[classes_order_id]" type="text" value="{$row.classes_order_id|htmlentities}">
|
||||
<span style="color: red">(虚拟反馈则此项无需填写)</span>
|
||||
</div>
|
||||
</div>
|
||||
<!-- <div class="form-group">-->
|
||||
<!-- <label class="control-label col-xs-12 col-sm-2">{:__('Manystore_id')}:</label>-->
|
||||
<!-- <div class="col-xs-12 col-sm-8">-->
|
||||
<!-- <input id="c-manystore_id" data-rule="required" data-source="manystore/index" class="form-control selectpage" name="row[manystore_id]" type="text" value="{$row.manystore_id|htmlentities}">-->
|
||||
<!-- </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">
|
||||
|
@ -59,19 +68,29 @@
|
|||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Classes_star')}: </label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-classes_star" data-rule="required" class="form-control" step="0.1" name="row[classes_star]" type="number" value="{$row.classes_star|htmlentities}">
|
||||
<!-- <input id="c-classes_star" data-rule="required" class="form-control" step="0.1" name="row[classes_star]" type="number" value="{$row.classes_star|htmlentities}">-->
|
||||
|
||||
<input id="c-classes_star" name="row[classes_star]" type="text" data-rule="required" class="form-control slider" data-slider-min="5" data-slider-max="50" data-slider-step="5" data-slider-value="{$row.classes_star*10}" data-slider-tooltip="show" value="{$row.classes_star*10}" />
|
||||
<span style="color: red">(5-50 对应 0.5星-5.0星)</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Teacher_star')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-teacher_star" data-rule="required" class="form-control" step="0.1" name="row[teacher_star]" type="number" value="{$row.teacher_star|htmlentities}">
|
||||
<!-- <input id="c-teacher_star" data-rule="required" class="form-control" step="0.1" name="row[teacher_star]" type="number" value="{$row.teacher_star|htmlentities}">-->
|
||||
|
||||
<input id="c-teacher_star" name="row[teacher_star]" type="text" data-rule="required" class="form-control slider" data-slider-min="5" data-slider-max="50" data-slider-step="5" data-slider-value="{$row.teacher_star*10}" data-slider-tooltip="show" value="{$row.teacher_star*10}" />
|
||||
<span style="color: red">(5-50 对应 0.5星-5.0星)</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Shop_star')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-shop_star" data-rule="required" class="form-control" step="0.1" name="row[shop_star]" type="number" value="{$row.shop_star|htmlentities}">
|
||||
<!-- <input id="c-shop_star" data-rule="required" class="form-control" step="0.1" name="row[shop_star]" type="number" value="{$row.shop_star|htmlentities}">-->
|
||||
|
||||
|
||||
<input id="c-shop_star" name="row[shop_star]" type="text" data-rule="required" class="form-control slider" data-slider-min="5" data-slider-max="50" data-slider-step="5" data-slider-value="{$row.shop_star*10}" data-slider-tooltip="show" value="{$row.shop_star*10}" />
|
||||
<span style="color: red">(5-50 对应 0.5星-5.0星)</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
|
|
|
@ -21,8 +21,8 @@
|
|||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('同意退款金额')}(默认损耗后额度):</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-price" data-rule="required" class="form-control" step="0.01" name="row[price]" type="number" value="{$row.auto_recommend_price|htmlentities}">
|
||||
<span style="color: red">( 当前订单损耗比为 {$row.loss_proportion|htmlentities}% | 忽略损耗应退全额为 {$row.auto_price|htmlentities} | 退款金额不能超过订单应退全额 )</span>
|
||||
<input id="c-price" data-rule="required" class="form-control" step="0.01" name="row[price]" type="number" value="{$row.auto_recommend_price >0 ? $row.auto_recommend_price : $row.sub_refundprice }">
|
||||
<span style="color: red">( 当前订单损耗比为 {$row.loss_proportion|htmlentities}% | 忽略损耗应退全额为 {$row.auto_price|htmlentities} [若为0说明课时已用完或计算应退金额小于0.01,请自行决定是否退全款] | 退款金额不能超过订单应退全额{$row.sub_refundprice|htmlentities} )</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -6,6 +6,7 @@ use app\common\controller\Api;
|
|||
use app\common\library\Sqlscript;
|
||||
use app\common\library\Virtual;
|
||||
use app\common\model\school\Area;
|
||||
use app\common\model\school\classes\order\ServiceOrder;
|
||||
use app\common\model\style\HomeImages;
|
||||
use think\Db;
|
||||
use think\exception\PDOException;
|
||||
|
@ -26,6 +27,8 @@ class Index extends Api
|
|||
{
|
||||
Db::startTrans();
|
||||
try {
|
||||
// $da = ServiceOrder::getCost("dgadasdasdsds12343","2024121214396382520","aaaaa",$param=[],true);
|
||||
// var_dump($da);
|
||||
Sqlscript::importClasses(1,1000);
|
||||
Db::commit();
|
||||
} catch (PDOException|\Exception $e) {
|
||||
|
@ -37,7 +40,7 @@ class Index extends Api
|
|||
|
||||
/**
|
||||
* 各种协议文章
|
||||
* @ApiSummary(about_us 关于夜校 entry_agreement 入驻协议 privacy 隐私协议)
|
||||
* @ApiSummary(about_us 关于夜校 entry_agreement 入驻协议 privacy 隐私协议 user_protocol 用户协议)
|
||||
* @ApiMethod (GET)
|
||||
*/
|
||||
public function agreement()
|
||||
|
@ -47,6 +50,10 @@ class Index extends Api
|
|||
'about_us' => config("site.about_us"),
|
||||
'entry_agreement' => config("site.entry_agreement"),
|
||||
"privacy"=> config("site.privacy"),
|
||||
"user_protocol"=> config("site.user_protocol"),
|
||||
'entry_agreement_file' => config("site.entry_agreement_file"),
|
||||
"privacy_file"=> config("site.privacy_file"),
|
||||
"user_protocol_file"=> config("site.user_protocol_file"),
|
||||
];
|
||||
|
||||
$this->success(__('查询成功'), $data);
|
||||
|
|
|
@ -343,6 +343,12 @@ class User extends Api
|
|||
if(in_array('birthday', $update_fields))$user->birthday = $birthday;
|
||||
if(in_array('work', $update_fields))$user->work = $work;
|
||||
$user->save();
|
||||
//调用事件
|
||||
$datas = ['user' => $user];
|
||||
\think\Hook::listen('user_update_after', $datas);
|
||||
|
||||
|
||||
|
||||
$this->success();
|
||||
}
|
||||
|
||||
|
|
|
@ -330,6 +330,7 @@ class Classes extends Base
|
|||
* @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")
|
||||
* @ApiParams(name = "auth_status", type = "string",required=false,description = "审核状态:-1=不计入条件 ,0=待审核,1=审核通过,2=审核失败")
|
||||
* @ApiReturn({
|
||||
*
|
||||
*})
|
||||
|
@ -380,6 +381,8 @@ class Classes extends Base
|
|||
|
||||
$params["start_time"] = $this->request->get('start_time/d', ''); //主讲师用户id
|
||||
$params["end_time"] = $this->request->get('end_time/d', ''); //机构店铺id
|
||||
$params["auth_status"] = $this->request->get('auth_status/d', '-1'); //机构店铺id
|
||||
|
||||
|
||||
|
||||
// $type = $this->request->get('type/s', ''); //筛选学员和教练单
|
||||
|
|
|
@ -0,0 +1,222 @@
|
|||
<?php
|
||||
|
||||
namespace app\api\controller\school\worker;
|
||||
|
||||
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\classes\Type;
|
||||
use app\common\model\school\SearchCity;
|
||||
use think\Cache;
|
||||
use think\Log;
|
||||
|
||||
/**
|
||||
* 员工管理机构课程接口
|
||||
*/
|
||||
class Classes extends Base
|
||||
{
|
||||
protected $noNeedLogin = [];
|
||||
protected $noNeedRight = '*';
|
||||
|
||||
protected $model = null;
|
||||
|
||||
/**
|
||||
* 初始化操作
|
||||
* @access protected
|
||||
*/
|
||||
protected function _initialize()
|
||||
{
|
||||
|
||||
$this->model = new ClassesLib;
|
||||
parent::_initialize();
|
||||
|
||||
//判断登录用户是否是员工 'add','edit','del'
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @ApiTitle(员工课程添加)
|
||||
* @ApiSummary(员工课程添加)
|
||||
* @ApiMethod(POST)
|
||||
* @ApiParams(name = "classes_num", type = "int",required=true,description = "核销次数")
|
||||
* @ApiParams(name = "status", type = "string",required=true,description = "上架状态:1=上架,2=下架,3=平台下架")
|
||||
* @ApiParams(name = "teacher_id", type = "int",required=true,description = "老师id")
|
||||
* @ApiParams(name = "classes_type", type = "string",required=true,description = "课程类型")
|
||||
* @ApiParams(name = "classes_cate_ids", type = "string",required=true,description = "课程标签ids 多值逗号拼接")
|
||||
* @ApiParams(name = "classes_label_ids", type = "string",required=true,description = "课程热门标签")
|
||||
* @ApiParams(name = "self_label_tag", type = "string",required=true,description = "机构热门标签:多值逗号拼接")
|
||||
* @ApiParams(name = "title", type = "string",required=true,description = "课程标题")
|
||||
* @ApiParams(name = "headimage", type = "string",required=true,description = "课程头图")
|
||||
* @ApiParams(name = "images", type = "string",required=true,description = "课程轮播图多值逗号拼接")
|
||||
* @ApiParams(name = "type", type = "string",required=true,description = "地点类型:out=户外,in=室内")
|
||||
* @ApiParams(name = "spec", type = "string",required=true,description = "课时多规格:[{'id':665,'classes_lib_id':570,'name':'xxxxx','limit_num':100,'status':'1','weigh':665,'time':'2024\/12\/12 19:00 - 2024\/12\/12 20:00'}] ")
|
||||
* @ApiParams(name = "address_type", type = "string",required=true,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 = "address", type = "string",required=false,description = "地图定位地址")
|
||||
* @ApiParams(name = "address_detail", type = "string",required=false,description = "手录详细地址")
|
||||
* @ApiParams(name = "longitude", type = "string",required=false,description = "经度")
|
||||
* @ApiParams(name = "latitude", type = "string",required=false,description = "纬度")
|
||||
* @ApiParams(name = "content", type = "string",required=false,description = "课程详情")
|
||||
* @ApiParams(name = "notice", type = "string",required=false,description = "课程须知")
|
||||
* @ApiParams(name = "price", type = "string",required=false,description = "课程价格 0为免费")
|
||||
* @ApiParams(name = "selfhot", type = "string",required=false,description = "机构热门:0=否,1=是")
|
||||
* @ApiReturn({
|
||||
*
|
||||
*})
|
||||
*/
|
||||
public function add(){
|
||||
$user_id = 0;
|
||||
$user = $this->auth->getUser();//登录用户
|
||||
if($user)$user_id = $user['id'];
|
||||
$params = [];
|
||||
$params["status"] = $this->request->post('status/s', 0); //上架状态:1=上架,2=下架,3=平台下架
|
||||
$params["teacher_id"] = $this->request->post('teacher_id/d', 0); //老师id
|
||||
$params["classes_type"] = $this->request->post('classes_type/s', 0); //老师id
|
||||
$params["classes_cate_ids"] = $this->request->post('classes_cate_ids/s', 0); //课程标签
|
||||
$params["classes_label_ids"] = $this->request->post('classes_label_ids/s', 0); //课程热门标签
|
||||
$params["self_label_tag"] = $this->request->post('self_label_tag/s', 0); //老师id
|
||||
$params["title"] = $this->request->post('title/s', 0); //老师id
|
||||
$params["headimage"] = $this->request->post('headimage/s', 0); //老师id
|
||||
$params["images"] = $this->request->post('images/s', 0); //老师id
|
||||
$params["type"] = $this->request->post('type/s', 0); //老师id
|
||||
$params["spec"] = $this->request->post('spec/s', 0); //老师id
|
||||
$params["classes_num"] = $this->request->post('classes_num/d', 0); //核销次数
|
||||
//
|
||||
$params["address_type"] = $this->request->post('address_type/s', 0); //老师id
|
||||
$params["province"] = $this->request->post('province/d', 0); //老师id
|
||||
$params["city"] = $this->request->post('city/d', 0); //老师id
|
||||
$params["district"] = $this->request->post('district/d', 0); //老师id
|
||||
$params["address"] = $this->request->post('address/s', 0); //老师id
|
||||
$params["address_detail"] = $this->request->post('address_detail/s', 0); //老师id
|
||||
$params["longitude"] = $this->request->post('longitude/s', 0); //老师id
|
||||
$params["latitude"] = $this->request->post('latitude/s', 0); //老师id
|
||||
$params["content"] = $this->request->post('content/s', 0); //老师id
|
||||
$params["notice"] = $this->request->post('notice/s', 0); //老师id
|
||||
$params["price"] = $this->request->post('price/f', 0); //老师id
|
||||
$params["selfhot"] = $this->request->post('selfhot/s', 0); //老师id
|
||||
|
||||
|
||||
//classes_type
|
||||
|
||||
try{
|
||||
$res = $this->model->createClassesByOper($params,true,'user',$user_id,true);
|
||||
}catch (\Throwable $e){
|
||||
$this->error($e->getMessage());
|
||||
}
|
||||
$this->success('添加成功', $res);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @ApiTitle(员工课程编辑)
|
||||
* @ApiSummary(员工课程编辑)
|
||||
* @ApiMethod(POST)
|
||||
* @ApiParams(name = "id", type = "string",required=true,description = "课程id")
|
||||
* @ApiParams(name = "status", type = "string",required=true,description = "上架状态:1=上架,2=下架,3=平台下架")
|
||||
* @ApiParams(name = "teacher_id", type = "int",required=true,description = "老师id")
|
||||
* @ApiParams(name = "classes_type", type = "string",required=true,description = "课程类型")
|
||||
* @ApiParams(name = "classes_cate_ids", type = "string",required=true,description = "课程标签ids 多值逗号拼接")
|
||||
* @ApiParams(name = "classes_label_ids", type = "string",required=true,description = "课程热门标签")
|
||||
* @ApiParams(name = "self_label_tag", type = "string",required=true,description = "机构热门标签:多值逗号拼接")
|
||||
* @ApiParams(name = "title", type = "string",required=true,description = "课程标题")
|
||||
* @ApiParams(name = "headimage", type = "string",required=true,description = "课程头图")
|
||||
* @ApiParams(name = "images", type = "string",required=true,description = "课程轮播图多值逗号拼接")
|
||||
* @ApiParams(name = "type", type = "string",required=true,description = "地点类型:out=户外,in=室内")
|
||||
* @ApiParams(name = "spec", type = "string",required=true,description = "课时多规格:[{'id':665,'classes_lib_id':570,'name':'xxxxx','limit_num':100,'status':'1','weigh':665,'time':'2024\/12\/12 19:00 - 2024\/12\/12 20:00'}] ")
|
||||
* @ApiParams(name = "address_type", type = "string",required=true,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 = "address", type = "string",required=false,description = "地图定位地址")
|
||||
* @ApiParams(name = "address_detail", type = "string",required=false,description = "手录详细地址")
|
||||
* @ApiParams(name = "longitude", type = "string",required=false,description = "经度")
|
||||
* @ApiParams(name = "latitude", type = "string",required=false,description = "纬度")
|
||||
* @ApiParams(name = "content", type = "string",required=false,description = "课程详情")
|
||||
* @ApiParams(name = "notice", type = "string",required=false,description = "课程须知")
|
||||
* @ApiParams(name = "price", type = "string",required=false,description = "课程价格 0为免费")
|
||||
* @ApiParams(name = "selfhot", type = "string",required=false,description = "机构热门:0=否,1=是")
|
||||
* @ApiReturn({
|
||||
*
|
||||
*})
|
||||
*/
|
||||
public function edit(){
|
||||
$user_id = 0;
|
||||
$user = $this->auth->getUser();//登录用户
|
||||
if($user)$user_id = $user['id'];
|
||||
$params = [];
|
||||
$id = $this->request->post('id/d', 0);
|
||||
$params["status"] = $this->request->post('status/s', 0); //上架状态:1=上架,2=下架,3=平台下架
|
||||
$params["teacher_id"] = $this->request->post('teacher_id/d', 0); //老师id
|
||||
$params["classes_type"] = $this->request->post('classes_type/s', 0); //老师id
|
||||
$params["classes_cate_ids"] = $this->request->post('classes_cate_ids/s', 0); //课程标签
|
||||
$params["classes_label_ids"] = $this->request->post('classes_label_ids/s', 0); //课程热门标签
|
||||
$params["self_label_tag"] = $this->request->post('self_label_tag/s', 0); //老师id
|
||||
$params["title"] = $this->request->post('title/s', 0); //老师id
|
||||
$params["headimage"] = $this->request->post('headimage/s', 0); //老师id
|
||||
$params["images"] = $this->request->post('images/s', 0); //老师id
|
||||
$params["type"] = $this->request->post('type/s', 0); //老师id
|
||||
$params["spec"] = $this->request->post('spec/s', 0); //老师id
|
||||
$params["address_type"] = $this->request->post('address_type/s', 0); //老师id
|
||||
$params["province"] = $this->request->post('province/d', 0); //老师id
|
||||
$params["city"] = $this->request->post('city/d', 0); //老师id
|
||||
$params["district"] = $this->request->post('district/d', 0); //老师id
|
||||
$params["address"] = $this->request->post('address/s', 0); //老师id
|
||||
$params["address_detail"] = $this->request->post('address_detail/s', 0); //老师id
|
||||
$params["longitude"] = $this->request->post('longitude/s', 0); //老师id
|
||||
$params["latitude"] = $this->request->post('latitude/s', 0); //老师id
|
||||
$params["content"] = $this->request->post('content/s', 0); //老师id
|
||||
$params["notice"] = $this->request->post('notice/s', 0); //老师id
|
||||
$params["price"] = $this->request->post('price/f', 0); //老师id
|
||||
$params["selfhot"] = $this->request->post('selfhot/s', 0); //老师id
|
||||
|
||||
|
||||
//classes_type
|
||||
|
||||
try{
|
||||
$res = $this->model->updateClassesByOper($params,$id,true,'user',$user_id,true);
|
||||
}catch (\Throwable $e){
|
||||
$this->error($e->getMessage());
|
||||
}
|
||||
$this->success('编辑成功', $res);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @ApiTitle(员工课程批量删除)
|
||||
* @ApiSummary(员工课程批量删除)
|
||||
* @ApiMethod(POST)
|
||||
* @ApiParams(name = "ids", type = "string",required=true,description = "需要删除的一组课程id,多值逗号拼接")
|
||||
* @ApiReturn({
|
||||
*
|
||||
*})
|
||||
*/
|
||||
public function del(){
|
||||
$user_id = 0;
|
||||
$user = $this->auth->getUser();//登录用户
|
||||
if($user)$user_id = $user['id'];
|
||||
|
||||
$ids = $this->request->post('ids/s', '');
|
||||
|
||||
try{
|
||||
$res = $this->model->deleteClassesByOper($ids,true,'user',$user_id,true);
|
||||
}catch (\Throwable $e){
|
||||
$this->error($e->getMessage());
|
||||
}
|
||||
$this->success("成功删除{$res}条数据",["delete_number"=>$res]);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -209,5 +209,11 @@ class ServiceOrder extends Base
|
|||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -128,6 +128,9 @@ $userHooks = [
|
|||
'user_auth_fail_after' => [ // 用户授权机构不通过
|
||||
'app\\common\\listener\\user\\UserHook'
|
||||
],
|
||||
'user_update_after' => [ // 用户信息更新后
|
||||
'app\\common\\listener\\user\\UserHook'
|
||||
],
|
||||
];
|
||||
|
||||
|
||||
|
|
|
@ -22,10 +22,10 @@ class Sqlscript
|
|||
->page($page,$limit)->select();
|
||||
|
||||
//默认机构id
|
||||
$manystore_id = 2;
|
||||
$shop_id = 2;
|
||||
$user_id = 25;
|
||||
$teacher_id = 8;
|
||||
$manystore_id = 1;
|
||||
$shop_id = 1;
|
||||
$user_id = 72;
|
||||
$teacher_id = 15;
|
||||
|
||||
foreach ($kechengs as $k=>$v){
|
||||
$classes_cate_ids = Cate::where( "name",$v["gongyi"])->value("id");
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
<?php
|
||||
namespace app\common\listener\manystore;
|
||||
use app\common\model\dyqc\ManystoreShop;
|
||||
use app\common\model\school\classes\ClassesLib;
|
||||
use app\common\model\school\Message;
|
||||
use app\manystore\model\Manystore;
|
||||
|
@ -71,6 +72,9 @@ class ShopHook
|
|||
Message::$event_name = $params["event"];
|
||||
Message::send($title,$desc,$mini_type,$to_id,$to_type,$status,$platform,$params,$oper_id,$oper_type);
|
||||
|
||||
//机构初始化数据
|
||||
ManystoreShop::initData($shop->id);
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -100,8 +100,19 @@ class UserHook
|
|||
Message::$event_name = $params["event"];
|
||||
Message::send($title,$desc,$mini_type,$to_id,$to_type,$status,$platform,$params,$oper_id,$oper_type);
|
||||
|
||||
}
|
||||
|
||||
|
||||
public function userUpdateAfter(&$params)
|
||||
{
|
||||
//设置用户更新信息
|
||||
['user' => $user] = $params;
|
||||
//如果存在机构端,则同时同步机构端账号信息
|
||||
$manystore = Manystore::where("user_id",$user["id"])->find();
|
||||
if($manystore){
|
||||
$manystore["nickname"] = $user["realname"] ?:$user["nickname"];
|
||||
if($user["avatar"])$manystore["avatar"] = $user["avatar"];
|
||||
$manystore->save();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -150,7 +150,7 @@ class BaseModel extends Model
|
|||
$alisa_name = '';
|
||||
if($alisa)$alisa_name = "{$alisa}.";
|
||||
if(!$sort)$sort = "{$alisa_name}id asc";
|
||||
$self = static::getBaseWhere($whereData, null, $alisa,true);
|
||||
$self = static::getBaseWhere($whereData, null, $alisa,$this->withTable);
|
||||
if($this->withTable)$self = $self->with($this->withTable);
|
||||
if($page&&$limit)$self = $self->orderRaw($sort)->where($where)->page($page, $limit);
|
||||
$list = $self->select();
|
||||
|
@ -175,7 +175,7 @@ class BaseModel extends Model
|
|||
}
|
||||
}
|
||||
if($toArray)$list = collection($list)->toArray();
|
||||
$countSelf = static::getBaseWhere($whereData, null, $alisa,true);
|
||||
$countSelf = static::getBaseWhere($whereData, null, $alisa,$this->withTable);
|
||||
if($this->withTable)$countSelf = $countSelf->with($this->withTable);
|
||||
$count = $countSelf->where($where)->count();
|
||||
return compact('list', 'count','page','limit');
|
||||
|
|
|
@ -6,6 +6,7 @@ use app\common\model\BaseModel;
|
|||
use app\common\model\school\Area;
|
||||
use app\common\model\school\classes\ClassesLib;
|
||||
use app\common\model\school\classes\Teacher;
|
||||
use app\common\model\school\classes\Verification;
|
||||
use app\common\model\User;
|
||||
use app\manystore\model\Manystore;
|
||||
use app\manystore\model\ManystoreAuthGroup;
|
||||
|
@ -199,11 +200,36 @@ class ManystoreShop extends BaseModel
|
|||
|| empty($self["images"])
|
||||
|| empty($self["content"])
|
||||
|| empty($self["tel"])
|
||||
|| empty($self["logo"])
|
||||
) return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public function checkFullMsg($id){
|
||||
if($this->checkFull($id)){
|
||||
//必要信息已完善
|
||||
return '<div class="alert alert-success-light">
|
||||
<b >必要展示信息已完善!可正常上架课程!</b></div>';
|
||||
}else{
|
||||
//必要信息未完善
|
||||
return "<div class='alert alert-danger-light'><b>必要展示信息未完善,请先在机构完善展示信息</b><br><br>
|
||||
|
||||
<span>必要展示信息为: </span><br><br><br>
|
||||
<span>1:地址信息:包括详细地址、所在城市、所在省、所在市、所在县、经纬度</span><br>
|
||||
<span>2:店铺名称</span><br>
|
||||
<span>3:店铺logo</span><br>
|
||||
<span>4:店铺封面图</span><br>
|
||||
<span>5:店铺环境照</span><br>
|
||||
<span>6:服务电话</span><br>
|
||||
<span>7:店铺详情</span><br><br><br>
|
||||
<b>请您确保上述信息均已完善后才能正常上架课程。 </b><br><br>
|
||||
<b>若已完善请您刷新页面。 </b><br><br>
|
||||
</div>
|
||||
";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -336,7 +362,7 @@ class ManystoreShop extends BaseModel
|
|||
'reverse_idcard_image' => 'require',
|
||||
'images' => 'require',
|
||||
'yyzz_images' => 'require',
|
||||
'yyzzdm' => 'require',
|
||||
// 'yyzzdm' => 'require',
|
||||
|
||||
|
||||
'address' => 'require',
|
||||
|
@ -376,7 +402,7 @@ class ManystoreShop extends BaseModel
|
|||
'reverse_idcard_image.require' => '法人身份证反面必须上传',
|
||||
'images.require' => '机构环境照片必须上传',
|
||||
'yyzz_images.require' => '营业执照照片必须上传',
|
||||
'yyzzdm.require' => '企业统一信用代码必填',
|
||||
// 'yyzzdm.require' => '企业统一信用代码必填',
|
||||
// 'establish_time.require' => '成立时间必填',
|
||||
// 'people.require' => '员工人数必填',
|
||||
|
||||
|
@ -407,6 +433,10 @@ class ManystoreShop extends BaseModel
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// $order = self::getHaveCancelOrder($order_no);
|
||||
|
||||
//判断逻辑
|
||||
|
@ -421,6 +451,14 @@ class ManystoreShop extends BaseModel
|
|||
//如果存在申请单,则直接更新这个单的状态
|
||||
//如果不存在则创建一个新单
|
||||
if(!$shop){
|
||||
|
||||
//申请认证的时候不能是老师或其他机构的核销员
|
||||
$teacher = Teacher::where("user_id" ,$user_id)->find();
|
||||
if($teacher) throw new \Exception("您已经是老师,不能申请认证!");
|
||||
|
||||
$verification = Verification::where("user_id" ,$user_id)->find();
|
||||
if($verification) throw new \Exception("您已经是机构核销员,不能申请认证!");
|
||||
|
||||
//创建申请单
|
||||
$shop = $this->creatShop($type,$user_id,$params);
|
||||
}else{
|
||||
|
@ -430,6 +468,7 @@ class ManystoreShop extends BaseModel
|
|||
throw new \Exception($shop->getError());
|
||||
}
|
||||
}
|
||||
|
||||
$shop = ManystoreShop::where( 'user_id',$user_id)->find();
|
||||
//更新申请单状态为审核中
|
||||
$shop['status']= '0';
|
||||
|
@ -529,9 +568,16 @@ public function creatShop($type,$user_id,$params){
|
|||
if($shop_info === false){
|
||||
throw new \Exception($shop->getError());
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
$user = User::where("id",$user_id)->find();
|
||||
if(!$user) throw new \Exception("用户不存在");
|
||||
|
||||
//账号主表
|
||||
$manystore_params = [
|
||||
"nickname" => $params["name"],
|
||||
"nickname" => $user["realname"] ?: $user["nickname"],
|
||||
"user_id"=>$user_id,
|
||||
];
|
||||
$manystore_params["username"] = $params["tel"] ?: self::$pinyin->permalink($manystore_params["nickname"]);
|
||||
|
@ -543,6 +589,10 @@ public function creatShop($type,$user_id,$params){
|
|||
$manystore_params['salt'] = Random::alnum();
|
||||
$manystore_params['password'] = md5(md5($manystore_params['password']) . $manystore_params['salt']);
|
||||
$manystore_params['avatar'] = '/assets/img/avatar.png'; //设置新管理员默认头像。
|
||||
|
||||
//如果用户存在头像取用户头像
|
||||
if($user["avatar"]) $manystore_params['avatar'] = $user["avatar"];
|
||||
|
||||
$manystore_params['is_main'] = 1;
|
||||
$manystore_params['status'] = "hidden";
|
||||
$model = new Manystore();
|
||||
|
@ -743,7 +793,54 @@ public static function getAuthInfo($user_id){
|
|||
return $selfetch;
|
||||
}
|
||||
|
||||
/** 机构初始化数据
|
||||
* @param $shop_id
|
||||
* @return void
|
||||
*/
|
||||
public static function initData($shop_id){
|
||||
|
||||
//设置初始化课程
|
||||
$shop = self::where("id",$shop_id)->find();
|
||||
if($shop){
|
||||
$user = $shop->user;
|
||||
|
||||
$manystore = Manystore::where("shop_id" ,$shop_id)->find();
|
||||
if($user && $manystore){
|
||||
//授权认证成功
|
||||
$result = \app\common\model\manystore\UserAuth::auth(0,$shop["id"],$shop["user_id"],"1",'admin',0);
|
||||
//删除用户所有老师和核销员
|
||||
Teacher::where("user_id",$user["id"])->delete();
|
||||
Verification::where("user_id",$user["id"])->delete();
|
||||
//为用户初始化老师和核销员
|
||||
$teacherData = [
|
||||
"manystore_id"=> $manystore["id"],
|
||||
"shop_id" => $shop["id"],
|
||||
"user_id" => $user["id"],
|
||||
"name" => $shop["name"] . "讲师",
|
||||
"head_image" => $user["avatar"],
|
||||
"content" => $shop["name"] . "讲师".",为您提供授课,核销,专人指导等服务。",
|
||||
"status" => "2",
|
||||
"weigh" => 0,
|
||||
];
|
||||
Teacher::create($teacherData);
|
||||
|
||||
$verification_data =[
|
||||
"manystore_id"=> $manystore["id"],
|
||||
"shop_id" => $shop["id"],
|
||||
"user_id" => $user["id"],
|
||||
"status" => "1",
|
||||
];
|
||||
Verification::create($verification_data);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// public static function deleteDataByShopId($shop_id){
|
||||
// $ids = ClassesLib::where("shop_id",$shop_id)->column("id");
|
||||
//
|
||||
//
|
||||
// }
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -2,9 +2,12 @@
|
|||
|
||||
namespace app\common\model\school\classes;
|
||||
|
||||
use app\admin\model\Admin;
|
||||
use app\common\library\Virtual;
|
||||
use app\common\model\BaseModel;
|
||||
use app\common\model\dyqc\ManystoreShop;
|
||||
use app\common\model\manystore\Shop;
|
||||
use app\common\model\school\Area;
|
||||
use app\common\model\school\classes\lib\Spec;
|
||||
use app\common\model\User;
|
||||
use app\manystore\model\Manystore;
|
||||
|
@ -326,7 +329,7 @@ class ClassesLib extends BaseModel
|
|||
* @throws \think\exception\DbException
|
||||
*/
|
||||
public function detail($id,$user_id=0,$oper_type='user',$trans=false){
|
||||
$self = $this->get($id,['shop','teacher','user']);
|
||||
$self = $this->get($id,['shop','teacher','user','specs']);
|
||||
|
||||
//是否收藏
|
||||
$self['is_collect'] = 0;
|
||||
|
@ -348,18 +351,26 @@ class ClassesLib extends BaseModel
|
|||
|
||||
$cate_list = Cate::where("status",'1')->column("name","id");
|
||||
$label_list = Label::where("status",'1')->column("name","id");
|
||||
$type_list = Label::where("status",'1')->column("name","id");
|
||||
|
||||
$classes_label_ids = $self['classes_label_ids'];
|
||||
$classes_cate_ids = $self['classes_cate_ids'];
|
||||
$classes_label = $classes_cate = [];
|
||||
$classes_type_ids = $self['classes_type'];
|
||||
$classes_label = $classes_cate = $classes_type = [];
|
||||
foreach (explode(",", $classes_label_ids) as $classes_label_id){
|
||||
if(isset($label_list[$classes_label_id]))$classes_label[] = $label_list[$classes_label_id];
|
||||
}
|
||||
foreach (explode(",", $classes_cate_ids) as $classes_cate_id){
|
||||
if(isset($cate_list[$classes_cate_id]))$classes_cate[] = $cate_list[$classes_cate_id];
|
||||
}
|
||||
|
||||
foreach (explode(",", $classes_type_ids) as $classes_type_id){
|
||||
if(isset($type_list[$classes_type_id]))$classes_type[] = $type_list[$classes_type_id];
|
||||
}
|
||||
|
||||
$self['classes_label'] = $classes_label;
|
||||
$self['classes_cate'] = $classes_cate;
|
||||
$self['classes_type_name'] = $classes_type;
|
||||
|
||||
|
||||
//下架判断
|
||||
|
@ -620,15 +631,22 @@ $user_unpaid_order = $user_paid_order =null;
|
|||
|
||||
$cate_list = Cate::where("status",'1')->column("name","id");
|
||||
$label_list = Label::where("status",'1')->column("name","id");
|
||||
|
||||
$type_list = Type::where("status",'1')->column("name","id");
|
||||
|
||||
// 查询自提点
|
||||
if(isset($status) && in_array($status, ['1','2','3'])){
|
||||
$selfetch = self::with($with);
|
||||
}else{
|
||||
$selfetch = self::with($with)->where($a.'status', '1')->where("{$a}auth_status",1);
|
||||
$selfetch = self::with($with)->where($a.'status', '1');
|
||||
}
|
||||
|
||||
if(isset($auth_status) && in_array($auth_status, ['0','1','2'])){
|
||||
|
||||
}else{
|
||||
$selfetch = $selfetch->where("{$a}auth_status",1);
|
||||
}
|
||||
|
||||
|
||||
|
||||
$order = $order?? 'normal';
|
||||
$per_page = $limit ?? 10;
|
||||
|
@ -723,6 +741,11 @@ $user_unpaid_order = $user_paid_order =null;
|
|||
$selfetch = $selfetch->where("{$a}feel", 'in', ''.$feel);
|
||||
}
|
||||
|
||||
//设置订单信息
|
||||
if(isset($auth_status) && $auth_status != -1){
|
||||
$selfetch = $selfetch->where("{$a}auth_status", 'in', ''.$auth_status);
|
||||
}
|
||||
|
||||
|
||||
|
||||
//区域搜索
|
||||
|
@ -837,15 +860,23 @@ $user_unpaid_order = $user_paid_order =null;
|
|||
}
|
||||
$classes_label_ids = $row['classes_label_ids'];
|
||||
$classes_cate_ids = $row['classes_cate_ids'];
|
||||
$classes_label = $classes_cate = [];
|
||||
$classes_type_ids = $row['classes_type'];
|
||||
$classes_label = $classes_cate = $classes_type = [];
|
||||
foreach (explode(",", $classes_label_ids) as $classes_label_id){
|
||||
if(isset($label_list[$classes_label_id]))$classes_label[] = $label_list[$classes_label_id];
|
||||
}
|
||||
foreach (explode(",", $classes_cate_ids) as $classes_cate_id){
|
||||
if(isset($cate_list[$classes_cate_id]))$classes_cate[] = $cate_list[$classes_cate_id];
|
||||
}
|
||||
|
||||
foreach (explode(",", $classes_type_ids) as $classes_type_id){
|
||||
if(isset($type_list[$classes_type_id]))$classes_type[] = $type_list[$classes_type_id];
|
||||
}
|
||||
|
||||
|
||||
$row['classes_label'] = $classes_label;
|
||||
$row['classes_cate'] = $classes_cate;
|
||||
$row['classes_type_name'] = $classes_type;
|
||||
|
||||
}
|
||||
|
||||
|
@ -1021,9 +1052,15 @@ $user_unpaid_order = $user_paid_order =null;
|
|||
public $no_auth_fields = ["user_id","teacher_id","classes_type","classes_cate_ids","classes_label_ids","self_label_tag",'headimage','images','notice','content',"virtual_num","virtual_collect","underline_price"];
|
||||
|
||||
|
||||
public $need_auth = false;
|
||||
public $have_auth = false;
|
||||
|
||||
public $success_auth = false;
|
||||
public $error_auth = false;
|
||||
|
||||
public function classesCheck(&$params,$shop_id=null,$row=null)
|
||||
{
|
||||
// if($row)$params["auth_status"] = $params["auth_status"] ?? $row["auth_status"];
|
||||
if($row)$params["auth_status"] = $params["auth_status"] ?? $row["auth_status"];
|
||||
$params["auth_status"] = $params["auth_status"] ?? '0';
|
||||
|
||||
$params["status"] = $params["status"] ?? '3';
|
||||
|
@ -1226,4 +1263,379 @@ $user_unpaid_order = $user_paid_order =null;
|
|||
|
||||
|
||||
|
||||
|
||||
protected function update_check(&$params,$row=null,$shop_id=0)
|
||||
{
|
||||
|
||||
|
||||
|
||||
$this->classesCheck($params,$shop_id,$row);
|
||||
|
||||
//特有认证判断
|
||||
// $this->authClasses($params,$row);
|
||||
// var_dump($row);die;
|
||||
//更新
|
||||
if($row){
|
||||
if($row['status'] == "3" && $params['status'] != $row['status']){
|
||||
$this->error("平台下架审核的课程无法上架!");
|
||||
}
|
||||
|
||||
//如果是审核失败,提交后自动更新成审核中
|
||||
if($row['auth_status'] == 2){
|
||||
$params['status'] = "3";
|
||||
$params['auth_status'] = 0;
|
||||
$params["reason"] = "";
|
||||
}
|
||||
}else{
|
||||
//新增(需审核)
|
||||
$params["add_type"] = '1';
|
||||
$params["add_id"] = $this->auth->id;
|
||||
$params['status'] = "3";//平台下架
|
||||
$params['auth_status'] = 0;
|
||||
|
||||
$this->have_auth = true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/** 操作权限检测
|
||||
* @param $order 订单
|
||||
* @param $oper_id 操作人id
|
||||
* @param $oper_type 操作人类型:user-用户或员工,admin-管理员
|
||||
* @return void
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
* @throws \think\exception\DbException
|
||||
*/
|
||||
public static function checkOptionAuth($classes_id,$oper_id,$oper_type,$only_user=false,$only_shop=false,$only_admin=false){
|
||||
$classes = null;
|
||||
$shop_id = 0;
|
||||
//课程是否存在并上架
|
||||
if($classes_id){
|
||||
$classes = self::get($classes_id);
|
||||
if(!$classes) throw new \Exception("课程不存在或已下架!");
|
||||
$shop_id = $classes["shop_id"];
|
||||
}
|
||||
|
||||
|
||||
switch ($oper_type) {
|
||||
case 'user':
|
||||
if($only_admin)throw new \Exception("您无权操作该订单!");
|
||||
if($only_shop)throw new \Exception("您无权操作该订单!");
|
||||
//自己或操作员
|
||||
$Shop = Shop::where("user_id",$oper_id)->find();
|
||||
if($Shop)$shop_id = $Shop["id"];
|
||||
if($Shop && $classes){
|
||||
if($Shop["id"] == $classes["shop_id"]){
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//说明是操作员
|
||||
$help_user_info = User::where('id',$oper_id)->find();
|
||||
if(!$help_user_info) throw new \Exception("代下单员工不存在!");
|
||||
$classes_lib_ids = (new ClassesLib)->getClassesAuthIds($oper_id);
|
||||
|
||||
if(!$shop_id)$shop_id = self::where("id" ,"in", $classes_lib_ids)->value("shop_id");
|
||||
|
||||
//判断当前订单课程是否在此课程授权范围内
|
||||
if($classes && !in_array($classes_id,$classes_lib_ids)) throw new \Exception("该课程不在您的授权范围内,无法代操作!");
|
||||
|
||||
break;
|
||||
case 'admin':
|
||||
$admin_info = Admin::where('id',$oper_id)->find();
|
||||
if(!$admin_info) throw new \Exception("代下单管理员不存在!");
|
||||
break;
|
||||
case 'shop':
|
||||
if($only_admin)throw new \Exception("您无权操作该订单!");
|
||||
|
||||
if($only_user) throw new \Exception("您无权操作该订单!");
|
||||
|
||||
$admin_info = Manystore::where('id',$oper_id)->find();
|
||||
if(!$admin_info) throw new \Exception("代下单管理员不存在!");
|
||||
$shop_id = $admin_info["shop_id"];
|
||||
|
||||
$classes_lib_ids = ClassesLib::where("manystore_id",$oper_id)->column("id");
|
||||
//判断当前订单课程是否在此课程授权范围内
|
||||
if($classes && !in_array($classes_id,$classes_lib_ids)) throw new \Exception("该课程不在您的授权范围内,无法代操作!");
|
||||
break;
|
||||
default:
|
||||
throw new \Exception("请选择正确的代下单类型!");
|
||||
}
|
||||
if(!$shop_id) throw new \Exception("无法判定课程所属店铺!");
|
||||
|
||||
return $shop_id;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/** 小程序端操作课程添加
|
||||
* @param bool $check
|
||||
* @param bool $trans
|
||||
* @return bool
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function createClassesByOper($params,$check=false,$oper_type='user',$oper_id=0,$trans=false){
|
||||
|
||||
$model = new self;
|
||||
|
||||
|
||||
//用户操作权限检测
|
||||
$shop_id = self::checkOptionAuth(0, $oper_id,$oper_type);
|
||||
|
||||
|
||||
$this->update_check($params,$row=null,$shop_id);
|
||||
$spec = $params["spec"];
|
||||
unset($params["spec"]);
|
||||
|
||||
|
||||
$province_name = Area::where("id" ,$params['province'])->value("name");
|
||||
if(!$province_name) throw new \Exception("省份不存在");
|
||||
$city_name = Area::where("id" ,$params['city'])->value("name");
|
||||
if(!$city_name) throw new \Exception("市不存在");
|
||||
$district_name = Area::where("id" ,$params['district'])->value("name");
|
||||
if(!$district_name) throw new \Exception("区县不存在");
|
||||
$params['address_city'] = $province_name."/".$city_name."/".$district_name;
|
||||
|
||||
//判断逻辑
|
||||
if($trans){
|
||||
self::beginTrans();
|
||||
}
|
||||
$res = true;
|
||||
try{
|
||||
//事务逻辑
|
||||
|
||||
|
||||
$result = $model->allowField(true)->save($params);
|
||||
\app\common\model\school\classes\ClassesLib::add_virtual_init($model["id"]);
|
||||
|
||||
//添加课程规格
|
||||
foreach ($spec as $k=>$v){
|
||||
$v["classes_lib_id"] = $model["id"];
|
||||
\app\common\model\school\classes\ClassesSpec::create($v);
|
||||
}
|
||||
|
||||
//因为是批量添加,所有规格重新进行检测,防止出现时间重叠
|
||||
$specss = \app\common\model\school\classes\ClassesSpec::where("classes_lib_id",$model["id"])->select();
|
||||
foreach ($specss as $k=>$specs){
|
||||
$params =$specs;
|
||||
(new \app\common\model\school\classes\ClassesSpec)->specCheck($params,null,$specs);
|
||||
}
|
||||
|
||||
//课时数必须大于等于课时核销数
|
||||
$count = \app\common\model\school\classes\ClassesSpec::where("classes_lib_id",$model["id"])->count();
|
||||
$classes_num = \app\common\model\school\classes\ClassesLib::where("id",$model["id"])->value("classes_num");
|
||||
if($count < $classes_num){
|
||||
throw new \Exception("课时数必须大于等于课时核销数");
|
||||
}
|
||||
|
||||
|
||||
$this->update_classes($model["id"]);
|
||||
if($this->have_auth){
|
||||
//调用通过事件
|
||||
$data = ['classes' => $model];
|
||||
\think\Hook::listen('classes_auth_need_after', $data);
|
||||
|
||||
}
|
||||
|
||||
// if($this->success_auth){
|
||||
// //调用通过事件
|
||||
// $data = ['classes' => $model];
|
||||
// \think\Hook::listen('classes_auth_success_after', $data);
|
||||
// }
|
||||
//
|
||||
//
|
||||
// if($this->error_auth){
|
||||
// //调用通过事件
|
||||
// $data = ['classes' => $model];
|
||||
// \think\Hook::listen('classes_auth_fail_after', $data);
|
||||
//
|
||||
// }
|
||||
|
||||
|
||||
|
||||
|
||||
if($trans){
|
||||
self::commitTrans();
|
||||
}
|
||||
}catch (\Exception $e){
|
||||
if($trans){
|
||||
self::rollbackTrans();
|
||||
}
|
||||
throw new \Exception($e->getMessage().$e->getFile().$e->getLine());
|
||||
}
|
||||
return $model;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/** 小程序端操作课程修改
|
||||
* @param bool $check
|
||||
* @param bool $trans
|
||||
* @return bool
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function updateClassesByOper($params,$ids,$check=false,$oper_type='user',$oper_id=0,$trans=false){
|
||||
|
||||
//用户操作权限检测
|
||||
$shop_id = self::checkOptionAuth($ids, $oper_id,$oper_type);
|
||||
|
||||
|
||||
$row = self::where('id',$ids)->where("shop_id",$shop_id)->find();
|
||||
if(!$row) throw new \Exception("课程不存在!");
|
||||
|
||||
|
||||
$this->update_check($params,$row,$shop_id);
|
||||
$spec = $params["spec"] ?? [];//$params["delete_spec_ids"]
|
||||
$delete_spec_ids = $params["delete_spec_ids"] ?? [];
|
||||
unset($params["spec"]);
|
||||
unset($params["delete_spec_ids"]);
|
||||
|
||||
|
||||
$province_name = Area::where("id" ,$params['province'])->value("name");
|
||||
if(!$province_name) throw new \Exception("省份不存在");
|
||||
$city_name = Area::where("id" ,$params['city'])->value("name");
|
||||
if(!$city_name) throw new \Exception("市不存在");
|
||||
$district_name = Area::where("id" ,$params['district'])->value("name");
|
||||
if(!$district_name) throw new \Exception("区县不存在");
|
||||
$params['address_city'] = $province_name."/".$city_name."/".$district_name;
|
||||
|
||||
|
||||
|
||||
//判断逻辑
|
||||
if($trans){
|
||||
self::beginTrans();
|
||||
}
|
||||
$res = true;
|
||||
try{
|
||||
//事务逻辑
|
||||
|
||||
$result = $row->allowField(true)->save($params);
|
||||
|
||||
foreach ($spec as $k=>$v){
|
||||
$v["classes_lib_id"] = $row["id"];
|
||||
//有id更新,否则新增
|
||||
if(isset($v["id"]) && $v["id"]){
|
||||
\app\common\model\school\classes\ClassesSpec::update((new \app\common\model\school\classes\ClassesSpec)->checkAssemblyParameters($v));
|
||||
}else{
|
||||
\app\common\model\school\classes\ClassesSpec::create((new \app\common\model\school\classes\ClassesSpec)->checkAssemblyParameters($v));
|
||||
}
|
||||
}
|
||||
//删除规格
|
||||
foreach ($delete_spec_ids as $k=>$delete_spec){
|
||||
(new \app\common\model\school\classes\ClassesSpec)->updateCheck($delete_spec["id"]);
|
||||
|
||||
$delete_spec->delete();
|
||||
}
|
||||
|
||||
//因为是批量添加,所有规格重新进行检测,防止出现时间重叠
|
||||
$specss = \app\common\model\school\classes\ClassesSpec::where("classes_lib_id",$row["id"])->select();
|
||||
foreach ($specss as $k=>$specs){
|
||||
$params =$specs;
|
||||
(new \app\common\model\school\classes\ClassesSpec)->specCheck($params,null,$specs);
|
||||
}
|
||||
|
||||
|
||||
$this->update_classes($row["id"]);
|
||||
|
||||
if($this->have_auth){
|
||||
//调用通过事件
|
||||
$data = ['classes' => $row];
|
||||
\think\Hook::listen('classes_auth_need_after', $data);
|
||||
|
||||
}
|
||||
|
||||
// if($this->success_auth){
|
||||
// //调用通过事件
|
||||
// $data = ['classes' => $model];
|
||||
// \think\Hook::listen('classes_auth_success_after', $data);
|
||||
// }
|
||||
//
|
||||
//
|
||||
// if($this->error_auth){
|
||||
// //调用通过事件
|
||||
// $data = ['classes' => $model];
|
||||
// \think\Hook::listen('classes_auth_fail_after', $data);
|
||||
//
|
||||
// }
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if($trans){
|
||||
self::commitTrans();
|
||||
}
|
||||
}catch (\Exception $e){
|
||||
if($trans){
|
||||
self::rollbackTrans();
|
||||
}
|
||||
throw new \Exception($e->getMessage().$e->getFile().$e->getLine());
|
||||
}
|
||||
return $row;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/** 小程序端操作课程修改
|
||||
* @param bool $check
|
||||
* @param bool $trans
|
||||
* @return bool
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function deleteClassesByOper($ids,$check=false,$oper_type='user',$oper_id=0,$trans=false){
|
||||
|
||||
//用户操作权限检测
|
||||
$shop_id = self::checkOptionAuth($ids, $oper_id,$oper_type);
|
||||
|
||||
$row = self::where('id',$ids)->where("shop_id",$shop_id)->find();
|
||||
if(!$row) throw new \Exception("课程不存在!");
|
||||
|
||||
|
||||
$list = self::where("id", 'in', $ids)->select();
|
||||
foreach ($list as $item) {
|
||||
$this->updateCheck($item->id);
|
||||
}
|
||||
//判断逻辑
|
||||
if($trans){
|
||||
self::beginTrans();
|
||||
}
|
||||
$res = true;
|
||||
try{
|
||||
$count = 0;
|
||||
//事务逻辑
|
||||
//删除前检测
|
||||
foreach ($list as $k => $v) {
|
||||
//删除课程规格
|
||||
Spec::where("classes_lib_id",$v->id)->delete();
|
||||
$count += $v->delete();
|
||||
}
|
||||
if($trans){
|
||||
self::commitTrans();
|
||||
}
|
||||
}catch (\Exception $e){
|
||||
if($trans){
|
||||
self::rollbackTrans();
|
||||
}
|
||||
throw new \Exception($e->getMessage().$e->getFile().$e->getLine());
|
||||
}
|
||||
return $count;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -28,7 +28,8 @@ class ClassesSpec extends BaseModel
|
|||
protected $append = [
|
||||
'start_time_text',
|
||||
'end_time_text',
|
||||
'status_text'
|
||||
'status_text' ,
|
||||
'time'
|
||||
];
|
||||
|
||||
public $no_auth_fields = ['name','limit_num','status','weigh'];
|
||||
|
|
|
@ -200,6 +200,7 @@ class Evaluate extends BaseModel
|
|||
*/
|
||||
public static function detail($id,$user_id=0,$oper_type='user',$trans=false){
|
||||
$self = self::get($id,['user','shop',"lib",'teacher','classesorder']);
|
||||
if(!$self) throw new \Exception("未找到相关数据");
|
||||
|
||||
if($user_id){
|
||||
if($self["user_id"] != $user_id) throw new \Exception("非法访问");
|
||||
|
@ -230,7 +231,7 @@ class Evaluate extends BaseModel
|
|||
$order = \app\common\model\school\classes\order\Order::getHaveEvaluateOrder($order_no);
|
||||
if($check){
|
||||
//用户操作权限检测
|
||||
\app\common\model\school\classes\hourorder\Order::checkOptionAuth($order['classes_order_id'],$user_id ?: $oper_id,$oper_type,true);
|
||||
\app\common\model\school\classes\hourorder\Order::checkOptionAuth($order['id'],$user_id ?: $oper_id,$oper_type,true);
|
||||
}
|
||||
|
||||
$detail = $order->detail;
|
||||
|
@ -323,7 +324,7 @@ class Evaluate extends BaseModel
|
|||
$order = \app\common\model\school\classes\order\Order::getHaveEvaluateOrder($order_no);
|
||||
if($check){
|
||||
//用户操作权限检测
|
||||
\app\common\model\school\classes\hourorder\Order::checkOptionAuth($order['classes_order_id'],$user_id ?: $oper_id,$oper_type,true);
|
||||
\app\common\model\school\classes\hourorder\Order::checkOptionAuth($order['id'],$user_id ?: $oper_id,$oper_type,true);
|
||||
}
|
||||
$detail = $order->detail;
|
||||
$user = $order->user;
|
||||
|
@ -453,7 +454,7 @@ class Evaluate extends BaseModel
|
|||
}else{
|
||||
$teacher_star = 5;
|
||||
}
|
||||
$teacher->save(['teacher_star'=>$teacher_star]);
|
||||
$teacher->save(['teacher_star'=>$teacher_star,'star_number'=>$count]);
|
||||
}
|
||||
|
||||
$shop = $self->shop; //shop_star
|
||||
|
@ -474,7 +475,7 @@ class Evaluate extends BaseModel
|
|||
}else{
|
||||
$shop_star = 5;
|
||||
}
|
||||
$shop->save(['shop_star'=>$shop_star]);
|
||||
$shop->save(['shop_star'=>$shop_star,'star_number'=>$count]);
|
||||
}
|
||||
$lib = $self->lib; //classes_star
|
||||
if($lib){
|
||||
|
@ -495,7 +496,7 @@ class Evaluate extends BaseModel
|
|||
}else{
|
||||
$classes_star = 5;
|
||||
}
|
||||
$lib->save(['classes_star'=>$classes_star]);
|
||||
$lib->save(['classes_star'=>$classes_star,'star_number'=>$count]);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -4,6 +4,7 @@ namespace app\common\model\school\classes\hourorder;
|
|||
|
||||
use app\admin\model\Admin;
|
||||
use app\admin\model\school\classes\Blacklist;
|
||||
use app\common\model\manystore\Shop;
|
||||
use app\common\model\school\classes\ClassesLib;
|
||||
use app\common\model\school\classes\ClassesSpec;
|
||||
use app\common\model\User;
|
||||
|
@ -185,7 +186,14 @@ class Order extends BaseModel
|
|||
}
|
||||
if (isset($whereData['status'])) $model = $model->where("{$alisa}status", 'in', $whereData['status']);
|
||||
if (isset($whereData['not_status'])) $model = $model->where("{$alisa}status", 'not in', $whereData['not_status']);
|
||||
if (isset($whereData['keywords'])&&$whereData['keywords']) $model = $model->where("{$alisa}order_no|{$alisa}id", '=', $whereData['keywords']);
|
||||
if (isset($whereData['keywords'])&&$whereData['keywords']){
|
||||
if($with && in_array('detail',$with)){
|
||||
$model = $model->where("{$alisa}order_no|{$alisa}id|{$alisa}name|detail.title", 'like', "%" .$whereData['keywords'] . "%");
|
||||
}else{
|
||||
$model = $model->where("{$alisa}order_no|{$alisa}id|{$alisa}name", 'like', "%" .$whereData['keywords'] . "%");
|
||||
}
|
||||
|
||||
}
|
||||
if (isset($whereData['createtime'])&&$whereData['createtime']){
|
||||
|
||||
$model = $model->time(["{$alisa}createtime",$whereData['createtime']]);
|
||||
|
@ -1107,6 +1115,15 @@ class Order extends BaseModel
|
|||
//自己或操作员
|
||||
if($oper_id != $classesOrder["user_id"]){
|
||||
if($only_user) throw new \Exception("您无权操作该订单!");
|
||||
|
||||
$Shop = Shop::where("user_id",$oper_id)->find();
|
||||
if($Shop){
|
||||
if($Shop["id"] == $classesOrder["shop_id"]){
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//说明是操作员
|
||||
$help_user_info = User::where('id',$oper_id)->find();
|
||||
if(!$help_user_info) throw new \Exception("代下单员工不存在!");
|
||||
|
|
|
@ -904,7 +904,7 @@ class Order extends BaseModel
|
|||
$model = $model->whereExists(function ($query) use ($alisa) {
|
||||
$order_table_name = (new \app\common\model\school\classes\hourorder\Order())->getQuery()->getTable();
|
||||
$query->table($order_table_name)->where($order_table_name . '.classes_order_id=' . $alisa . 'id')->where('status', '=', '3');
|
||||
});
|
||||
})->where("{$alisa}classes_evaluate_id", '=', 0);
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -923,6 +923,7 @@ class Order extends BaseModel
|
|||
'base'=>['*'],
|
||||
'shop'=>['*'],
|
||||
'detail'=>['*'],
|
||||
'evaluate'=>['*'],
|
||||
];
|
||||
$CANCEL = '-3';
|
||||
$NOPAY = '0';
|
||||
|
@ -1145,7 +1146,7 @@ class Order extends BaseModel
|
|||
$order = self::where('order_no|id|pay_no|code',$order_no)->whereExists(function ($query){
|
||||
$self_order_table_name = (new \app\common\model\school\classes\hourorder\Order())->getQuery()->getTable();
|
||||
$order_table_name = (new self())->getQuery()->getTable();
|
||||
$query->table($order_table_name)->where($order_table_name . '.classes_order_id=' . $self_order_table_name . '.id')->where('status', '=', '3');
|
||||
$query->table($self_order_table_name)->whereRaw($self_order_table_name . '.classes_order_id=' . $order_table_name . '.id')->where('status', '=', '3');
|
||||
})->find();
|
||||
if(!$order)throw new \Exception("只有一次核销之后订单可评价!");
|
||||
|
||||
|
|
|
@ -478,14 +478,15 @@ class ServiceOrder extends BaseModel
|
|||
|
||||
//校验订单参数
|
||||
//操作人权限验证
|
||||
self::checkOptionAuth($classes_order["id"],$oper_id ?:$user_id,$oper_type,true);
|
||||
self::checkOptionAuth($classes_order["id"],$oper_id ?:$user_id,$oper_type);
|
||||
|
||||
//免费单无法申请售后
|
||||
if($classes_order["payprice"]==0 && $classes_order["totalprice"] == 0 ) throw new \Exception("免费课程无法申请售后!");
|
||||
|
||||
//只有使用中的订单可以申请售后
|
||||
if($classes_order["status"] != '3' ) throw new \Exception("该订单当前状态无法申请售后!");
|
||||
if(($oper_id == $classes_order["user_id"] || $oper_type == 'user')&& $classes_order["status"] != '3' ) throw new \Exception("该订单当前状态无法申请售后!");
|
||||
|
||||
if(!in_array($classes_order["status"],['3','9']))throw new \Exception("只有进行中和已完成的订单可以申请售后!");
|
||||
//存在售后中的订单
|
||||
$count = self::where( 'classes_order_id',$classes_order["id"])->where("status","not in","7,-3")->count();
|
||||
if($count > 0) throw new \Exception("该订单已存在正在进行中的售后单,请等待售后处理!");
|
||||
|
@ -524,12 +525,21 @@ class ServiceOrder extends BaseModel
|
|||
//自己或操作员
|
||||
if($oper_id != $classesOrder["user_id"]){
|
||||
if($only_user) throw new \Exception("您无权操作该订单!");
|
||||
|
||||
$Shop = Shop::where("user_id",$oper_id)->find();
|
||||
if($Shop){
|
||||
if($Shop["id"] == $classesOrder["shop_id"]){
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
//说明是操作员
|
||||
$help_user_info = User::where('id',$oper_id)->find();
|
||||
if(!$help_user_info) throw new \Exception("代下单员工不存在!");
|
||||
$classes_lib_ids = (new ClassesLib)->getClassesAuthIds($oper_id);
|
||||
//判断当前订单课程是否在此课程授权范围内
|
||||
if(!in_array($classesOrder["classes_lib_id"],$classes_lib_ids)) throw new \Exception("该课程不在您的授权范围内,无法代操作!");
|
||||
|
||||
}else{
|
||||
$classes_lib_ids = (new ClassesLib)->getClassesAuthIds($oper_id);
|
||||
//不是员工并且想操作只有机构能操作的单
|
||||
|
|
|
@ -17,11 +17,11 @@ return [
|
|||
/**
|
||||
* 最大可上传大小
|
||||
*/
|
||||
'maxsize' => '5mb',
|
||||
'maxsize' => '2mb',
|
||||
/**
|
||||
* 可上传的文件类型
|
||||
*/
|
||||
'mimetype' => 'jpg,png,bmp,jpeg,gif,webp,zip,rar,wav,mp4,mp3,webm,p12,pem',
|
||||
'mimetype' => 'jpg,png,bmp,jpeg,gif,webp,zip,rar,wav,mp4,mp3,webm,p12,pem,doc,docx,xls,xlsx,pdf,txt,md,xml',
|
||||
/**
|
||||
* 是否支持批量上传
|
||||
*/
|
||||
|
|
|
@ -50,6 +50,9 @@ class Dashboard extends ManystoreBase
|
|||
'uploadmode' => $uploadmode
|
||||
]);
|
||||
|
||||
$this->view->assign('check_full',(new \app\common\model\dyqc\ManystoreShop)->checkFull(SHOP_ID));
|
||||
$this->view->assign('check_full_msg',(new \app\common\model\dyqc\ManystoreShop)->checkFullMsg(SHOP_ID));
|
||||
|
||||
return $this->view->fetch();
|
||||
}
|
||||
|
||||
|
|
|
@ -29,6 +29,9 @@ class Profile extends ManystoreBase
|
|||
$this->view->assign('typeList',$shop_info->getTypeList());
|
||||
|
||||
$this->view->assign('shop_info',$shop_info);
|
||||
$this->view->assign('check_full',(new \app\common\model\dyqc\ManystoreShop)->checkFull(SHOP_ID));
|
||||
$this->view->assign('check_full_msg',(new \app\common\model\dyqc\ManystoreShop)->checkFullMsg(SHOP_ID));
|
||||
|
||||
$this->getCity();
|
||||
return $this->view->fetch();
|
||||
}
|
||||
|
@ -49,9 +52,9 @@ class Profile extends ManystoreBase
|
|||
if (!Validate::is($params['email'], "email")) {
|
||||
$this->error(__("Please input correct email"));
|
||||
}
|
||||
if (!Validate::is($params['nickname'], "/^[\x{4e00}-\x{9fa5}a-zA-Z0-9_-]+$/u")) {
|
||||
$this->error(__("Please input correct nickname"));
|
||||
}
|
||||
// if (!Validate::is($params['nickname'], "/^[\x{4e00}-\x{9fa5}a-zA-Z0-9_-]+$/u")) {
|
||||
// $this->error(__("Please input correct nickname"));
|
||||
// }
|
||||
if (isset($params['password'])) {
|
||||
if (!Validate::is($params['password'], "/^[\S]{6,16}$/")) {
|
||||
$this->error(__("Please input correct password"));
|
||||
|
@ -84,7 +87,7 @@ class Profile extends ManystoreBase
|
|||
if ($this->request->isPost()) {
|
||||
$this->token();
|
||||
$shop = $this->request->post("shop/a");
|
||||
if($shop["address_city"] && !$shop["province"])$this->error("请选择所在城市");
|
||||
if($shop["address_city"] && !$shop["district"])$this->error("请选择所在城市");
|
||||
|
||||
|
||||
$shopModel = new ManystoreShop();
|
||||
|
|
|
@ -5,6 +5,7 @@ namespace app\manystore\controller\school\classes;
|
|||
use app\common\controller\ManystoreBase;
|
||||
use app\admin\model\dyqc\ManystoreShop;
|
||||
use app\common\controller\Backend;
|
||||
use app\common\model\school\classes\lib\Spec;
|
||||
use app\common\model\school\classes\Order;
|
||||
use app\manystore\model\Manystore;
|
||||
use think\Db;
|
||||
|
@ -64,6 +65,9 @@ class ClassesLib extends ManystoreBase
|
|||
$this->view->assign("specStatusList", (new \app\manystore\model\school\classes\ClassesSpec)->getStatusList());
|
||||
|
||||
$this->getCity();
|
||||
|
||||
$this->view->assign('check_full',(new \app\common\model\dyqc\ManystoreShop)->checkFull(SHOP_ID));
|
||||
$this->view->assign('check_full_msg',(new \app\common\model\dyqc\ManystoreShop)->checkFullMsg(SHOP_ID));
|
||||
}
|
||||
|
||||
public function import()
|
||||
|
@ -556,6 +560,10 @@ class ClassesLib extends ManystoreBase
|
|||
Db::startTrans();
|
||||
try {
|
||||
foreach ($list as $k => $v) {
|
||||
|
||||
//删除课程规格
|
||||
Spec::where("classes_lib_id",$v->id)->delete();
|
||||
|
||||
$count += $v->delete();
|
||||
}
|
||||
Db::commit();
|
||||
|
|
|
@ -3,6 +3,13 @@
|
|||
namespace app\manystore\controller\school\classes;
|
||||
|
||||
use app\common\controller\ManystoreBase;
|
||||
use app\common\model\manystore\UserAuth;
|
||||
use app\common\model\User;
|
||||
use app\manystore\model\Manystore;
|
||||
use think\Db;
|
||||
use think\Exception;
|
||||
use think\exception\PDOException;
|
||||
use think\exception\ValidateException;
|
||||
|
||||
/**
|
||||
* 课程反馈管理
|
||||
|
@ -19,7 +26,7 @@ class Evaluate extends ManystoreBase
|
|||
protected $model = null;
|
||||
|
||||
protected $qSwitch = true;
|
||||
protected $qFields = ["user_id","classes_lib_id","classes_order_id","manystore_id","shop_id","teacher_id"];
|
||||
protected $qFields = ["user_id","classes_lib_id","classes_order_id","manystore_id","shop_id","teacher_id","image","nickname"];
|
||||
|
||||
|
||||
|
||||
|
@ -82,4 +89,210 @@ class Evaluate extends ManystoreBase
|
|||
return $this->view->fetch();
|
||||
}
|
||||
|
||||
|
||||
|
||||
protected function updateCheck($id,$params=[],$row=null){
|
||||
|
||||
// 课程存在售后订单则不允许操作
|
||||
}
|
||||
|
||||
protected function update_after(&$row)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
protected function update_check(&$params,$row=null)
|
||||
{
|
||||
|
||||
$shop_id = SHOP_ID;
|
||||
$manystore = Manystore::where("shop_id", $shop_id)->find();
|
||||
if (!$manystore) {
|
||||
$this->error("店铺不存在");
|
||||
}
|
||||
$params["manystore_id"] = $manystore["id"];
|
||||
$params["shop_id"] = $shop_id;
|
||||
$user = User::where("id|nickname|realname|mobile", $params["user_id"])->find();
|
||||
if(!$user) $this->error("未找到用户请先让用户登录小程序再提交表单".$params["user_id"]);
|
||||
|
||||
|
||||
$params["user_id"] = $user["id"];
|
||||
|
||||
$user_id = $params["user_id"];
|
||||
//修改
|
||||
if($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_after($this->model);
|
||||
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_after($row);
|
||||
|
||||
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();
|
||||
foreach ($list as $item) {
|
||||
$this->updateCheck($item->id);
|
||||
}
|
||||
$count = 0;
|
||||
Db::startTrans();
|
||||
try {
|
||||
foreach ($list as $k => $v) {
|
||||
$count += $v->delete();
|
||||
}
|
||||
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'));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -69,7 +69,7 @@ class Order extends ManystoreBase
|
|||
$row->getRelation('user')->visible(['nickname','realname','mobile','avatar']);
|
||||
$row->getRelation('manystoreshop')->visible(['name','image','address_city','province','city','district','address','address_detail']);
|
||||
$row->getRelation('schoolclasseslib')->visible(['title','headimage']);
|
||||
$row->getRelation('schoolclassesorderdetail')->visible(['title','headimage',"feel"]);
|
||||
$row->getRelation('schoolclassesorderdetail')->visible(['title','headimage',"feel","teacher_id"]);
|
||||
$row->getRelation('admin')->visible(['nickname','avatar']);
|
||||
}
|
||||
|
||||
|
@ -110,4 +110,39 @@ class Order extends ManystoreBase
|
|||
return $this->view->fetch();
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**发起售后
|
||||
* @return string
|
||||
* @throws \think\Exception
|
||||
* @throws \think\exception\DbException
|
||||
*/
|
||||
public function after_sales($ids = ""){
|
||||
|
||||
if($this->request->isPost())
|
||||
{
|
||||
try{
|
||||
$params = $this->request->post("row/a");
|
||||
$classes_order = $params["id"];
|
||||
$reason = $params["reason"];
|
||||
|
||||
$model = (new \app\common\model\school\classes\order\ServiceOrder());
|
||||
$remark = "机构端管理员帮忙下售后单";
|
||||
$model->afterSales($classes_order,$reason,$remark,'shop',$this->auth->id,true);
|
||||
}catch (\Exception $e){
|
||||
$this->error($e->getMessage());
|
||||
}
|
||||
$this->success("执行成功");
|
||||
}
|
||||
|
||||
$row = $this->model->where(array('id'=>$ids))->find();
|
||||
if (!$row) {
|
||||
$this->error(__('No Results were found'));
|
||||
}
|
||||
|
||||
// $row = $this->model->get($param['ids']);
|
||||
$this->view->assign('row', $row);
|
||||
return $this->view->fetch();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -45,5 +45,21 @@ return [
|
|||
'Status 2' => '审核失败',
|
||||
'Reason' => '审核不通过原因',
|
||||
'Create_time' => '创建时间',
|
||||
'Update_time' => '修改时间'
|
||||
'Update_time' => '修改时间',
|
||||
|
||||
"Establish_time" => '成立时间',
|
||||
"People" => '员工人数',
|
||||
"Legal_entity" => '法人姓名',
|
||||
"Gender" => '性别',
|
||||
"Nation" => '民族',
|
||||
"Out_look" => '政治面貌',
|
||||
"Birthtime" => '出生日期',
|
||||
"Native_place" => '籍贯',
|
||||
"Card_number" => '身份证号码',
|
||||
"Diploma" => '学历',
|
||||
"Post" => '职务',
|
||||
"Social_position" => '社会职务',
|
||||
//Male'), '0'=>__('Female'
|
||||
'Male' => '男',
|
||||
'Female' => '女',
|
||||
];
|
||||
|
|
|
@ -22,7 +22,7 @@ return [
|
|||
'Type' => '地点类型',
|
||||
'Type out' => '户外',
|
||||
'Type in' => '室内',
|
||||
'Classes_num' => '多少节课',
|
||||
'Classes_num' => '核销次数',
|
||||
'Address_type' => '地址类型',
|
||||
'Address_type 1' => '按机构',
|
||||
'Address_type 2' => '独立位置',
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
<?php
|
||||
|
||||
return [
|
||||
'User_id' => '评价用户id',
|
||||
'Classes_lib_id' => '课程id',
|
||||
'Classes_order_id' => '课程订单id',
|
||||
'Manystore_id' => '机构账号id',
|
||||
'Shop_id' => '机构店铺id',
|
||||
'Teacher_id' => '老师id',
|
||||
'User_id' => '评价用户',
|
||||
'Classes_lib_id' => '课程',
|
||||
'Classes_order_id' => '课程订单',
|
||||
'Manystore_id' => '机构账号',
|
||||
'Shop_id' => '机构店铺',
|
||||
'Teacher_id' => '老师',
|
||||
'Image' => '评价人头像',
|
||||
'Nickname' => '评价人昵称',
|
||||
'Classes_star' => '课程评分',
|
||||
|
|
|
@ -125,4 +125,31 @@ class ManystoreShop extends Model
|
|||
->update();
|
||||
}
|
||||
|
||||
|
||||
public function getEstablishTimeTextAttr($value, $data)
|
||||
{
|
||||
$value = $value ? $value : (isset($data['establish_time']) ? $data['establish_time'] : '');
|
||||
return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
|
||||
}
|
||||
|
||||
|
||||
protected function setEstablishTimeAttr($value)
|
||||
{
|
||||
return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
|
||||
}
|
||||
|
||||
|
||||
public function getBirthtimeTextAttr($value, $data)
|
||||
{
|
||||
$value = $value ? $value : (isset($data['birthtime']) ? $data['birthtime'] : '');
|
||||
return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
|
||||
}
|
||||
|
||||
|
||||
protected function setBirthtimeAttr($value)
|
||||
{
|
||||
return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -12,7 +12,7 @@ class Manystore extends Validate
|
|||
*/
|
||||
protected $rule = [
|
||||
'username' => 'require|regex:\w{3,12}|unique:manystore',
|
||||
'nickname' => 'require|length:0,30|regex:/^[\x{4e00}-\x{9fa5}a-zA-Z0-9_-]+$/u',
|
||||
// 'nickname' => 'require|length:0,30|regex:/^[\x{4e00}-\x{9fa5}a-zA-Z0-9_-]+$/u',
|
||||
'password' => 'require|regex:\S{32}',
|
||||
'email' => 'require|email|unique:manystore,email',
|
||||
];
|
||||
|
@ -33,23 +33,23 @@ class Manystore extends Validate
|
|||
* 验证场景
|
||||
*/
|
||||
protected $scene = [
|
||||
'add' => ['username', 'email', 'nickname', 'password'],
|
||||
'edit' => ['username', 'email', 'nickname', 'password'],
|
||||
'add' => ['username', 'email', 'password'],
|
||||
'edit' => ['username', 'email', 'password'],
|
||||
];
|
||||
|
||||
public function __construct(array $rules = [], $message = [], $field = [])
|
||||
{
|
||||
$this->field = [
|
||||
'username' => __('Username'),
|
||||
'nickname' => __('Nickname'),
|
||||
// 'nickname' => __('Nickname'),
|
||||
'password' => __('Password'),
|
||||
'email' => __('Email'),
|
||||
];
|
||||
$this->message = array_merge($this->message, [
|
||||
'username.regex' => __('Please input correct username'),
|
||||
'password.regex' => __('Please input correct password'),
|
||||
'nickname.regex' => __('Please input correct nickname'),
|
||||
'nickname.length' => __('Please input length nickname'),
|
||||
// 'nickname.regex' => __('Please input correct nickname'),
|
||||
// 'nickname.length' => __('Please input length nickname'),
|
||||
]);
|
||||
parent::__construct($rules, $message, $field);
|
||||
}
|
||||
|
|
|
@ -176,6 +176,8 @@
|
|||
|
||||
</div>
|
||||
|
||||
{$check_full_msg}
|
||||
|
||||
|
||||
|
||||
<div class="row">
|
||||
|
|
|
@ -105,6 +105,9 @@
|
|||
{:token()}
|
||||
<div class="panel-body">
|
||||
<div class="box-body box-profile">
|
||||
|
||||
{$check_full_msg}
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Type')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
|
@ -114,6 +117,17 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<select id="c-type" style="display: none" name="shop[type]">
|
||||
{foreach name="typeList" item="vo"}
|
||||
<option value="{$key}" {in name="key" value="$shop_info.type"}selected{/in}>{$vo}</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Status')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
|
@ -253,6 +267,9 @@
|
|||
name="shop[latitude]" type="text" value="{$shop_info.latitude}">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="c_institution" >
|
||||
|
||||
<div class="form-group"
|
||||
{eq name="shop_info.type" value="1"}
|
||||
style="display:none"
|
||||
|
@ -263,7 +280,7 @@
|
|||
<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_info.yyzzdm}">
|
||||
|
@ -280,7 +297,7 @@
|
|||
<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_info.yyzz_images}">
|
||||
|
@ -302,6 +319,118 @@
|
|||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Establish_time')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-establish_time" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="shop[establish_time]" type="text" value="{:$shop_info.establish_time?datetime($shop_info.establish_time):''}">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('People')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-people" class="form-control" name="shop[people]" type="number" value="{$shop_info.people}">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Legal_entity')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-legal_entity" class="form-control" name="shop[legal_entity]" type="text" value="{$shop_info.legal_entity}">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div id="c_person" >
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2"><span class="c_institution">法人</span> {:__('Gender')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
{:build_radios('shop[gender]', ['1'=>__('Male'), '0'=>__('Female')], $shop_info['gender'])}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2"><span class="c_institution">法人</span>{:__('Nation')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-nation" class="form-control" data-rule="required" name="shop[nation]" type="text" value="{$shop_info.nation}">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2"><span class="c_institution">法人</span>{:__('Out_look')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-out_look" class="form-control" data-rule="required" name="shop[out_look]" type="text" value="{$shop_info.out_look}">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2"><span class="c_institution">法人</span>{:__('Birthtime')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-birthtime" data-rule="required" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="shop[birthtime]" type="text" value="{:$shop_info.birthtime?datetime($shop_info.birthtime):''}">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2"><span class="c_institution">法人</span>{:__('Native_place')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-native_place" class="form-control" data-rule="required" name="shop[native_place]" type="text" value="{$shop_info.native_place}">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2"><span class="c_institution">法人</span>{:__('Card_number')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-card_number" class="form-control" data-rule="required" name="shop[card_number]" type="text" value="{$shop_info.card_number}">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2"><span class="c_institution">法人</span>{:__('Diploma')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-diploma" class="form-control" name="shop[diploma]" type="text" value="{$shop_info.diploma}">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2"><span class="c_institution">法人</span>{:__('Post')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-post" class="form-control" name="shop[post]" type="text" value="{$shop_info.post}">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2"><span class="c_institution">法人</span>{:__('Social_position')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-social_position" class="form-control" name="shop[social_position]" type="text" value="{$shop_info.social_position}">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">
|
||||
{:__('Front_idcard_image')}:
|
||||
|
|
|
@ -22,15 +22,16 @@
|
|||
个人认证用户只能开设基于公益性质的免费课程<br>
|
||||
<b>机构认证身份可设置付费课程</b>
|
||||
</div>
|
||||
{$check_full_msg}
|
||||
|
||||
|
||||
|
||||
<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/classes/classes_lib/add')?'':'hide'}" title="{:__('Add')}" ><i class="fa fa-plus"></i> {:__('Add')}</a>-->
|
||||
<a href="javascript:;" class="btn btn-success btn-add {:$auth->check('school/classes/classes_lib/add')?'':'hide'}" title="{:__('Add')}" ><i class="fa fa-plus"></i> {:__('Add')}</a>
|
||||
|
||||
|
||||
<a href="javascript:;" data-url="school/classes/classes_lib/addnew" class="btn btn-success btn-changeuser {:$auth->check('school/classes/classes_lib/addnew')?'':'hide'}" title="{:__('Add')}" ><i class="fa fa-plus"></i> {:__('Add')}</a>
|
||||
<!-- <a href="javascript:;" data-url="school/classes/classes_lib/addnew" class="btn btn-success btn-changeuser {:$auth->check('school/classes/classes_lib/addnew')?'':'hide'}" title="{:__('Add')}" ><i class="fa fa-plus"></i> {:__('Add')}</a>-->
|
||||
|
||||
<a href="javascript:;" class="btn btn-success btn-edit btn-disabled disabled {:$auth->check('school/classes/classes_lib/edit')?'':'hide'}" title="{:__('Edit')}" ><i class="fa fa-pencil"></i> {:__('Edit')}</a>
|
||||
<a href="javascript:;" class="btn btn-danger btn-del btn-disabled disabled {:$auth->check('school/classes/classes_lib/del')?'':'hide'}" title="{:__('Delete')}" ><i class="fa fa-trash"></i> {:__('Delete')}</a>
|
||||
|
|
|
@ -17,23 +17,23 @@
|
|||
<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/classes/evaluate/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/classes/evaluate/edit')?'':'hide'}" title="{:__('Edit')}" ><i class="fa fa-pencil"></i> {:__('Edit')}</a>
|
||||
<a href="javascript:;" class="btn btn-danger btn-del btn-disabled disabled {:$auth->check('school/classes/evaluate/del')?'':'hide'}" title="{:__('Delete')}" ><i class="fa fa-trash"></i> {:__('Delete')}</a>
|
||||
<!-- <a href="javascript:;" class="btn btn-success btn-add {:$auth->check('school/classes/evaluate/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/classes/evaluate/edit')?'':'hide'}" title="{:__('Edit')}" ><i class="fa fa-pencil"></i> {:__('Edit')}</a>-->
|
||||
<!-- <a href="javascript:;" class="btn btn-danger btn-del btn-disabled disabled {:$auth->check('school/classes/evaluate/del')?'':'hide'}" title="{:__('Delete')}" ><i class="fa fa-trash"></i> {:__('Delete')}</a>-->
|
||||
|
||||
<div class="dropdown btn-group {:$auth->check('school/classes/evaluate/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 class="dropdown btn-group {:$auth->check('school/classes/evaluate/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/classes/evaluate/edit')}"
|
||||
data-operate-del="{:$auth->check('school/classes/evaluate/del')}"
|
||||
data-operate-edit="0"
|
||||
data-operate-del="0"
|
||||
width="100%">
|
||||
</table>
|
||||
</div>
|
||||
|
|
|
@ -0,0 +1,21 @@
|
|||
<form id="after_sales-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
|
||||
<input name="row[id]" type="hidden" value="{$row.id}">
|
||||
<fieldset>
|
||||
<legend><h4>帮用户售后需填写原因!</h4></legend>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('售后原因')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-reason" class="form-control" data-rule="required" name="row[reason]" type="text" value="">
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
|
||||
|
||||
<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="button" id="after_sales" data-type="after_sales" class="btn btn-success btn-embossed">确认提交结果</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
|
@ -21,8 +21,8 @@
|
|||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('同意退款金额')}(默认损耗后额度):</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-price" data-rule="required" class="form-control" step="0.01" name="row[price]" type="number" value="{$row.auto_recommend_price|htmlentities}">
|
||||
<span style="color: red">( 当前订单损耗比为 {$row.loss_proportion|htmlentities}% | 忽略损耗应退全额为 {$row.auto_price|htmlentities} | 退款金额不能超过订单应退全额 )</span>
|
||||
<input id="c-price" data-rule="required" class="form-control" step="0.01" name="row[price]" type="number" value="{$row.auto_recommend_price >0 ? $row.auto_recommend_price : $row.sub_refundprice }">
|
||||
<span style="color: red">( 当前订单损耗比为 {$row.loss_proportion|htmlentities}% | 忽略损耗应退全额为 {$row.auto_price|htmlentities} [若为0说明课时已用完或计算应退金额小于0.01,请自行决定是否退全款] | 退款金额不能超过订单应退全额 {$row.sub_refundprice|htmlentities} )</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -176,6 +176,13 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
|||
], events: Table.api.events.operate, formatter: Table.api.formatter.operate},
|
||||
|
||||
{field: 'id', title: 'ID'},
|
||||
{field: 'check_full', title: __('是否完善展示信息'), operate:false,formatter:function (value, row, index) {
|
||||
if(row.check_full){
|
||||
return '<span style="color: green">已完善</span>';
|
||||
}else{
|
||||
return '<span style="color: red">未完善</span>';
|
||||
}
|
||||
}},
|
||||
{field: 'shop.name', title: __('申请姓名|机构名'), operate: 'LIKE'},
|
||||
{field: 'shop.logo', title: __('Logo'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image},
|
||||
|
||||
|
@ -192,6 +199,9 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
|||
{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.shop_star', title: __('机构评分'),sortable:true},
|
||||
{field: 'shop.star_number', title: __('评价数'),sortable:true},
|
||||
|
||||
|
||||
// {field: 'user_id', title: __('申请姓名|机构名'), operate: 'LIKE'},
|
||||
{field: 'shop.image', title: __('Image'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image},
|
||||
|
@ -264,6 +274,10 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
|||
Fast.api.open(url,title,options);
|
||||
});
|
||||
|
||||
$(document).ready(function() {
|
||||
generrate.listen();
|
||||
generrate.setOfflineType($("#c-type").val());
|
||||
});
|
||||
|
||||
|
||||
Form.api.bindevent($("form[role=form]"));
|
||||
|
@ -306,6 +320,12 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
|||
});
|
||||
|
||||
|
||||
$(document).ready(function() {
|
||||
generrate.listen();
|
||||
generrate.setOfflineType($("#c-type").val());
|
||||
|
||||
});
|
||||
|
||||
Form.api.bindevent($("form[role=form]"));
|
||||
}
|
||||
};
|
||||
|
@ -341,5 +361,72 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
|||
return 'manystore/user_auth/index?shop_id='+row.id;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
var generrate = {
|
||||
listen:function () {
|
||||
this.offlineListen();
|
||||
this.priceListen();
|
||||
},
|
||||
offlineListen:function () {
|
||||
var that = this;
|
||||
// console.log($("input:radio[name='row[address_type]']").val())
|
||||
// this.setOfflineType($("input:radio[name='row[address_type]']").val());
|
||||
// $("input:radio[name='shop[type]']").change(function (){
|
||||
// that.setOfflineType($(this).val());
|
||||
// });
|
||||
$(document).on("change", "#c-type", function(){
|
||||
//变更后的回调事件
|
||||
that.setOfflineType($(this).val());
|
||||
});
|
||||
|
||||
|
||||
},
|
||||
setOfflineType:function (val) {
|
||||
switch (val) { //1=个人,2=机构
|
||||
case '1': //1=个人
|
||||
$('#c_person').show();
|
||||
$('#c_institution').hide();
|
||||
$('.c_institution').hide();
|
||||
|
||||
|
||||
|
||||
$(document).ready(function() {
|
||||
$('#c-yyzzdm').removeAttr('data-rule');
|
||||
$('#c-yyzz_images').removeAttr('data-rule');
|
||||
$('#c-legal_entity').removeAttr('data-rule');
|
||||
});
|
||||
|
||||
|
||||
break;
|
||||
case '2': //2=机构
|
||||
$('#c_person').hide();
|
||||
//data-rule="required"
|
||||
$('#c_institution').show();
|
||||
$('.c_institution').show();
|
||||
|
||||
// $('#c-yyzzdm').attr('data-rule', 'required');
|
||||
// $('#c-yyzz_images').attr('data-rule', 'required');
|
||||
|
||||
$(document).ready(function() {
|
||||
$('#c-yyzzdm').attr('data-rule', 'required');
|
||||
$('#c-yyzz_images').attr('data-rule', 'required');
|
||||
$('#c-legal_entity').attr('data-rule', 'required');
|
||||
});
|
||||
|
||||
break;
|
||||
}
|
||||
Form.api.bindevent($("form[role=form]"));
|
||||
},
|
||||
priceListen:function () {
|
||||
// $('#spec').bind('input propertychange', function(){
|
||||
// var length = $("#spec").val().length;
|
||||
// console.log(length);
|
||||
// });
|
||||
}
|
||||
}
|
||||
|
||||
return Controller;
|
||||
});
|
||||
|
|
|
@ -6,7 +6,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
|||
Table.api.init({
|
||||
extend: {
|
||||
index_url: 'school/classes/classes_lib/index' + location.search,
|
||||
add_url: 'school/classes/classes_lib/add'+ location.search,
|
||||
add_url: 'school/classes/classes_lib/addnew'+ location.search,
|
||||
addnew_url: 'school/classes/classes_lib/addnew'+ location.search,
|
||||
edit_url: 'school/classes/classes_lib/edit'+ location.search,
|
||||
del_url: 'school/classes/classes_lib/del',
|
||||
|
@ -103,6 +103,21 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
|||
// return row.status == '2'||row.status == '3';
|
||||
// }
|
||||
},
|
||||
{
|
||||
name: 'evaluate',
|
||||
text: __('查看用户评价'),
|
||||
title: __('查看用户评价'),
|
||||
classname: 'btn btn-xs btn-primary btn-dialog',
|
||||
icon: 'fa fa-list',
|
||||
url: evaluate_url,
|
||||
callback: function (data) {
|
||||
|
||||
},
|
||||
// visible: function (row) {
|
||||
// return row.classes_evaluate_id;
|
||||
// }
|
||||
},
|
||||
|
||||
//
|
||||
// {name: 'unsetmockauth',
|
||||
// text: '取消加圈资格',
|
||||
|
@ -166,6 +181,9 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
|||
{field: 'collect', title: __('实际收藏量'),sortable:true},
|
||||
{field: 'views', title: __('浏览量'),sortable:true},
|
||||
|
||||
{field: 'classes_star', title: __('课程评分'),sortable:true},
|
||||
{field: 'star_number', title: __('评价数'),sortable:true},
|
||||
|
||||
|
||||
{field: 'address_type', title: __('Address_type'), searchList: {"1":__('Address_type 1'),"2":__('Address_type 2')}, formatter: Table.api.formatter.normal},
|
||||
{field: 'sale', title: __('Sale'),sortable:true},
|
||||
|
@ -491,5 +509,10 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
|||
}
|
||||
|
||||
|
||||
var evaluate_url= function (row,dom) {
|
||||
return 'school/classes/evaluate/index?classes_lib_id='+row.id+ '&shop_id='+row.shop_id+ '&teacher_id='+row.teacher_id;
|
||||
}
|
||||
|
||||
|
||||
return Controller;
|
||||
});
|
||||
|
|
|
@ -6,8 +6,8 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
|||
Table.api.init({
|
||||
extend: {
|
||||
index_url: 'school/classes/evaluate/index' + location.search,
|
||||
add_url: 'school/classes/evaluate/add',
|
||||
edit_url: 'school/classes/evaluate/edit',
|
||||
add_url: 'school/classes/evaluate/add' + location.search,
|
||||
edit_url: 'school/classes/evaluate/edit' + location.search,
|
||||
del_url: 'school/classes/evaluate/del',
|
||||
multi_url: 'school/classes/evaluate/multi',
|
||||
import_url: 'school/classes/evaluate/import',
|
||||
|
@ -28,35 +28,50 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
|||
[
|
||||
{checkbox: true},
|
||||
{field: 'id', title: __('Id')},
|
||||
{field: 'user_id', title: __('User_id')},
|
||||
{field: 'classes_lib_id', title: __('Classes_lib_id')},
|
||||
{field: 'classes_order_id', title: __('Classes_order_id')},
|
||||
{field: 'manystore_id', title: __('Manystore_id')},
|
||||
{field: 'shop_id', title: __('Shop_id')},
|
||||
{field: 'teacher_id', title: __('Teacher_id')},
|
||||
|
||||
{field: 'image', title: __('Image'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image},
|
||||
{field: 'nickname', title: __('Nickname'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
|
||||
{field: 'classes_star', title: __('Classes_star'), operate:'BETWEEN'},
|
||||
{field: 'teacher_star', title: __('Teacher_star'), operate:'BETWEEN'},
|
||||
{field: 'shop_star', title: __('Shop_star'), operate:'BETWEEN'},
|
||||
{field: 'message_text', title: __('Message_text'), operate:'BETWEEN'},
|
||||
|
||||
|
||||
|
||||
{field: 'evaluate_time', title: __('Evaluate_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
|
||||
{field: 'status', title: __('Status'), searchList: {"1":__('Status 1'),"2":__('Status 2')}, formatter: Table.api.formatter.status},
|
||||
{field: 'top', title: __('Top'), searchList: {"0":__('Top 0'),"1":__('Top 1')}, formatter: Table.api.formatter.normal},
|
||||
{field: 'weigh', title: __('Weigh'), operate: false},
|
||||
{field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
|
||||
{field: 'updatetime', title: __('Updatetime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
|
||||
|
||||
{field: 'user_id', title: __('User_id')},
|
||||
{field: 'user.nickname', title: __('User.nickname'), operate: 'LIKE'},
|
||||
{field: 'user.realname', title: __('User.realname'), 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: 'user.realname', title: __('User.realname'),visible:false, operate: 'LIKE'},
|
||||
{field: 'user.mobile', title: __('User.mobile'),visible:false, operate: 'LIKE'},
|
||||
{field: 'user.avatar', title: __('User.avatar'),visible:false, operate: 'LIKE', events: Table.api.events.image, formatter: Table.api.formatter.image},
|
||||
|
||||
|
||||
{field: 'shop.name', title: __('Shop.name'), operate: 'LIKE'},
|
||||
|
||||
{field: 'lib.title', title: __('Lib.title'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
|
||||
{field: 'lib.headimage', title: __('Lib.headimage'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image},
|
||||
{field: 'classesorder.order_no', title: __('Order.order_no'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
|
||||
{field: 'manystore.nickname', title: __('Manystore.nickname'), operate: 'LIKE'},
|
||||
{field: 'shop.name', title: __('Shop.name'), operate: 'LIKE'},
|
||||
{field: 'shop.logo', title: __('Shop.logo'), operate: 'LIKE'},
|
||||
|
||||
|
||||
{field: 'teacher.name', title: __('Teacher.name'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
|
||||
{field: 'teacher.head_image', title: __('Teacher.head_image'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image},
|
||||
|
||||
|
||||
|
||||
{field: 'classes_lib_id', title: __('Classes_lib_id'),visible:false},
|
||||
{field: 'classes_order_id', title: __('Classes_order_id'),visible:false},
|
||||
{field: 'manystore_id', title: __('Manystore_id'),visible:false},
|
||||
{field: 'shop_id', title: __('Shop_id'),visible:false},
|
||||
{field: 'teacher_id', title: __('Teacher_id'),visible:false},
|
||||
|
||||
{field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
|
||||
{field: 'updatetime', title: __('Updatetime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
|
||||
{field: 'classesorder.order_no', title: __('Order.order_no'),visible:false, operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
|
||||
{field: 'manystore.nickname', title: __('Manystore.nickname'),visible:false, operate: 'LIKE'},
|
||||
{field: 'shop.logo', title: __('Shop.logo'),visible:false, operate: 'LIKE'},
|
||||
{field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
|
||||
]
|
||||
]
|
||||
|
@ -78,19 +93,19 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
|||
|
||||
$("#c-classes_order_id").data("params", function (obj) {
|
||||
//obj为SelectPage对象
|
||||
return {custom: {shop_id: $("#c-shop_id").val(),classes_lib_id: $("#c-classes_lib_id").val()}};
|
||||
return {custom: {shop_id: $("#c-shop_id").val(),classes_lib_id: $("#c-classes_lib_id").val(),user_id: $("#c-user_id").val()}};
|
||||
});
|
||||
|
||||
|
||||
//老师必须是上面机构中的
|
||||
$("#c-teacher_id").data("params", function (obj) {
|
||||
//obj为SelectPage对象
|
||||
return {custom: {shop_id: $("#c-shop_id").val(),classes_lib_id: $("#c-classes_lib_id").val()}};
|
||||
return {custom: {shop_id: $("#c-shop_id").val()}};
|
||||
});
|
||||
|
||||
$("#c-classes_lib_id").data("params", function (obj) {
|
||||
//obj为SelectPage对象
|
||||
return {custom: {shop_id: $("#c-shop_id").val()}};
|
||||
return {custom: {shop_id: $("#c-shop_id").val(),teacher_id: $("#c-teacher_id").val()}};
|
||||
});
|
||||
|
||||
//机构清除老师也要清除
|
||||
|
@ -99,9 +114,12 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
|||
$("#c-classes_lib_id").selectPageClear();
|
||||
$("#c-classes_order_id").selectPageClear();
|
||||
});
|
||||
$("#c-teacher_id").change(function () {
|
||||
$("#c-classes_lib_id").selectPageClear();
|
||||
$("#c-classes_order_id").selectPageClear();
|
||||
});
|
||||
|
||||
$("#c-classes_lib_id").change(function () {
|
||||
$("#c-teacher_id").selectPageClear();
|
||||
$("#c-classes_order_id").selectPageClear();
|
||||
});
|
||||
|
||||
|
@ -111,6 +129,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
|||
|
||||
|
||||
|
||||
|
||||
$(document).on('click', '.btn-changeuser', function (event) {
|
||||
var url = $(this).attr('data-url');
|
||||
if(!url) return false;
|
||||
|
|
|
@ -82,7 +82,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
|||
},
|
||||
visible: function (row) {
|
||||
//只有付费订单有售后
|
||||
return row.status == '3' && row.detail.feel == '0';
|
||||
return (row.status == '3' || row.status == '9') && row.detail.feel == '0';
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -130,6 +130,22 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
|||
// return row.status == '2'||row.status == '3';
|
||||
// }
|
||||
},
|
||||
{
|
||||
name: 'evaluate',
|
||||
text: __('查看用户评价'),
|
||||
title: __('查看用户评价'),
|
||||
classname: 'btn btn-xs btn-primary btn-dialog',
|
||||
icon: 'fa fa-list',
|
||||
url: evaluate_url,
|
||||
callback: function (data) {
|
||||
|
||||
},
|
||||
visible: function (row) {
|
||||
return row.classes_evaluate_id;
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
//
|
||||
// {name: 'unsetmockauth',
|
||||
// text: '取消加圈资格',
|
||||
|
@ -327,6 +343,9 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
|||
return 'school/classes/order/service_order/index?id='+row.classes_service_order_id;
|
||||
}
|
||||
|
||||
var evaluate_url= function (row,dom) {
|
||||
return 'school/classes/evaluate/index?classes_order_id='+row.id + '&classes_lib_id='+row.classes_lib_id+ '&shop_id='+row.shop_id+ '&teacher_id='+row.detail.teacher_id+ '&user_id='+row.user_id+ '&nickname='+row.user.nickname + '&image='+row.user.avatar;
|
||||
}
|
||||
|
||||
return Controller;
|
||||
});
|
||||
|
|
|
@ -127,6 +127,21 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
|||
// return row.paytime;
|
||||
// }
|
||||
},
|
||||
{
|
||||
name: 'order',
|
||||
text: __('课程订单查看'),
|
||||
title: __('课程订单查看'),
|
||||
classname: 'btn btn-xs btn-primary btn-dialog',
|
||||
icon: 'fa fa-list',
|
||||
url: order_url,
|
||||
callback: function (data) {
|
||||
|
||||
},
|
||||
// visible: function (row) {
|
||||
// return row.status == '2'||row.status == '3';
|
||||
// }
|
||||
},
|
||||
|
||||
//
|
||||
// {name: 'unsetmockauth',
|
||||
// text: '取消加圈资格',
|
||||
|
@ -342,5 +357,9 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
|||
}
|
||||
|
||||
|
||||
var order_url = function (row,dom) {
|
||||
return 'school/classes/order/order/index?id='+row.classes_order_id;
|
||||
}
|
||||
|
||||
return Controller;
|
||||
});
|
||||
|
|
|
@ -27,6 +27,40 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
|||
columns: [
|
||||
[
|
||||
{checkbox: true},
|
||||
{field: 'operate', title: __('Operate'), table: table , buttons: [
|
||||
{
|
||||
name: 'classes',
|
||||
text: __('讲师的课程'),
|
||||
title: __('讲师的课程'),
|
||||
classname: 'btn btn-xs btn-danger btn-magic btn-dialog',
|
||||
icon: 'fa fa-list',
|
||||
url: classes_url,
|
||||
callback: function (data) {
|
||||
|
||||
},
|
||||
// visible: function (row) {
|
||||
// return row.status == '2'||row.status == '3';
|
||||
// }
|
||||
},
|
||||
{
|
||||
name: 'evaluate',
|
||||
text: __('查看用户评价'),
|
||||
title: __('查看用户评价'),
|
||||
classname: 'btn btn-xs btn-primary btn-dialog',
|
||||
icon: 'fa fa-list',
|
||||
url: evaluate_url,
|
||||
callback: function (data) {
|
||||
|
||||
},
|
||||
// visible: function (row) {
|
||||
// return row.classes_evaluate_id;
|
||||
// }
|
||||
},
|
||||
|
||||
], events: Table.api.events.operate, formatter: Table.api.formatter.operate},
|
||||
|
||||
|
||||
|
||||
{field: 'id', title: __('Id')},
|
||||
{field: 'manystore_id', title: __('Manystore_id')},
|
||||
{field: 'shop_id', title: __('Shop_id')},
|
||||
|
@ -38,6 +72,11 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
|||
|
||||
{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: 'teacher_star', title: __('老师评分'),sortable:true},
|
||||
{field: 'star_number', title: __('评价数'),sortable:true},
|
||||
|
||||
|
||||
{field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
|
||||
{field: 'updatetime', title: __('Updatetime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
|
||||
{field: 'user.nickname', title: __('User.nickname'), operate: 'LIKE'},
|
||||
|
@ -54,7 +93,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
|||
{field: 'shop.district', title: __('Shop.district')},
|
||||
{field: 'shop.address', title: __('Shop.address'), operate: 'LIKE'},
|
||||
{field: 'shop.address_detail', title: __('Shop.address_detail'), operate: 'LIKE'},
|
||||
{field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
|
||||
// {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
|
||||
]
|
||||
]
|
||||
});
|
||||
|
@ -155,5 +194,15 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
|||
}
|
||||
}
|
||||
};
|
||||
|
||||
var evaluate_url= function (row,dom) {
|
||||
return 'school/classes/evaluate/index?shop_id='+row.shop_id+ '&teacher_id='+row.id;
|
||||
}
|
||||
|
||||
var classes_url= function (row,dom) {
|
||||
return 'school/classes/classes_lib/index?shop_id='+row.shop_id+ '&teacher_id='+row.id;
|
||||
}
|
||||
|
||||
|
||||
return Controller;
|
||||
});
|
||||
|
|
|
@ -35,8 +35,81 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'upload'], function (
|
|||
}
|
||||
});
|
||||
|
||||
$(document).ready(function() {
|
||||
generrate.listen();
|
||||
generrate.setOfflineType($("#c-type").val());
|
||||
|
||||
});
|
||||
|
||||
|
||||
Form.api.bindevent($("#shop-form"));
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
var generrate = {
|
||||
listen:function () {
|
||||
this.offlineListen();
|
||||
this.priceListen();
|
||||
},
|
||||
offlineListen:function () {
|
||||
var that = this;
|
||||
// console.log($("input:radio[name='row[address_type]']").val())
|
||||
// this.setOfflineType($("input:radio[name='row[address_type]']").val());
|
||||
// $("input:radio[name='shop[type]']").change(function (){
|
||||
// that.setOfflineType($(this).val());
|
||||
// });
|
||||
$(document).on("change", "#c-type", function(){
|
||||
//变更后的回调事件
|
||||
that.setOfflineType($(this).val());
|
||||
});
|
||||
|
||||
|
||||
},
|
||||
setOfflineType:function (val) {
|
||||
switch (val) { //1=个人,2=机构
|
||||
case '1': //1=个人
|
||||
$('#c_person').show();
|
||||
$('#c_institution').hide();
|
||||
$('.c_institution').hide();
|
||||
|
||||
|
||||
|
||||
$(document).ready(function() {
|
||||
$('#c-yyzzdm').removeAttr('data-rule');
|
||||
$('#c-yyzz_images').removeAttr('data-rule');
|
||||
$('#c-legal_entity').removeAttr('data-rule');
|
||||
});
|
||||
|
||||
|
||||
break;
|
||||
case '2': //2=机构
|
||||
$('#c_person').hide();
|
||||
//data-rule="required"
|
||||
$('#c_institution').show();
|
||||
$('.c_institution').show();
|
||||
|
||||
// $('#c-yyzzdm').attr('data-rule', 'required');
|
||||
// $('#c-yyzz_images').attr('data-rule', 'required');
|
||||
|
||||
$(document).ready(function() {
|
||||
$('#c-yyzzdm').attr('data-rule', 'required');
|
||||
$('#c-yyzz_images').attr('data-rule', 'required');
|
||||
$('#c-legal_entity').attr('data-rule', 'required');
|
||||
});
|
||||
|
||||
break;
|
||||
}
|
||||
Form.api.bindevent($("form[role=form]"));
|
||||
},
|
||||
priceListen:function () {
|
||||
// $('#spec').bind('input propertychange', function(){
|
||||
// var length = $("#spec").val().length;
|
||||
// console.log(length);
|
||||
// });
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return Controller;
|
||||
});
|
||||
|
|
|
@ -6,7 +6,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
|||
Table.api.init({
|
||||
extend: {
|
||||
index_url: 'school/classes/classes_lib/index' + location.search,
|
||||
add_url: 'school/classes/classes_lib/add'+ location.search,
|
||||
add_url: 'school/classes/classes_lib/addnew'+ location.search,
|
||||
addnew_url: 'school/classes/classes_lib/addnew'+ location.search,
|
||||
edit_url: 'school/classes/classes_lib/edit'+ location.search,
|
||||
del_url: 'school/classes/classes_lib/del',
|
||||
|
@ -99,6 +99,22 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
|||
// return row.status == '2'||row.status == '3';
|
||||
// }
|
||||
},
|
||||
{
|
||||
name: 'evaluate',
|
||||
text: __('查看用户评价'),
|
||||
title: __('查看用户评价'),
|
||||
classname: 'btn btn-xs btn-primary btn-dialog',
|
||||
icon: 'fa fa-list',
|
||||
url: evaluate_url,
|
||||
callback: function (data) {
|
||||
|
||||
},
|
||||
// visible: function (row) {
|
||||
// return row.classes_evaluate_id;
|
||||
// }
|
||||
},
|
||||
|
||||
|
||||
// {name: 'unsetmockauth',
|
||||
// text: '取消加圈资格',
|
||||
// icon: 'fa fa-sign-in',
|
||||
|
@ -165,6 +181,11 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
|||
{field: 'views', title: __('浏览量'),sortable:true},
|
||||
|
||||
|
||||
{field: 'classes_star', title: __('课程评分'),sortable:true},
|
||||
{field: 'star_number', title: __('评价数'),sortable:true},
|
||||
|
||||
|
||||
|
||||
{field: 'address_type', title: __('Address_type'), searchList: {"1":__('Address_type 1'),"2":__('Address_type 2')}, formatter: Table.api.formatter.normal},
|
||||
{field: 'sale', title: __('Sale'),sortable:true},
|
||||
{field: 'price', title: __('Price'),sortable:true, operate:'BETWEEN'},
|
||||
|
@ -487,5 +508,10 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
|||
return 'school/classes/hourorder/order/index?classes_lib_id='+row.id;
|
||||
}
|
||||
|
||||
var evaluate_url= function (row,dom) {
|
||||
return 'school/classes/evaluate/index?classes_lib_id='+row.id+ '&shop_id='+row.shop_id+ '&teacher_id='+row.teacher_id;
|
||||
}
|
||||
|
||||
|
||||
return Controller;
|
||||
});
|
||||
|
|
|
@ -25,36 +25,57 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
|||
columns: [
|
||||
[
|
||||
{checkbox: true},
|
||||
|
||||
|
||||
{field: 'id', title: __('Id')},
|
||||
{field: 'user_id', title: __('User_id')},
|
||||
{field: 'classes_lib_id', title: __('Classes_lib_id')},
|
||||
{field: 'classes_order_id', title: __('Classes_order_id')},
|
||||
{field: 'manystore_id', title: __('Manystore_id')},
|
||||
{field: 'shop_id', title: __('Shop_id')},
|
||||
{field: 'teacher_id', title: __('Teacher_id')},
|
||||
|
||||
{field: 'image', title: __('Image'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image},
|
||||
{field: 'nickname', title: __('Nickname'), operate: 'LIKE'},
|
||||
{field: 'nickname', title: __('Nickname'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
|
||||
{field: 'classes_star', title: __('Classes_star'), operate:'BETWEEN'},
|
||||
{field: 'teacher_star', title: __('Teacher_star'), operate:'BETWEEN'},
|
||||
{field: 'shop_star', title: __('Shop_star'), operate:'BETWEEN'},
|
||||
{field: 'evaluate_time', title: __('Evaluate_time')},
|
||||
{field: 'message_text', title: __('Message_text'), operate:'BETWEEN'},
|
||||
|
||||
|
||||
|
||||
{field: 'evaluate_time', title: __('Evaluate_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
|
||||
{field: 'status', title: __('Status'), searchList: {"1":__('Status 1'),"2":__('Status 2')}, formatter: Table.api.formatter.status},
|
||||
{field: 'top', title: __('Top'), searchList: {"0":__('Top 0'),"1":__('Top 1')}, formatter: Table.api.formatter.normal},
|
||||
{field: 'weigh', title: __('Weigh'), operate: false},
|
||||
{field: 'createtime', title: __('Createtime')},
|
||||
{field: 'updatetime', title: __('Updatetime')},
|
||||
|
||||
|
||||
|
||||
{field: 'user_id', title: __('User_id')},
|
||||
{field: 'user.nickname', title: __('User.nickname'), operate: 'LIKE'},
|
||||
{field: 'user.realname', title: __('User.realname'), 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: 'user.realname', title: __('User.realname'),visible:false, operate: 'LIKE'},
|
||||
{field: 'user.mobile', title: __('User.mobile'),visible:false, operate: 'LIKE'},
|
||||
{field: 'user.avatar', title: __('User.avatar'),visible:false, operate: 'LIKE', events: Table.api.events.image, formatter: Table.api.formatter.image},
|
||||
|
||||
{field: 'schoolclasseslib.title', title: __('Schoolclasseslib.title'), operate: 'LIKE'},
|
||||
{field: 'schoolclasseslib.headimage', title: __('Schoolclasseslib.headimage'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image},
|
||||
{field: 'schoolclassesorder.order_no', title: __('Schoolclassesorder.order_no'), operate: 'LIKE'},
|
||||
{field: 'manystore.nickname', title: __('Manystore.nickname'), operate: 'LIKE'},
|
||||
{field: 'manystoreshop.name', title: __('Manystoreshop.name'), operate: 'LIKE'},
|
||||
{field: 'manystoreshop.logo', title: __('Manystoreshop.logo'), operate: 'LIKE'},
|
||||
|
||||
{field: 'schoolteacher.name', title: __('Schoolteacher.name'), operate: 'LIKE'},
|
||||
{field: 'schoolteacher.head_image', title: __('Schoolteacher.head_image'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image},
|
||||
|
||||
|
||||
{field: 'manystoreshop.name', title: __('Manystoreshop.name'), operate: 'LIKE'},
|
||||
|
||||
{field: 'classes_lib_id', title: __('Classes_lib_id'),visible:false},
|
||||
{field: 'classes_order_id', title: __('Classes_order_id'),visible:false},
|
||||
{field: 'manystore_id', title: __('Manystore_id'),visible:false},
|
||||
{field: 'shop_id', title: __('Shop_id'),visible:false},
|
||||
{field: 'teacher_id', title: __('Teacher_id'),visible:false},
|
||||
|
||||
|
||||
|
||||
|
||||
{field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
|
||||
{field: 'updatetime', title: __('Updatetime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
|
||||
|
||||
{field: 'schoolclassesorder.order_no',visible:false, title: __('Schoolclassesorder.order_no'), operate: 'LIKE'},
|
||||
{field: 'manystore.nickname',visible:false, title: __('Manystore.nickname'), operate: 'LIKE'},
|
||||
|
||||
{field: 'manystoreshop.logo',visible:false, title: __('Manystoreshop.logo'), operate: 'LIKE'},
|
||||
{field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
|
||||
]
|
||||
]
|
||||
|
@ -74,25 +95,21 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
$("#c-classes_order_id").data("params", function (obj) {
|
||||
//obj为SelectPage对象
|
||||
return {custom: {shop_id: $("#c-shop_id").val(),classes_lib_id: $("#c-classes_lib_id").val()}};
|
||||
return {custom: {shop_id: $("#c-shop_id").val(),classes_lib_id: $("#c-classes_lib_id").val(),user_id: $("#c-user_id").val()}};
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
//老师必须是上面机构中的
|
||||
$("#c-teacher_id").data("params", function (obj) {
|
||||
//obj为SelectPage对象
|
||||
return {custom: {shop_id: $("#c-shop_id").val(),classes_lib_id: $("#c-classes_lib_id").val()}};
|
||||
return {custom: {shop_id: $("#c-shop_id").val()}};
|
||||
});
|
||||
|
||||
$("#c-classes_lib_id").data("params", function (obj) {
|
||||
//obj为SelectPage对象
|
||||
return {custom: {shop_id: $("#c-shop_id").val()}};
|
||||
return {custom: {shop_id: $("#c-shop_id").val(),teacher_id: $("#c-teacher_id").val()}};
|
||||
});
|
||||
|
||||
//机构清除老师也要清除
|
||||
|
@ -101,9 +118,12 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
|||
$("#c-classes_lib_id").selectPageClear();
|
||||
$("#c-classes_order_id").selectPageClear();
|
||||
});
|
||||
$("#c-teacher_id").change(function () {
|
||||
$("#c-classes_lib_id").selectPageClear();
|
||||
$("#c-classes_order_id").selectPageClear();
|
||||
});
|
||||
|
||||
$("#c-classes_lib_id").change(function () {
|
||||
$("#c-teacher_id").selectPageClear();
|
||||
$("#c-classes_order_id").selectPageClear();
|
||||
});
|
||||
|
||||
|
@ -114,7 +134,6 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
|||
|
||||
|
||||
|
||||
|
||||
$(document).on('click', '.btn-changeuser', function (event) {
|
||||
var url = $(this).attr('data-url');
|
||||
if(!url) return false;
|
||||
|
|
|
@ -10,6 +10,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
|||
edit_url: 'school/classes/order/order/edit',
|
||||
del_url: 'school/classes/order/order/del',
|
||||
cancel_url: 'school/classes/order/order/cancel',
|
||||
after_sales_url: 'school/classes/order/order/after_sales',
|
||||
multi_url: 'school/classes/order/order/multi',
|
||||
import_url: 'school/classes/order/order/import',
|
||||
table: 'school_classes_order',
|
||||
|
@ -112,6 +113,38 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
|||
// return row.status == '2'||row.status == '3';
|
||||
// }
|
||||
},
|
||||
|
||||
{
|
||||
name: 'evaluate',
|
||||
text: __('查看用户评价'),
|
||||
title: __('查看用户评价'),
|
||||
classname: 'btn btn-xs btn-primary btn-dialog',
|
||||
icon: 'fa fa-list',
|
||||
url: evaluate_url,
|
||||
callback: function (data) {
|
||||
|
||||
},
|
||||
visible: function (row) {
|
||||
return row.classes_evaluate_id;
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
name: 'after_sales',
|
||||
text: __('机构主动发起售后'),
|
||||
title: __('机构主动发起售后'),
|
||||
classname: 'btn btn-xs btn-danger btn-dialog',
|
||||
icon: 'fa fa-sign-in',
|
||||
url: $.fn.bootstrapTable.defaults.extend.after_sales_url,
|
||||
callback: function (data) {
|
||||
|
||||
},
|
||||
visible: function (row) {
|
||||
//只有付费订单有售后
|
||||
return (row.status == '3' || row.status == '9') && row.schoolclassesorderdetail.feel == '0';
|
||||
}
|
||||
},
|
||||
|
||||
//
|
||||
// {name: 'unsetmockauth',
|
||||
// text: '取消加圈资格',
|
||||
|
@ -276,6 +309,12 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
|||
edit: function () {
|
||||
Controller.api.bindevent();
|
||||
},
|
||||
after_sales: function(){
|
||||
$("#after_sales").on('click', function() {
|
||||
$("#after_sales-form").attr("action",'school/classes/order/order/after_sales').submit();
|
||||
});
|
||||
Controller.api.bindevent();
|
||||
},
|
||||
api: {
|
||||
bindevent: function () {
|
||||
Form.api.bindevent($("form[role=form]"));
|
||||
|
@ -300,5 +339,9 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
|||
return 'school/classes/order/service_order/index?classes_order_id='+row.id;
|
||||
}
|
||||
|
||||
|
||||
var evaluate_url= function (row,dom) {
|
||||
return 'school/classes/evaluate/index?classes_order_id='+row.id + '&classes_lib_id='+row.classes_lib_id+ '&shop_id='+row.shop_id+ '&teacher_id='+row.schoolclassesorderdetail.teacher_id+ '&user_id='+row.user_id+ '&nickname='+row.user.nickname + '&image='+row.user.avatar;
|
||||
}
|
||||
return Controller;
|
||||
});
|
|
@ -79,6 +79,20 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
|||
// return row.paytime;
|
||||
// }
|
||||
},
|
||||
{
|
||||
name: 'order',
|
||||
text: __('课程订单查看'),
|
||||
title: __('课程订单查看'),
|
||||
classname: 'btn btn-xs btn-primary btn-dialog',
|
||||
icon: 'fa fa-list',
|
||||
url: order_url,
|
||||
callback: function (data) {
|
||||
|
||||
},
|
||||
// visible: function (row) {
|
||||
// return row.status == '2'||row.status == '3';
|
||||
// }
|
||||
},
|
||||
//
|
||||
// {name: 'unsetmockauth',
|
||||
// text: '取消加圈资格',
|
||||
|
@ -292,6 +306,9 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
|||
}
|
||||
}
|
||||
|
||||
var order_url = function (row,dom) {
|
||||
return 'school/classes/order/order/index?id='+row.classes_order_id;
|
||||
}
|
||||
|
||||
return Controller;
|
||||
});
|
|
@ -25,6 +25,41 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
|||
columns: [
|
||||
[
|
||||
{checkbox: true},
|
||||
|
||||
{field: 'operate', title: __('Operate'), table: table , buttons: [
|
||||
{
|
||||
name: 'classes',
|
||||
text: __('讲师的课程'),
|
||||
title: __('讲师的课程'),
|
||||
classname: 'btn btn-xs btn-danger btn-magic btn-dialog',
|
||||
icon: 'fa fa-list',
|
||||
url: classes_url,
|
||||
callback: function (data) {
|
||||
|
||||
},
|
||||
// visible: function (row) {
|
||||
// return row.status == '2'||row.status == '3';
|
||||
// }
|
||||
},
|
||||
{
|
||||
name: 'evaluate',
|
||||
text: __('查看用户评价'),
|
||||
title: __('查看用户评价'),
|
||||
classname: 'btn btn-xs btn-primary btn-dialog',
|
||||
icon: 'fa fa-list',
|
||||
url: evaluate_url,
|
||||
callback: function (data) {
|
||||
|
||||
},
|
||||
// visible: function (row) {
|
||||
// return row.classes_evaluate_id;
|
||||
// }
|
||||
},
|
||||
|
||||
], events: Table.api.events.operate, formatter: Table.api.formatter.operate},
|
||||
|
||||
|
||||
|
||||
{field: 'id', title: __('Id')},
|
||||
{field: 'manystore_id', title: __('Manystore_id'),visible:false},
|
||||
{field: 'shop_id', title: __('Shop_id'),visible:false},
|
||||
|
@ -38,6 +73,12 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
|||
{field: 'status', title: __('Status'), searchList: {"1":__('Status 1'),"2":__('Status 2')}, formatter: Table.api.formatter.status},
|
||||
{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: 'teacher_star', title: __('老师评分'),sortable:true},
|
||||
{field: 'star_number', title: __('评价数'),sortable:true},
|
||||
|
||||
|
||||
{field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
|
||||
{field: 'updatetime', title: __('Updatetime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
|
||||
// {field: 'manystore.nickname', title: __('Manystore.nickname'), operate: 'LIKE',visible:false},
|
||||
|
@ -49,7 +90,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
|||
// {field: 'manystoreshop.district', title: __('Manystoreshop.district')},
|
||||
// {field: 'manystoreshop.address', title: __('Manystoreshop.address'), operate: 'LIKE'},
|
||||
// {field: 'manystoreshop.address_detail', title: __('Manystoreshop.address_detail'), operate: 'LIKE'},
|
||||
{field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
|
||||
// {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
|
||||
]
|
||||
]
|
||||
});
|
||||
|
@ -149,5 +190,16 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
|||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
var evaluate_url= function (row,dom) {
|
||||
return 'school/classes/evaluate/index?shop_id='+row.shop_id+ '&teacher_id='+row.id;
|
||||
}
|
||||
|
||||
var classes_url= function (row,dom) {
|
||||
return 'school/classes/classes_lib/index?shop_id='+row.shop_id+ '&teacher_id='+row.id;
|
||||
}
|
||||
|
||||
|
||||
return Controller;
|
||||
});
|
Loading…
Reference in New Issue