多样青春夜校

售后单列表接口 员工端和用户端
售后单详情接口 员工端和用户端
售后单取消 用户端
售后单申请 用户端
核销员默认可核销全部课程
This commit is contained in:
15090180611 2024-12-04 18:17:08 +08:00
parent d744adc762
commit 637bd5cbdf
94 changed files with 5856 additions and 239 deletions

View File

@ -157,7 +157,7 @@ class Index extends Backend
protected function authClasses(&$params,&$shop,$row=null){ protected function authClasses(&$params,&$shop,$row=null){
//审核失败需填写原因 //审核失败需填写原因
if($shop["status"] == '2' && empty($shop["reason"])){ if($shop["status"] == '2' && empty($shop["reason"])){
$this->error("审核失败需填写原因"); throw new \Exception("审核失败需填写原因");
} }
if($shop["status"] == '2'){ if($shop["status"] == '2'){
@ -169,7 +169,7 @@ class Index extends Backend
if($row){ if($row){
if($shop["status"] != '1' && $row["status"] == '1'){ if($shop["status"] != '1' && $row["status"] == '1'){
$this->error("审核已通过的课程不允许再修改审核状态!"); throw new \Exception("审核已通过的课程不允许再修改审核状态!");
} }
if($shop["status"] != '0' && $row["status"] == '0'){ if($shop["status"] != '0' && $row["status"] == '0'){
@ -228,7 +228,7 @@ class Index extends Backend
// 课程存在未完成订单则不允许操作 // 课程存在未完成订单则不允许操作
$order = Order::where("manystore_id",$id)->where("status","in","0,3")->find(); $order = Order::where("manystore_id",$id)->where("status","in","0,3")->find();
if($order)$this->error("存在正在使用中的课程订单或存在正在售后中的课程订单无法继续操作!"); if($order)throw new \Exception("存在正在使用中的课程订单或存在正在售后中的课程订单无法继续操作!");
// 课程存在售后订单则不允许操作 // 课程存在售后订单则不允许操作
} }
@ -244,6 +244,7 @@ class Index extends Backend
if(!$shop["user_id"])throw new \Exception("认证用户不存在!"); if(!$shop["user_id"])throw new \Exception("认证用户不存在!");
$user = User::get($shop["user_id"]); $user = User::get($shop["user_id"]);
if(!$user) throw new \Exception("认证用户不存在!"); if(!$user) throw new \Exception("认证用户不存在!");
if($shop["address_city"] && !$shop["province"])throw new Exception("请选择所在城市");
@ -282,12 +283,12 @@ class Index extends Backend
//名称title不能与其他课程重复 //名称title不能与其他课程重复
$check_title = $this->shopModel->where('id','<>',$row["id"])->where('name',$shop["name"])->find(); $check_title = $this->shopModel->where('id','<>',$row["id"])->where('name',$shop["name"])->find();
if($check_title){ if($check_title){
$this->error("机构或个人认证名称已存在或被其他机构占用,请更改!"); throw new \Exception("机构或个人认证名称已存在或被其他机构占用,请更改!");
} }
//user_id不能与其他机构重复 //user_id不能与其他机构重复
$check_user_id = $this->shopModel->where('id','<>',$row["id"])->where('user_id',$shop["user_id"])->find(); $check_user_id = $this->shopModel->where('id','<>',$row["id"])->where('user_id',$shop["user_id"])->find();
if($check_user_id){ if($check_user_id){
$this->error("机构或个人认证用户已存在或被其他机构占用,请更改!"); throw new \Exception("机构或个人认证用户已存在或被其他机构占用,请更改!");
} }
}else{ }else{
@ -297,12 +298,12 @@ class Index extends Backend
//名称title不能重复 //名称title不能重复
$check_title = $this->shopModel->where('name',$shop["name"])->find(); $check_title = $this->shopModel->where('name',$shop["name"])->find();
if($check_title){ if($check_title){
$this->error("机构或个人认证名称已存在或被其他机构占用,请更改!"); throw new \Exception("机构或个人认证名称已存在或被其他机构占用,请更改!");
} }
//user_id不能与其他机构重复 //user_id不能与其他机构重复
$check_user_id = $this->shopModel->where('user_id',$shop["user_id"])->find(); $check_user_id = $this->shopModel->where('user_id',$shop["user_id"])->find();
if($check_user_id){ if($check_user_id){
$this->error("机构或个人认证用户已存在或被其他机构占用,请更改!"); throw new \Exception("机构或个人认证用户已存在或被其他机构占用,请更改!");
} }
} }
@ -332,7 +333,7 @@ class Index extends Backend
$this->update_check($params,$shop,$row=null); $this->update_check($params,$shop,$row=null);
$shop_info = $this->shopModel->save($shop); $shop_info = $this->shopModel->save($shop);
if($shop_info === false){ if($shop_info === false){
$this->error($this->shopModel->getError()); throw new \Exception($this->shopModel->getError());
} }
$params['shop_id'] = $this->shopModel->id; $params['shop_id'] = $this->shopModel->id;
@ -345,10 +346,12 @@ class Index extends Backend
$validate = is_bool($this->modelValidate) ? ($this->modelSceneValidate ? $name . '.add' : $name) : $this->modelValidate; $validate = is_bool($this->modelValidate) ? ($this->modelSceneValidate ? $name . '.add' : $name) : $this->modelValidate;
$result = $this->model->validate($validate)->save($params); $result = $this->model->validate($validate)->save($params);
if ($result === false) { if ($result === false) {
$this->error($this->model->getError()); throw new \Exception($this->model->getError());
} }
$manystoreAuthGroupModel = new ManystoreAuthGroup(); $manystoreAuthGroupModel = new ManystoreAuthGroup();
$group = []; $group = [];
$group['shop_id'] = $this->shopModel->id; $group['shop_id'] = $this->shopModel->id;
@ -358,7 +361,7 @@ class Index extends Backend
$group['updatetime'] = time(); $group['updatetime'] = time();
$group_id = $manystoreAuthGroupModel->insertGetId($group); $group_id = $manystoreAuthGroupModel->insertGetId($group);
if(!$group_id){ if(!$group_id){
$this->error('添加失败'); throw new \Exception('添加失败');
} }
$manystoreAuthGroupAccessModel = new ManystoreAuthGroupAccess(); $manystoreAuthGroupAccessModel = new ManystoreAuthGroupAccess();
@ -374,12 +377,12 @@ class Index extends Backend
\think\Hook::listen('shop_create_after', $data); \think\Hook::listen('shop_create_after', $data);
db()->commit(); db()->commit();
$this->success();
}catch (Exception $e){ }catch (\Exception $e){
db()->rollback(); db()->rollback();
$this->error($e->getMessage()); $this->error($e->getMessage());
} }
$this->success();
} }
$this->error(); $this->error();
} }
@ -404,31 +407,25 @@ class Index extends Backend
$params = $this->request->post("row/a"); $params = $this->request->post("row/a");
$shop = $this->request->post("shop/a"); $shop = $this->request->post("shop/a");
if ($params) { if ($params) {
$shop["user_id"] = $params['user_id']; $shop["user_id"] = $params['user_id'];
db()->startTrans();
try{
$this->update_check($params,$shop,$shop_info); $this->update_check($params,$shop,$shop_info);
$result = $shop_info->save($shop); $result = $shop_info->save($shop);
if($result === false){ if($result === false){
$this->error(__("修改商家信息资料失败")); throw new \Exception(__("修改商家信息资料失败"));
} }
if($this->success_auth){ //当前密码
//当前密码 $password = $params['password'] ? $params['password'] : \app\common\model\dyqc\ManystoreShop::getDefaultPassword($shop["type"],$params["user_id"],$params);
$password = $params['password'] ? $params['password'] : \app\common\model\dyqc\ManystoreShop::getDefaultPassword($params["type"],$params["user_id"],$params);
//调用通过事件
$data = ['shop' => $row,"password"=>$password];
\think\Hook::listen('shop_auth_success_after', $data);
}
if($this->error_auth){
//调用通过事件
$data = ['shop' => $row];
\think\Hook::listen('shop_auth_fail_after', $data);
}
if ($params['password']) { if ($params['password']) {
if (!Validate::is($params['password'], '\S{6,16}')) { if (!Validate::is($params['password'], '\S{6,16}')) {
$this->error(__("Please input correct password")); throw new \Exception(__("Please input correct password"));
} }
$params['salt'] = Random::alnum(); $params['salt'] = Random::alnum();
$params['password'] = md5(md5($params['password']) . $params['salt']); $params['password'] = md5(md5($params['password']) . $params['salt']);
@ -448,13 +445,34 @@ class Index extends Backend
$result = $row->validate($validate)->save($params); $result = $row->validate($validate)->save($params);
if ($result === false) { if ($result === false) {
$this->error($row->getError()); throw new \Exception($row->getError());
} }
//调用事件 //调用事件
$data = ['shop' => $shop_info]; $data = ['shop' => $shop_info];
\think\Hook::listen('shop_update_after', $data); \think\Hook::listen('shop_update_after', $data);
if($this->success_auth){
//调用通过事件
$data = ['shop' => $shop_info,"password"=>$password];
\think\Hook::listen('shop_auth_success_after', $data);
}
if($this->error_auth){
//调用通过事件
$data = ['shop' => $shop_info];
\think\Hook::listen('shop_auth_fail_after', $data);
}
db()->commit();
}catch (\Exception $e){
db()->rollback();
$this->error($e->getMessage().$e->getFile().$e->getLine());
}
$this->success(); $this->success();
} }
$this->error(); $this->error();
@ -482,10 +500,11 @@ class Index extends Backend
$this->error(__('No Results were found')); $this->error(__('No Results were found'));
} }
$this->updateCheck($ids);
db()->startTrans(); db()->startTrans();
try{ try{
$this->updateCheck($ids);
$result = $row->delete(); $result = $row->delete();
if(!$result){ if(!$result){
exception('账号信息删除失败'); exception('账号信息删除失败');
@ -496,7 +515,7 @@ class Index extends Backend
} }
db()->commit(); db()->commit();
$this->success('删除成功'); $this->success('删除成功');
}catch (Exception $e){ }catch (\Exception $e){
db()->rollback(); db()->rollback();
$this->error($e->getMessage()); $this->error($e->getMessage());
} }

View File

@ -211,7 +211,7 @@ class ClassesLib extends Backend
protected function update_check(&$params,$row=null) protected function update_check(&$params,$row=null)
{ {
try { // try {
$classesLib = new \app\common\model\school\classes\ClassesLib(); $classesLib = new \app\common\model\school\classes\ClassesLib();
$classesLib->no_auth_fields = $this->no_auth_fields; $classesLib->no_auth_fields = $this->no_auth_fields;
$classesLib->need_auth = $this->need_auth; $classesLib->need_auth = $this->need_auth;
@ -222,9 +222,9 @@ class ClassesLib extends Backend
$this->need_auth = $classesLib->need_auth; $this->need_auth = $classesLib->need_auth;
$this->have_auth = $classesLib->have_auth; $this->have_auth = $classesLib->have_auth;
}catch (\Exception $e){ // }catch (\Exception $e){
$this->error($e->getMessage()); // $this->error($e->getMessage());
} // }
//特有认证判断 //特有认证判断
@ -249,7 +249,17 @@ class ClassesLib extends Backend
} }
protected function update_classes($classes_lib_id){ protected function update_classes($classes_lib_id){
//课时数必须大于等于课时核销数
$count = \app\common\model\school\classes\ClassesSpec::where("classes_lib_id",$classes_lib_id)->count();
$classes_num = \app\common\model\school\classes\ClassesLib::where("id",$classes_lib_id)->value("classes_num");
if($count < $classes_num){
throw new \Exception("课时数必须大于等于课时核销数");
}
\app\common\model\school\classes\ClassesLib::update_classes($classes_lib_id); \app\common\model\school\classes\ClassesLib::update_classes($classes_lib_id);
} }
@ -310,7 +320,7 @@ class ClassesLib extends Backend
Db::commit(); Db::commit();
} catch (ValidateException|PDOException|Exception $e) { } catch (ValidateException|PDOException|\Exception $e) {
Db::rollback(); Db::rollback();
$this->error($e->getMessage()); $this->error($e->getMessage());
} }
@ -362,6 +372,14 @@ class ClassesLib extends Backend
\app\common\model\school\classes\ClassesSpec::create($v); \app\common\model\school\classes\ClassesSpec::create($v);
} }
//因为是批量添加,所有规格重新进行检测,防止出现时间重叠
$specss = \app\common\model\school\classes\ClassesSpec::where("classes_lib_id",$this->model["id"])->select();
foreach ($specss as $k=>$specs){
$params =$specs;
(new \app\common\model\school\classes\ClassesSpec)->specCheck($params,null,$specs);
}
$this->update_classes($this->model["id"]); $this->update_classes($this->model["id"]);
if($this->have_auth){ if($this->have_auth){
@ -387,7 +405,7 @@ class ClassesLib extends Backend
Db::commit(); Db::commit();
} catch (ValidateException|PDOException|Exception $e) { } catch (ValidateException|PDOException|\Exception $e) {
Db::rollback(); Db::rollback();
$this->error($e->getMessage()); $this->error($e->getMessage());
} }
@ -441,6 +459,9 @@ class ClassesLib extends Backend
$this->update_check($params,$row); $this->update_check($params,$row);
$spec = $params["spec"] ?? []; $spec = $params["spec"] ?? [];
// var_dump($spec);
$delete_spec_ids = $params["delete_spec_ids"] ?? []; $delete_spec_ids = $params["delete_spec_ids"] ?? [];
unset($params["spec"]); unset($params["spec"]);
unset($params["delete_spec_ids"]); unset($params["delete_spec_ids"]);
@ -461,6 +482,13 @@ class ClassesLib extends Backend
$delete_spec->delete(); $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"]); $this->update_classes($row["id"]);
if($this->have_auth){ if($this->have_auth){
//调用通过事件 //调用通过事件
@ -488,7 +516,7 @@ class ClassesLib extends Backend
Db::commit(); Db::commit();
} catch (ValidateException|PDOException|Exception $e) { } catch (ValidateException|PDOException|\Exception $e) {
Db::rollback(); Db::rollback();
$this->error($e->getMessage()); $this->error($e->getMessage());
} }

View File

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

View File

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

View File

@ -8,6 +8,7 @@ return [
'Please input correct password' => '密码长度必须在6-16位之间不能包含空格', 'Please input correct password' => '密码长度必须在6-16位之间不能包含空格',
'Please input correct nickname' => '昵称仅支持输入中文、英文字母(大小写)、数字、下划线', 'Please input correct nickname' => '昵称仅支持输入中文、英文字母(大小写)、数字、下划线',
'Please input length nickname' => '昵称请最多填写10个字符', 'Please input length nickname' => '昵称请最多填写10个字符',
'Loss_ratio' => '课程损耗比(百分制)',
'user_id' => '申请用户', 'user_id' => '申请用户',
'Logo' => 'Logo', 'Logo' => 'Logo',

View File

@ -25,6 +25,8 @@ return [
'Set status to 0' => '设为待支付', 'Set status to 0' => '设为待支付',
'Status 3' => '使用中', 'Status 3' => '使用中',
'Set status to 3' => '设为使用中', 'Set status to 3' => '设为使用中',
'Status 4' => '售后中',
'Set status to 4' => '设为售后中',
'Status 6' => '已退款', 'Status 6' => '已退款',
'Set status to 6' => '设为已退款', 'Set status to 6' => '设为已退款',
'Status 9' => '已完成', 'Status 9' => '已完成',

View File

@ -9,6 +9,8 @@ return [
'Set status to 0' => '设为待支付', 'Set status to 0' => '设为待支付',
'Status 3' => '使用中', 'Status 3' => '使用中',
'Set status to 3' => '设为使用中', 'Set status to 3' => '设为使用中',
'Status 4' => '售后中',
'Set status to 4' => '设为售后中',
'Status 6' => '已退款', 'Status 6' => '已退款',
'Set status to 6' => '设为已退款', 'Set status to 6' => '设为已退款',
'Status 9' => '已完成', 'Status 9' => '已完成',

View File

@ -0,0 +1,68 @@
<?php
return [
'Order_no' => '售后单号',
'Reason' => '售后申请原因',
'Classes_order_id' => '课程订单id',
'User_id' => '下单人id',
'Classes_order_detail_id' => '订单课程id',
'Classes_lib_id' => '课程id',
'Manystore_id' => '机构账号id',
'Shop_id' => '机构店铺id',
'Status' => '售后状态',
'Status 1' => '待处理',
'Set status to 1' => '设为待处理',
'Status 4' => '处理中',
'Set status to 4' => '设为处理中',
'Status 7' => '已结单',
'Set status to 7' => '设为已结单',
'Status -3' => '已取消',
'Set status to -3' => '设为已取消',
'Service_stauts' => '售后处理状态',
'Service_stauts 1' => '待机构处理',
'Service_stauts 4' => '待用户确认',
'Service_stauts 7' => '售后通过结单',
'Service_stauts -3' => '售后驳回结单',
'Sales_type' => '结单类型',
'Sales_type -3' => '未结单',
'Sales_type 1' => '机构驳回',
'Sales_type 4' => '用户驳回',
'Sales_type 7' => '平台驳回',
'Sales_type 10' => '成功退款',
'Reject_reason' => '驳回原因',
'Reject_images' => '驳回图片资料',
'Auto_price' => '自动计算应退全额',
'Loss_proportion' => '课程损耗比例',
'Auto_loss_price' => '自动计算损耗金额',
'Tbc_price' => '售后待确认退款金额',
'C_price' => '售后已确认退款金额',
'Real_refundprice' => '实际退款金额',
'Sub_refundprice' => '剩余未退金额',
'Platform' => '退款平台',
'Platform miniapp' => '微信小程序',
'Pay_type' => '退款方式',
'Pay_type yue' => '余额',
'Pay_type wechat' => '微信',
'Pay_json' => '三方支付信息json',
'Deletetime' => '删除时间',
'Refundtime' => '退款时间',
'Rejecttime' => '驳回时间',
'Handletime' => '处理时间',
'Confirmtime' => '确认时间',
'Checkouttime' => '结单时间',
'Createtime' => '创建时间',
'Updatetime' => '修改时间',
'Order.order_no' => '订单号',
'Order.pay_no' => '微信支付单号',
'User.nickname' => '昵称',
'User.realname' => '真实姓名',
'User.mobile' => '手机号',
'User.avatar' => '头像',
'Detail.title' => '标题',
'Detail.headimage' => '头图',
'Lib.title' => '标题',
'Lib.headimage' => '头图',
'Manystore.nickname' => '昵称',
'Shop.name' => '店铺名称',
'Shop.logo' => '品牌LOGO'
];

View File

@ -0,0 +1,45 @@
<?php
return [
'Classes_service_order_id' => '课程售后订单id',
'Classes_order_id' => '课程订单id',
'User_id' => '下单人id',
'Classes_order_detail_id' => '订单课程id',
'Classes_lib_id' => '课程id',
'Manystore_id' => '机构账号id',
'Shop_id' => '机构店铺id',
'Status' => '售后状态',
'Status 1' => '待处理',
'Set status to 1' => '设为待处理',
'Status 4' => '处理中',
'Set status to 4' => '设为处理中',
'Status 7' => '已结单',
'Set status to 7' => '设为已结单',
'Status -3' => '已取消',
'Set status to -3' => '设为已取消',
'Service_stauts' => '售后处理状态',
'Service_stauts 1' => '待机构处理',
'Service_stauts 4' => '待用户确认',
'Service_stauts 7' => '售后通过结单',
'Service_stauts -3' => '售后驳回结单',
'Sales_type' => '结单类型',
'Sales_type -3' => '未结单',
'Sales_type 1' => '机构驳回',
'Sales_type 4' => '用户驳回',
'Sales_type 7' => '平台驳回',
'Sales_type 10' => '成功退款',
'Log_text' => '记录内容',
'Oper_id' => '记录人id',
'Oper_type' => '记录人类型',
'Createtime' => '创建时间',
'Updatetime' => '修改时间',
'Order.order_no' => '售后单号',
'Order.order_no' => '订单号',
'Order.pay_no' => '微信支付单号',
'User.nickname' => '昵称',
'User.realname' => '真实姓名',
'User.mobile' => '手机号',
'User.avatar' => '头像',
'Detail.title' => '标题',
'Admin.nickname' => '昵称'
];

View File

@ -45,7 +45,7 @@ class Order extends Model
public function getStatusList() public function getStatusList()
{ {
return ['-3' => __('Status -3'), '0' => __('Status 0'), '3' => __('Status 3'), '6' => __('Status 6'), '9' => __('Status 9')]; return ['-3' => __('Status -3'), '0' => __('Status 0'), '3' => __('Status 3'),'4' => __('Status 4'), '6' => __('Status 6'), '9' => __('Status 9')];
} }
public function getBeforeStatusList() public function getBeforeStatusList()

View File

@ -35,7 +35,7 @@ class OrderLog extends Model
public function getStatusList() public function getStatusList()
{ {
return ['-3' => __('Status -3'), '0' => __('Status 0'), '3' => __('Status 3'), '6' => __('Status 6'), '9' => __('Status 9')]; return ['-3' => __('Status -3'), '0' => __('Status 0'), '3' => __('Status 3'),'4' => __('Status 4'), '6' => __('Status 6'), '9' => __('Status 9')];
} }
public function getBeforeStatusList() public function getBeforeStatusList()

View File

@ -0,0 +1,206 @@
<?php
namespace app\admin\model\school\classes\order;
use app\common\model\dyqc\ManystoreShop;
use app\common\model\manystore\Shop;
use app\common\model\school\classes\ClassesLib;
use app\manystore\model\Manystore;
use think\Model;
use traits\model\SoftDelete;
class ServiceOrder extends Model
{
use SoftDelete;
// 表名
protected $name = 'school_classes_service_order';
// 自动写入时间戳字段
protected $autoWriteTimestamp = 'integer';
// 定义时间戳字段名
protected $createTime = 'createtime';
protected $updateTime = 'updatetime';
protected $deleteTime = 'deletetime';
// 追加属性
protected $append = [
'status_text',
'service_stauts_text',
'sales_type_text',
'platform_text',
'pay_type_text',
'refundtime_text',
'rejecttime_text',
'handletime_text',
'confirmtime_text',
'checkouttime_text'
];
public function getStatusList()
{
return ['1' => __('Status 1'), '4' => __('Status 4'), '7' => __('Status 7'), '-3' => __('Status -3')];
}
public function getServiceStautsList()
{
return ['1' => __('Service_stauts 1'), '4' => __('Service_stauts 4'), '7' => __('Service_stauts 7'), '-3' => __('Service_stauts -3')];
}
public function getSalesTypeList()
{
return ['-3' => __('Sales_type -3'), '1' => __('Sales_type 1'), '4' => __('Sales_type 4'), '7' => __('Sales_type 7'), '10' => __('Sales_type 10')];
}
public function getPlatformList()
{
return ['miniapp' => __('Platform miniapp')];
}
public function getPayTypeList()
{
return ['yue' => __('Pay_type yue'), 'wechat' => __('Pay_type wechat')];
}
public function getStatusTextAttr($value, $data)
{
$value = $value ? $value : (isset($data['status']) ? $data['status'] : '');
$list = $this->getStatusList();
return isset($list[$value]) ? $list[$value] : '';
}
public function getServiceStautsTextAttr($value, $data)
{
$value = $value ? $value : (isset($data['service_stauts']) ? $data['service_stauts'] : '');
$list = $this->getServiceStautsList();
return isset($list[$value]) ? $list[$value] : '';
}
public function getSalesTypeTextAttr($value, $data)
{
$value = $value ? $value : (isset($data['sales_type']) ? $data['sales_type'] : '');
$list = $this->getSalesTypeList();
return isset($list[$value]) ? $list[$value] : '';
}
public function getPlatformTextAttr($value, $data)
{
$value = $value ? $value : (isset($data['platform']) ? $data['platform'] : '');
$list = $this->getPlatformList();
return isset($list[$value]) ? $list[$value] : '';
}
public function getPayTypeTextAttr($value, $data)
{
$value = $value ? $value : (isset($data['pay_type']) ? $data['pay_type'] : '');
$list = $this->getPayTypeList();
return isset($list[$value]) ? $list[$value] : '';
}
public function getRefundtimeTextAttr($value, $data)
{
$value = $value ? $value : (isset($data['refundtime']) ? $data['refundtime'] : '');
return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
}
public function getRejecttimeTextAttr($value, $data)
{
$value = $value ? $value : (isset($data['rejecttime']) ? $data['rejecttime'] : '');
return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
}
public function getHandletimeTextAttr($value, $data)
{
$value = $value ? $value : (isset($data['handletime']) ? $data['handletime'] : '');
return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
}
public function getConfirmtimeTextAttr($value, $data)
{
$value = $value ? $value : (isset($data['confirmtime']) ? $data['confirmtime'] : '');
return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
}
public function getCheckouttimeTextAttr($value, $data)
{
$value = $value ? $value : (isset($data['checkouttime']) ? $data['checkouttime'] : '');
return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
}
protected function setRefundtimeAttr($value)
{
return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
}
protected function setRejecttimeAttr($value)
{
return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
}
protected function setHandletimeAttr($value)
{
return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
}
protected function setConfirmtimeAttr($value)
{
return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
}
protected function setCheckouttimeAttr($value)
{
return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
}
public function classesorder()
{
return $this->belongsTo(Order::class, 'classes_order_id', 'id', [], 'LEFT')->setEagerlyType(0);
}
public function user()
{
return $this->belongsTo('app\common\model\User', 'user_id', 'id', [], 'LEFT')->setEagerlyType(0);
}
public function detail()
{
return $this->belongsTo(OrderDetail::class, 'classes_order_detail_id', 'id', [], 'LEFT')->setEagerlyType(0);
}
public function lib()
{
return $this->belongsTo(ClassesLib::class, 'classes_lib_id', 'id', [], 'LEFT')->setEagerlyType(0);
}
public function manystore()
{
return $this->belongsTo(Manystore::class, 'manystore_id', 'id', [], 'LEFT')->setEagerlyType(0);
}
public function shop()
{
return $this->belongsTo(ManystoreShop::class, 'shop_id', 'id', [], 'LEFT')->setEagerlyType(0);
}
}

View File

@ -0,0 +1,106 @@
<?php
namespace app\admin\model\school\classes\order;
use app\admin\model\Admin;
use think\Model;
class ServiceOrderLog extends Model
{
// 表名
protected $name = 'school_classes_service_order_log';
// 自动写入时间戳字段
protected $autoWriteTimestamp = 'integer';
// 定义时间戳字段名
protected $createTime = 'createtime';
protected $updateTime = 'updatetime';
protected $deleteTime = false;
// 追加属性
protected $append = [
'status_text',
'service_stauts_text',
'sales_type_text'
];
public function getStatusList()
{
return ['1' => __('Status 1'), '4' => __('Status 4'), '7' => __('Status 7'), '-3' => __('Status -3')];
}
public function getServiceStautsList()
{
return ['1' => __('Service_stauts 1'), '4' => __('Service_stauts 4'), '7' => __('Service_stauts 7'), '-3' => __('Service_stauts -3')];
}
public function getSalesTypeList()
{
return ['-3' => __('Sales_type -3'), '1' => __('Sales_type 1'), '4' => __('Sales_type 4'), '7' => __('Sales_type 7'), '10' => __('Sales_type 10')];
}
public function getStatusTextAttr($value, $data)
{
$value = $value ? $value : (isset($data['status']) ? $data['status'] : '');
$list = $this->getStatusList();
return isset($list[$value]) ? $list[$value] : '';
}
public function getServiceStautsTextAttr($value, $data)
{
$value = $value ? $value : (isset($data['service_stauts']) ? $data['service_stauts'] : '');
$list = $this->getServiceStautsList();
return isset($list[$value]) ? $list[$value] : '';
}
public function getSalesTypeTextAttr($value, $data)
{
$value = $value ? $value : (isset($data['sales_type']) ? $data['sales_type'] : '');
$list = $this->getSalesTypeList();
return isset($list[$value]) ? $list[$value] : '';
}
public function serviceorder()
{
return $this->belongsTo(ServiceOrder::class, 'classes_service_order_id', 'id', [], 'LEFT')->setEagerlyType(0);
}
public function classesorder()
{
return $this->belongsTo(Order::class, 'classes_order_id', 'id', [], 'LEFT')->setEagerlyType(0);
}
public function user()
{
return $this->belongsTo('app\common\model\User', 'user_id', 'id', [], 'LEFT')->setEagerlyType(0);
}
public function detail()
{
return $this->belongsTo(OrderDetail::class, 'classes_order_detail_id', 'id', [], 'LEFT')->setEagerlyType(0);
}
public function admin()
{
return $this->belongsTo(Admin::class, 'oper_id', 'id', [], 'LEFT')->setEagerlyType(0);
}
}

View File

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

View File

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

View File

@ -176,7 +176,7 @@
<div class="form-group"> <div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Classes_num')}:</label> <label class="control-label col-xs-12 col-sm-2">{:__('Classes_num')}:</label>
<div class="col-xs-12 col-sm-8"> <div class="col-xs-12 col-sm-8">
<input id="c-classes_num" class="form-control" data-rule="required" name="row[classes_num]" type="number" value="{$row.classes_num|htmlentities}"> <input id="c-classes_num" class="form-control" disabled data-rule="required" name="row[classes_num]" type="number" value="{$row.classes_num|htmlentities}">
<span style="color: red">(填写几节意味着客户购买课程后能预约上课核销几次,即购买本课程的课程节数)</span> <span style="color: red">(填写几节意味着客户购买课程后能预约上课核销几次,即购买本课程的课程节数)</span>
</div> </div>

View File

@ -0,0 +1,219 @@
<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">{:__('Order_no')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-order_no" data-rule="required" class="form-control" name="row[order_no]" type="text">
</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="">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('User_id')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-user_id" data-rule="required" data-source="user/user/index" data-field="nickname" class="form-control selectpage" name="row[user_id]" type="text" value="">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Classes_order_detail_id')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-classes_order_detail_id" data-rule="required" data-source="school/classes/order/detail/index" class="form-control selectpage" name="row[classes_order_detail_id]" type="text" value="">
</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="">
</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="">
</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">{:__('Status')}:</label>
<div class="col-xs-12 col-sm-8">
<div class="radio">
{foreach name="statusList" item="vo"}
<label for="row[status]-{$key}"><input id="row[status]-{$key}" name="row[status]" type="radio" value="{$key}" {in name="key" value="1"}checked{/in} /> {$vo}</label>
{/foreach}
</div>
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Service_stauts')}:</label>
<div class="col-xs-12 col-sm-8">
<select id="c-service_stauts" data-rule="required" class="form-control selectpicker" name="row[service_stauts]">
{foreach name="serviceStautsList" item="vo"}
<option value="{$key}" {in name="key" value="1"}selected{/in}>{$vo}</option>
{/foreach}
</select>
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Sales_type')}:</label>
<div class="col-xs-12 col-sm-8">
<select id="c-sales_type" data-rule="required" class="form-control selectpicker" name="row[sales_type]">
{foreach name="salesTypeList" item="vo"}
<option value="{$key}" {in name="key" value="-3"}selected{/in}>{$vo}</option>
{/foreach}
</select>
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Reject_reason')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-reject_reason" class="form-control" name="row[reject_reason]" type="text">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Reject_images')}:</label>
<div class="col-xs-12 col-sm-8">
<div class="input-group">
<input id="c-reject_images" class="form-control" size="50" name="row[reject_images]" type="text">
<div class="input-group-addon no-border no-padding">
<span><button type="button" id="faupload-reject_images" class="btn btn-danger faupload" data-input-id="c-reject_images" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp,image/webp" data-multiple="true" data-preview-id="p-reject_images"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
<span><button type="button" id="fachoose-reject_images" class="btn btn-primary fachoose" data-input-id="c-reject_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-reject_images"></span>
</div>
<ul class="row list-inline faupload-preview" id="p-reject_images"></ul>
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Auto_price')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-auto_price" data-rule="required" class="form-control" step="0.01" name="row[auto_price]" type="number">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Loss_proportion')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-loss_proportion" data-rule="required" class="form-control" step="0.01" name="row[loss_proportion]" type="number">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Auto_loss_price')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-auto_loss_price" data-rule="required" class="form-control" step="0.01" name="row[auto_loss_price]" type="number">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Tbc_price')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-tbc_price" data-rule="required" class="form-control" step="0.01" name="row[tbc_price]" type="number">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('C_price')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-c_price" data-rule="required" class="form-control" step="0.01" name="row[c_price]" type="number">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Real_refundprice')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-real_refundprice" class="form-control" step="0.01" name="row[real_refundprice]" type="number">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Sub_refundprice')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-sub_refundprice" class="form-control" step="0.01" name="row[sub_refundprice]" type="number">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Platform')}:</label>
<div class="col-xs-12 col-sm-8">
<select id="c-platform" class="form-control selectpicker" name="row[platform]">
{foreach name="platformList" item="vo"}
<option value="{$key}" {in name="key" value=""}selected{/in}>{$vo}</option>
{/foreach}
</select>
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Pay_type')}:</label>
<div class="col-xs-12 col-sm-8">
<select id="c-pay_type" class="form-control selectpicker" name="row[pay_type]">
{foreach name="payTypeList" item="vo"}
<option value="{$key}" {in name="key" value="wechat"}selected{/in}>{$vo}</option>
{/foreach}
</select>
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Pay_json')}:</label>
<div class="col-xs-12 col-sm-8">
<dl class="fieldlist" data-name="row[pay_json]">
<dd>
<ins>{:__('Key')}</ins>
<ins>{:__('Value')}</ins>
</dd>
<dd><a href="javascript:;" class="btn btn-sm btn-success btn-append"><i class="fa fa-plus"></i> {:__('Append')}</a></dd>
<textarea name="row[pay_json]" class="form-control hide" cols="30" rows="5"></textarea>
</dl>
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Refundtime')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-refundtime" min="0" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[refundtime]" 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">{:__('Rejecttime')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-rejecttime" min="0" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[rejecttime]" 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">{:__('Handletime')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-handletime" min="0" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[handletime]" 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">{:__('Confirmtime')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-confirmtime" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[confirmtime]" 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">{:__('Checkouttime')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-checkouttime" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[checkouttime]" type="text" value="{:date('Y-m-d H:i:s')}">
</div>
</div>
<div class="form-group layer-footer">
<label class="control-label col-xs-12 col-sm-2"></label>
<div class="col-xs-12 col-sm-8">
<button type="submit" class="btn btn-primary btn-embossed disabled">{:__('OK')}</button>
</div>
</div>
</form>

View File

@ -0,0 +1,219 @@
<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">{:__('Order_no')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-order_no" data-rule="required" class="form-control" name="row[order_no]" type="text" value="{$row.order_no|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">{:__('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_order_detail_id')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-classes_order_detail_id" data-rule="required" data-source="school/classes/order/detail/index" class="form-control selectpage" name="row[classes_order_detail_id]" type="text" value="{$row.classes_order_detail_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">{:__('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}">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Status')}:</label>
<div class="col-xs-12 col-sm-8">
<div class="radio">
{foreach name="statusList" item="vo"}
<label for="row[status]-{$key}"><input id="row[status]-{$key}" name="row[status]" type="radio" value="{$key}" {in name="key" value="$row.status"}checked{/in} /> {$vo}</label>
{/foreach}
</div>
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Service_stauts')}:</label>
<div class="col-xs-12 col-sm-8">
<select id="c-service_stauts" data-rule="required" class="form-control selectpicker" name="row[service_stauts]">
{foreach name="serviceStautsList" item="vo"}
<option value="{$key}" {in name="key" value="$row.service_stauts"}selected{/in}>{$vo}</option>
{/foreach}
</select>
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Sales_type')}:</label>
<div class="col-xs-12 col-sm-8">
<select id="c-sales_type" data-rule="required" class="form-control selectpicker" name="row[sales_type]">
{foreach name="salesTypeList" item="vo"}
<option value="{$key}" {in name="key" value="$row.sales_type"}selected{/in}>{$vo}</option>
{/foreach}
</select>
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Reject_reason')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-reject_reason" class="form-control" name="row[reject_reason]" type="text" value="{$row.reject_reason|htmlentities}">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Reject_images')}:</label>
<div class="col-xs-12 col-sm-8">
<div class="input-group">
<input id="c-reject_images" class="form-control" size="50" name="row[reject_images]" type="text" value="{$row.reject_images|htmlentities}">
<div class="input-group-addon no-border no-padding">
<span><button type="button" id="faupload-reject_images" class="btn btn-danger faupload" data-input-id="c-reject_images" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp,image/webp" data-multiple="true" data-preview-id="p-reject_images"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
<span><button type="button" id="fachoose-reject_images" class="btn btn-primary fachoose" data-input-id="c-reject_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-reject_images"></span>
</div>
<ul class="row list-inline faupload-preview" id="p-reject_images"></ul>
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Auto_price')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-auto_price" data-rule="required" class="form-control" step="0.01" name="row[auto_price]" type="number" value="{$row.auto_price|htmlentities}">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Loss_proportion')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-loss_proportion" data-rule="required" class="form-control" step="0.01" name="row[loss_proportion]" type="number" value="{$row.loss_proportion|htmlentities}">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Auto_loss_price')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-auto_loss_price" data-rule="required" class="form-control" step="0.01" name="row[auto_loss_price]" type="number" value="{$row.auto_loss_price|htmlentities}">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Tbc_price')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-tbc_price" data-rule="required" class="form-control" step="0.01" name="row[tbc_price]" type="number" value="{$row.tbc_price|htmlentities}">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('C_price')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-c_price" data-rule="required" class="form-control" step="0.01" name="row[c_price]" type="number" value="{$row.c_price|htmlentities}">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Real_refundprice')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-real_refundprice" class="form-control" step="0.01" name="row[real_refundprice]" type="number" value="{$row.real_refundprice|htmlentities}">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Sub_refundprice')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-sub_refundprice" class="form-control" step="0.01" name="row[sub_refundprice]" type="number" value="{$row.sub_refundprice|htmlentities}">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Platform')}:</label>
<div class="col-xs-12 col-sm-8">
<select id="c-platform" class="form-control selectpicker" name="row[platform]">
{foreach name="platformList" item="vo"}
<option value="{$key}" {in name="key" value="$row.platform"}selected{/in}>{$vo}</option>
{/foreach}
</select>
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Pay_type')}:</label>
<div class="col-xs-12 col-sm-8">
<select id="c-pay_type" class="form-control selectpicker" name="row[pay_type]">
{foreach name="payTypeList" item="vo"}
<option value="{$key}" {in name="key" value="$row.pay_type"}selected{/in}>{$vo}</option>
{/foreach}
</select>
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Pay_json')}:</label>
<div class="col-xs-12 col-sm-8">
<dl class="fieldlist" data-name="row[pay_json]">
<dd>
<ins>{:__('Key')}</ins>
<ins>{:__('Value')}</ins>
</dd>
<dd><a href="javascript:;" class="btn btn-sm btn-success btn-append"><i class="fa fa-plus"></i> {:__('Append')}</a></dd>
<textarea name="row[pay_json]" class="form-control hide" cols="30" rows="5">{$row.pay_json|htmlentities}</textarea>
</dl>
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Refundtime')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-refundtime" min="0" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[refundtime]" type="text" value="{:$row.refundtime?datetime($row.refundtime):''}">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Rejecttime')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-rejecttime" min="0" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[rejecttime]" type="text" value="{:$row.rejecttime?datetime($row.rejecttime):''}">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Handletime')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-handletime" min="0" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[handletime]" type="text" value="{:$row.handletime?datetime($row.handletime):''}">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Confirmtime')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-confirmtime" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[confirmtime]" type="text" value="{:$row.confirmtime?datetime($row.confirmtime):''}">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Checkouttime')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-checkouttime" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[checkouttime]" type="text" value="{:$row.checkouttime?datetime($row.checkouttime):''}">
</div>
</div>
<div class="form-group layer-footer">
<label class="control-label col-xs-12 col-sm-2"></label>
<div class="col-xs-12 col-sm-8">
<button type="submit" class="btn btn-primary btn-embossed disabled">{:__('OK')}</button>
</div>
</div>
</form>

View File

@ -0,0 +1,46 @@
<div class="panel panel-default panel-intro">
<div class="panel-heading">
{:build_heading(null,FALSE)}
<ul class="nav nav-tabs" data-field="status">
<li class="{:$Think.get.status === null ? 'active' : ''}"><a href="#t-all" data-value="" data-toggle="tab">{:__('All')}</a></li>
{foreach name="statusList" item="vo"}
<li class="{:$Think.get.status === (string)$key ? 'active' : ''}"><a href="#t-{$key}" data-value="{$key}" data-toggle="tab">{$vo}</a></li>
{/foreach}
</ul>
</div>
<div class="panel-body">
<div id="myTabContent" class="tab-content">
<div class="tab-pane fade active in" id="one">
<div class="widget-body no-padding">
<div id="toolbar" class="toolbar">
<a href="javascript:;" class="btn btn-primary btn-refresh" title="{:__('Refresh')}" ><i class="fa fa-refresh"></i> </a>
<a href="javascript:;" class="btn btn-success btn-add {:$auth->check('school/classes/order/service_order/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/order/service_order/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/order/service_order/del')?'':'hide'}" title="{:__('Delete')}" ><i class="fa fa-trash"></i> {:__('Delete')}</a>
<div class="dropdown btn-group {:$auth->check('school/classes/order/service_order/multi')?'':'hide'}">
<a class="btn btn-primary btn-more dropdown-toggle btn-disabled disabled" data-toggle="dropdown"><i class="fa fa-cog"></i> {:__('More')}</a>
<ul class="dropdown-menu text-left" role="menu">
{foreach name="statusList" item="vo"}
<li><a class="btn btn-link btn-multi btn-disabled disabled" href="javascript:" data-params="status={$key}">{:__('Set status to ' . $key)}</a></li>
{/foreach}
</ul>
</div>
<a class="btn btn-success btn-recyclebin btn-dialog {:$auth->check('school/classes/order/service_order/recyclebin')?'':'hide'}" href="school/classes/order/service_order/recyclebin" title="{:__('Recycle bin')}"><i class="fa fa-recycle"></i> {:__('Recycle bin')}</a>
</div>
<table id="table" class="table table-striped table-bordered table-hover table-nowrap"
data-operate-edit="{:$auth->check('school/classes/order/service_order/edit')}"
data-operate-del="{:$auth->check('school/classes/order/service_order/del')}"
width="100%">
</table>
</div>
</div>
</div>
</div>
</div>

View File

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

View File

@ -0,0 +1,105 @@
<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">{:__('Classes_service_order_id')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-classes_service_order_id" data-rule="required" data-source="school/classes/service/order/index" class="form-control selectpage" name="row[classes_service_order_id]" type="text" value="">
</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="">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('User_id')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-user_id" data-rule="required" data-source="user/user/index" data-field="nickname" class="form-control selectpage" name="row[user_id]" type="text" value="">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Classes_order_detail_id')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-classes_order_detail_id" data-rule="required" data-source="school/classes/order/detail/index" class="form-control selectpage" name="row[classes_order_detail_id]" type="text" value="">
</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="classes/lib/index" class="form-control selectpage" name="row[classes_lib_id]" type="text" value="">
</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="">
</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="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">{:__('Status')}:</label>
<div class="col-xs-12 col-sm-8">
<div class="radio">
{foreach name="statusList" item="vo"}
<label for="row[status]-{$key}"><input id="row[status]-{$key}" name="row[status]" type="radio" value="{$key}" {in name="key" value="1"}checked{/in} /> {$vo}</label>
{/foreach}
</div>
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Service_stauts')}:</label>
<div class="col-xs-12 col-sm-8">
<select id="c-service_stauts" data-rule="required" class="form-control selectpicker" name="row[service_stauts]">
{foreach name="serviceStautsList" item="vo"}
<option value="{$key}" {in name="key" value="1"}selected{/in}>{$vo}</option>
{/foreach}
</select>
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Sales_type')}:</label>
<div class="col-xs-12 col-sm-8">
<select id="c-sales_type" data-rule="required" class="form-control selectpicker" name="row[sales_type]">
{foreach name="salesTypeList" item="vo"}
<option value="{$key}" {in name="key" value="-3"}selected{/in}>{$vo}</option>
{/foreach}
</select>
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Log_text')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-log_text" class="form-control" name="row[log_text]" type="text">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Oper_id')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-oper_id" data-rule="required" data-source="auth/admin/selectpage" class="form-control selectpage" name="row[oper_id]" type="text" value="">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Oper_type')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-oper_type" class="form-control" name="row[oper_type]" type="text">
</div>
</div>
<div class="form-group layer-footer">
<label class="control-label col-xs-12 col-sm-2"></label>
<div class="col-xs-12 col-sm-8">
<button type="submit" class="btn btn-primary btn-embossed disabled">{:__('OK')}</button>
</div>
</div>
</form>

View File

@ -0,0 +1,105 @@
<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">{:__('Classes_service_order_id')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-classes_service_order_id" data-rule="required" data-source="school/classes/service/order/index" class="form-control selectpage" name="row[classes_service_order_id]" type="text" value="{$row.classes_service_order_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">{:__('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_order_detail_id')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-classes_order_detail_id" data-rule="required" data-source="school/classes/order/detail/index" class="form-control selectpage" name="row[classes_order_detail_id]" type="text" value="{$row.classes_order_detail_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="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">{:__('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="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">{:__('Status')}:</label>
<div class="col-xs-12 col-sm-8">
<div class="radio">
{foreach name="statusList" item="vo"}
<label for="row[status]-{$key}"><input id="row[status]-{$key}" name="row[status]" type="radio" value="{$key}" {in name="key" value="$row.status"}checked{/in} /> {$vo}</label>
{/foreach}
</div>
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Service_stauts')}:</label>
<div class="col-xs-12 col-sm-8">
<select id="c-service_stauts" data-rule="required" class="form-control selectpicker" name="row[service_stauts]">
{foreach name="serviceStautsList" item="vo"}
<option value="{$key}" {in name="key" value="$row.service_stauts"}selected{/in}>{$vo}</option>
{/foreach}
</select>
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Sales_type')}:</label>
<div class="col-xs-12 col-sm-8">
<select id="c-sales_type" data-rule="required" class="form-control selectpicker" name="row[sales_type]">
{foreach name="salesTypeList" item="vo"}
<option value="{$key}" {in name="key" value="$row.sales_type"}selected{/in}>{$vo}</option>
{/foreach}
</select>
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Log_text')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-log_text" class="form-control" name="row[log_text]" type="text" value="{$row.log_text|htmlentities}">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Oper_id')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-oper_id" data-rule="required" data-source="auth/admin/selectpage" class="form-control selectpage" name="row[oper_id]" type="text" value="{$row.oper_id|htmlentities}">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Oper_type')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-oper_type" class="form-control" name="row[oper_type]" type="text" value="{$row.oper_type|htmlentities}">
</div>
</div>
<div class="form-group layer-footer">
<label class="control-label col-xs-12 col-sm-2"></label>
<div class="col-xs-12 col-sm-8">
<button type="submit" class="btn btn-primary btn-embossed disabled">{:__('OK')}</button>
</div>
</div>
</form>

View File

@ -0,0 +1,46 @@
<div class="panel panel-default panel-intro">
<div class="panel-heading">
{:build_heading(null,FALSE)}
<ul class="nav nav-tabs" data-field="status">
<li class="{:$Think.get.status === null ? 'active' : ''}"><a href="#t-all" data-value="" data-toggle="tab">{:__('All')}</a></li>
{foreach name="statusList" item="vo"}
<li class="{:$Think.get.status === (string)$key ? 'active' : ''}"><a href="#t-{$key}" data-value="{$key}" data-toggle="tab">{$vo}</a></li>
{/foreach}
</ul>
</div>
<div class="panel-body">
<div id="myTabContent" class="tab-content">
<div class="tab-pane fade active in" id="one">
<div class="widget-body no-padding">
<div id="toolbar" class="toolbar">
<a href="javascript:;" class="btn btn-primary btn-refresh" title="{:__('Refresh')}" ><i class="fa fa-refresh"></i> </a>
<a href="javascript:;" class="btn btn-success btn-add {:$auth->check('school/classes/order/service_order_log/add')?'':'hide'}" title="{:__('Add')}" ><i class="fa fa-plus"></i> {:__('Add')}</a>
<a href="javascript:;" class="btn btn-success btn-edit btn-disabled disabled {:$auth->check('school/classes/order/service_order_log/edit')?'':'hide'}" title="{:__('Edit')}" ><i class="fa fa-pencil"></i> {:__('Edit')}</a>
<a href="javascript:;" class="btn btn-danger btn-del btn-disabled disabled {:$auth->check('school/classes/order/service_order_log/del')?'':'hide'}" title="{:__('Delete')}" ><i class="fa fa-trash"></i> {:__('Delete')}</a>
<div class="dropdown btn-group {:$auth->check('school/classes/order/service_order_log/multi')?'':'hide'}">
<a class="btn btn-primary btn-more dropdown-toggle btn-disabled disabled" data-toggle="dropdown"><i class="fa fa-cog"></i> {:__('More')}</a>
<ul class="dropdown-menu text-left" role="menu">
{foreach name="statusList" item="vo"}
<li><a class="btn btn-link btn-multi btn-disabled disabled" href="javascript:" data-params="status={$key}">{:__('Set status to ' . $key)}</a></li>
{/foreach}
</ul>
</div>
</div>
<table id="table" class="table table-striped table-bordered table-hover table-nowrap"
data-operate-edit="{:$auth->check('school/classes/order/service_order_log/edit')}"
data-operate-del="{:$auth->check('school/classes/order/service_order_log/del')}"
width="100%">
</table>
</div>
</div>
</div>
</div>
</div>

View File

@ -24,12 +24,12 @@
</span> </span>
</div> </div>
</div> </div>
<div class="form-group"> <!-- <div class="form-group">-->
<label class="control-label col-xs-12 col-sm-2">{:__('Classes_lib_ids')}:</label> <!-- <label class="control-label col-xs-12 col-sm-2">{:__('Classes_lib_ids')}:</label>-->
<div class="col-xs-12 col-sm-8"> <!-- <div class="col-xs-12 col-sm-8">-->
<input id="c-classes_lib_ids" data-rule="required" data-source="school/classes/classes_lib/index" data-field="title" data-multiple="true" class="form-control selectpage" name="row[classes_lib_ids]" type="text" value=""> <!-- <input id="c-classes_lib_ids" data-rule="required" data-source="school/classes/classes_lib/index" data-field="title" data-multiple="true" class="form-control selectpage" name="row[classes_lib_ids]" type="text" value="">-->
</div> <!-- </div>-->
</div> <!-- </div>-->
<div class="form-group"> <div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Status')}:</label> <label class="control-label col-xs-12 col-sm-2">{:__('Status')}:</label>
<div class="col-xs-12 col-sm-8"> <div class="col-xs-12 col-sm-8">

View File

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

View File

@ -66,7 +66,7 @@ class User extends Api
} catch (\Exception $e){ } catch (\Exception $e){
$this->error($e->getMessage()); $this->error($e->getMessage());
} }
Cache::set('wechat_mini_code'.$code.$result['openid'],"1",60); Cache::set('wechat_miniapp_code'.$code.$result['openid'],"1",60);
$this->success('',$result); $this->success('',$result);
} }
@ -123,15 +123,16 @@ class User extends Api
$params['unionid'] = $this->request->param('unionid/s',''); $params['unionid'] = $this->request->param('unionid/s','');
$params['apptype'] = $this->request->param('apptype/s','miniapp'); $params['apptype'] = $this->request->param('apptype/s','miniapp');
$params['openid'] = $this->request->param('openid/s',''); $params['openid'] = $this->request->param('openid/s','');
$platform = $this->request->param('platform/s','wechat');
$code = $this->request->param('code/s',''); $code = $this->request->param('code/s','');
if(empty($code)){ if(empty($code)){
$this->error(__('缺少code')); $this->error(__('缺少code'));
} }
$wechat_mini_code = Cache::get('wechat_mini_code'.$code.$params['openid']); $wechat_mini_code = Cache::get("{$platform}_{$params['apptype']}_code".$code.$params['openid']);
if(!$wechat_mini_code)$this->error("授权code已过期或已使用请重新发起授权",['errcode'=>30002]); if(!$wechat_mini_code)$this->error("授权code已过期或已使用请重新发起授权",['errcode'=>30002]);
$platform = $this->request->param('platform/s','wechat');
//推荐人:逻辑未实现 //推荐人:逻辑未实现
$rec_user_id = $this->request->param('rec_user_id',0,'xilufitness_get_id_value'); $rec_user_id = $this->request->param('rec_user_id',0,'xilufitness_get_id_value');
$keeptime = $this->request->param('keeptime/d',0); $keeptime = $this->request->param('keeptime/d',0);

View File

@ -140,17 +140,33 @@ class Classes extends Base
* @ApiRoute(/api/school/classes/spec) * @ApiRoute(/api/school/classes/spec)
* @ApiMethod(GET) * @ApiMethod(GET)
* @ApiParams(name = "id", type = "int",required=true,description = "课程id") * @ApiParams(name = "id", type = "int",required=true,description = "课程id")
* @ApiParams(name = "user_id", type = "int",required=true,description = "需要查询是否下单的用户id")
* @ApiReturn({ spec 课时规格 }) * @ApiReturn({ spec 课时规格 })
*/ */
public function spec(){ public function spec(){
$user_id = $this->request->get('user_id/d',0);
$id = $this->request->get('id/d',''); $id = $this->request->get('id/d','');
$user = $this->auth->getUser();//登录用户
if(empty($id)){ if(empty($id)){
$this->error(__('缺少必要参数')); $this->error(__('缺少必要参数'));
} }
try { try {
$res = $this->model->spec($id); //如果是员工端操作
if($user_id && $id && $user){
//判断是否有操作权限
$classes_lib_ids = (new ClassesLib)->getClassesAuthIds($user['id']);
//判断当前订单课程是否在此课程授权范围内
if(!in_array($id,$classes_lib_ids)) throw new \Exception("该课程不在您的授权范围内,无法查看!");
}
if($user && !$user_id)$user_id = $user['id'];
$res = $this->model->spec($id,$user_id);
} catch (\Exception $e){ } catch (\Exception $e){
// Log::log($e->getMessage()); // Log::log($e->getMessage());
$this->error($e->getMessage(),['errcode'=>$e->getCode()]); $this->error($e->getMessage(),['errcode'=>$e->getCode()]);
@ -266,7 +282,7 @@ class Classes extends Base
* @ApiParams(name = "selfhot", type = "string",required=false,description = "机构热门:0=否,1=是") * @ApiParams(name = "selfhot", type = "string",required=false,description = "机构热门:0=否,1=是")
* @ApiParams(name = "feel", type = "string",required=false,description = "是否免费:0=否,1=是") * @ApiParams(name = "feel", type = "string",required=false,description = "是否免费:0=否,1=是")
* @ApiParams(name = "collect", type = "int",required=false,description = "是否专查我的收藏(需登录):1=是") * @ApiParams(name = "collect", type = "int",required=false,description = "是否专查我的收藏(需登录):1=是")
* @ApiParams(name = "order", type = "string",required=false,description = " normal=综合排序推薦優先,distance=距离优先,hot=熱門优先,new=平台最新优先,selfhot=机构热门优先,sale=銷量优先") * @ApiParams(name = "order", type = "string",required=false,description = " normal=综合排序推薦優先,distance=距离优先,hot=熱門优先,new=平台最新优先,selfhot=机构热门优先,sale=銷量优先,views=浏览量优先,collect=收藏量优先")
* @ApiParams(name = "nearby", type = "string",required=false,description = "限制最大搜索距离(米)") * @ApiParams(name = "nearby", type = "string",required=false,description = "限制最大搜索距离(米)")
* @ApiParams(name = "latitude", type = "string",required=false,description = "latitude") * @ApiParams(name = "latitude", type = "string",required=false,description = "latitude")
* @ApiParams(name = "longitude", type = "string",required=false,description = "longitude") * @ApiParams(name = "longitude", type = "string",required=false,description = "longitude")

View File

@ -9,7 +9,7 @@ use app\common\model\school\classes\hourorder\Order as OrderModel;
*/ */
class HourOrder extends Base class HourOrder extends Base
{ {
protected $noNeedLogin = []; protected $noNeedLogin = ["get_month_by_time"];
protected $noNeedRight = '*'; protected $noNeedRight = '*';
protected $model = null; protected $model = null;
@ -169,6 +169,7 @@ class HourOrder extends Base
* @ApiParams(name = "status", type = "string",required=false,description = "订单状态:-3=已取消,-1=已报名待审核,0=已预约,3=已完成") * @ApiParams(name = "status", type = "string",required=false,description = "订单状态:-3=已取消,-1=已报名待审核,0=已预约,3=已完成")
* @ApiParams(name = "classes_order_id", type = "int",required=true,description = "课程订单id") * @ApiParams(name = "classes_order_id", type = "int",required=true,description = "课程订单id")
* @ApiParams(name = "classes_lib_id", type = "int",required=false,description = "课程id") * @ApiParams(name = "classes_lib_id", type = "int",required=false,description = "课程id")
* @ApiParams(name = "time", type = "string",required=false,description = "按开始和结束时间区间查传值格式Y/m/d H:M:S-Y/m/d H:M:S")
* @ApiParams(name = "start_time", type = "string",required=false,description = "按开始时间区间查传值格式Y/m/d H:M:S-Y/m/d H:M:S") * @ApiParams(name = "start_time", type = "string",required=false,description = "按开始时间区间查传值格式Y/m/d H:M:S-Y/m/d H:M:S")
* @ApiParams(name = "createtime", type = "string",required=false,description = "按创建时间区间查传值格式Y/m/d H:M:S-Y/m/d H:M:S") * @ApiParams(name = "createtime", type = "string",required=false,description = "按创建时间区间查传值格式Y/m/d H:M:S-Y/m/d H:M:S")
* @ApiReturn({ * @ApiReturn({
@ -189,18 +190,19 @@ class HourOrder extends Base
$start_time = $this->request->get('start_time/s', ''); //搜索关键字 $start_time = $this->request->get('start_time/s', ''); //搜索关键字
$createtime = $this->request->get('createtime/s', ''); //搜索关键字 $createtime = $this->request->get('createtime/s', ''); //搜索关键字
$time = $this->request->get('time/s', ''); //搜索关键字
// $type = $this->request->get('type/s', ''); //筛选学员和教练单 // $type = $this->request->get('type/s', ''); //筛选学员和教练单
try{ try{
//当前申请状态 //当前申请状态
$res = $this->model::allList($user_id,$page, $limit,$keywords,$status,$classes_order_id,$classes_lib_ids,$start_time,$createtime); $res = $this->model::allList($user_id,$page, $limit,$keywords,$status,$classes_order_id,$classes_lib_ids,$start_time,$createtime,$time);
// if($user_id =='670153'){ // if($user_id =='670153'){
// file_put_contents("ceshi66.txt",(new AppointmentOrder())->getLastSql()); // file_put_contents("ceshi66.txt",(new AppointmentOrder())->getLastSql());
// } // }
}catch (\Exception $e){ }catch (\Exception $e){
$this->error($e->getMessage()); $this->error($this->model::getLastSql());
} }
$this->success('查询成功', $res); $this->success('查询成功', $res);
} }
@ -233,5 +235,31 @@ class HourOrder extends Base
$this->success('查询成功', $res); $this->success('查询成功', $res);
} }
/**
* @ApiTitle(通过时间点得到当前的月份数据)
* @ApiSummary(通过时间点得到当前的月份数据)
* @ApiMethod(GET)
* @ApiParams(name="time",type="string",required=true,description="选择的时间点时间戳")
* @ApiParams(name = "status", type = "string",required=false,description = "订单状态:-3=已取消,-1=已报名待审核,0=已预约,3=已完成")
*/
public function get_month_by_time(){
$time = $this->request->get('time/s','');
$status = $this->request->get('status/s','-1,0');
$user_id = 0;
$user = $this->auth->getUser();//登录用户
if($user)$user_id = $user['id'];
// if(empty($time)){
// $this->error(__('缺少必要参数'));
// }
try {
$res = $this->model::getMonthByTime($time,$user_id,$status);
} catch (\Exception $e){
// Log::log($e->getMessage());
$this->error($e->getMessage(),['errcode'=>$e->getCode()]);
}
$this->success('生成成功', $res);
}
} }

View File

@ -10,7 +10,7 @@ use app\common\model\school\classes\Teacher as Teachermodel;
*/ */
class Message extends Base class Message extends Base
{ {
protected $noNeedLogin = []; protected $noNeedLogin = ['message_count'];
protected $noNeedRight = '*'; protected $noNeedRight = '*';
protected $model = null; protected $model = null;
@ -127,5 +127,41 @@ class Message extends Base
} }
/**
* @ApiTitle( 设置一键已读)
* @ApiSummary(设置一键已读)
* @ApiMethod(GET)
* @ApiParams(name = "id", type = "string",required=false,description = "默认* 多值逗号拼接")
* @ApiParams(name = "event", type = "string",required=false,description = "要删的事件")
* @ApiParams(name = "status", type = "string",required=false,description = "消息总类型:system=系统消息,classes=课程消息,order=订单消息")
* @ApiParams(name = "mini_type", type = "string",required=false,description = "小消息类型:order_notice=课程订单通知,classes_auth=课程报名审核,classes_apply=课程上新审核,shop_apply=机构审核,classes_order_notice=课时预约,user_auth=机构授权用户信息,aftercare=售后服务,other=其他")
* @ApiReturn({
*
*})
*/
public function batch()
{
$user_id = 0;
$user = $this->auth->getUser();//登录用户
if($user)$user_id = $user['id'];
$id = $this->request->get('id/s', '*'); //条数
$event = $this->request->get('event/s', ''); //搜索关键字
$status = $this->request->get('status/s', ''); //搜索关键字
$mini_type = $this->request->get('mini_type/s', ''); //搜索关键字
try{
//当前申请状态
$res = $this->model::batchRead($id,$user_id,$status,$mini_type,$event,'user',$user_id,true);
}catch (\Exception $e){
$this->error($e->getMessage());
}
$this->success('操作成功');
}
} }

View File

@ -0,0 +1,236 @@
<?php
namespace app\api\controller\school;
use app\common\model\school\classes\order\ServiceOrder as OrderModel;
use app\common\model\school\classes\order\ServiceOrderLog;
/**
* 用户端:课程订单售后接口
*/
class ServiceOrder extends Base
{
protected $noNeedLogin = [];
protected $noNeedRight = '*';
protected $model = null;
/**
* 初始化操作
* @access protected
*/
protected function _initialize()
{
$this->model = new OrderModel;
parent::_initialize();
//判断登录用户是否是员工
}
/**
* @ApiTitle( 售后订单详情)
* @ApiSummary(售后订单详情)
* @ApiMethod(GET)
* @ApiParams(name = "id", type = "int",required=true,description = "售后订单id或售后订号")
* @ApiReturn({
*
*})
*/
public function detail(){
$id = $this->request->get('id/d','');
if(empty($id)){
$this->error(__('缺少必要参数'));
}
try {
$res = OrderModel::getDetail($id);
} catch (\Exception $e){
// Log::log($e->getMessage());
$this->error($e->getMessage(),['errcode'=>$e->getCode()]);
}
$this->success('获取成功', ['detail' => $res]);
}
/**
* @ApiTitle( 订单申请售后接口 )
* @ApiSummary(订单申请售后)
* @ApiMethod(POST)
* @ApiParams(name = "classes_order_id", type = "int",required=true,description = "需要售后的课程订单id")
* @ApiParams(name = "reason", type = "string",required=true,description = "申请理由")
* @ApiReturn({
*
*})
*/
public function create(){
$user_id = 0;
$user = $this->auth->getUser();//登录用户
if($user)$user_id = $user['id'];
$classes_order = $this->request->post('classes_order_id/d', 0); //课程id
$reason = $this->request->post('reason/s', ''); //订单号
try{
//当前申请状态
$res = $this->model->afterSales($classes_order,$reason,'','user',$user_id,true);
}catch (\Exception $e){
// Log::log($e->getMessage());
$this->error($e->getMessage(),['errcode'=>$e->getCode()]);
}
$this->success('申请售后成功', $res);
}
/**
* @ApiTitle( 售后申请取消接口)
* @ApiSummary(售后申请取消(处理中的无法再取消))
* @ApiMethod(POST)
* @ApiParams(name = "order_no", type = "string",required=true,description = "售后订单id或售后订号")
* @ApiReturn({
*
*})
*/
public function cancel(){
$user_id = 0;
$user = $this->auth->getUser();//登录用户
if($user)$user_id = $user['id'];
$order_no = $this->request->post('order_no/s', ''); //订单号
try{
//当前申请状态
$res = $this->model->cancel($order_no,$user_id,true,'user',0,true);
}catch (\Throwable $e){
$this->error($e->getMessage());
}
$this->success('售后申请取消成功', $res);
}
/**
* @ApiTitle( 我的售后订单列表接口)
* @ApiSummary(我的售后订单列表接口)
* @ApiMethod(GET)
* @ApiParams(name = "keywords", type = "string",required=false,description = "搜索关键字")
* @ApiParams(name = "page", type = "string",required=true,description = "页数")
* @ApiParams(name = "limit", type = "string",required=true,description = "条数")
* @ApiParams(name = "status", type = "string",required=false,description = "状态搜索条件:售后状态:1=待处理,4=处理中,7=已结单,-3=已取消")
* @ApiParams(name = "service_stauts", type = "string",required=false,description = "售后处理状态:1=待机构处理,4=待用户确认,7=售后通过结单,-3=售后驳回结单")
* @ApiParams(name = "sales_type", type = "string",required=false,description = "结单类型:-3=未结单,1=机构驳回,4=用户驳回,7=平台驳回,10=成功退款")
* @ApiParams(name = "classes_lib_id", type = "int",required=false,description = "课程id")
* @ApiParams(name = "classes_order_id", type = "int",required=false,description = "课程订单id")
* @ApiParams(name = "classes_order_detail_id", type = "int",required=false,description = "订单课程id")
* @ApiReturn({
*
*})
*/
public function order_list()
{
$user_id = 0;
$user = $this->auth->getUser();//登录用户
if($user)$user_id = $user['id'];
$page = $this->request->get('page/d', 0); //页数
$limit = $this->request->get('limit/d', 0); //条数
$keywords = $this->request->get('keywords/s', ''); //搜索关键字
$status = $this->request->get('status/s', ''); //搜索关键字
$service_stauts = $this->request->get('service_stauts/s', ''); //搜索关键字
$sales_type = $this->request->get('sales_type/s', ''); //搜索关键字
$classes_order_id = $this->request->get('classes_order_id/s', ''); //搜索关键字
$classes_order_detail_id = $this->request->get('classes_order_detail_id/s', ''); //搜索关键字
$classes_lib_id = $this->request->get('classes_lib_id/s', ''); //搜索关键字
// $type = $this->request->get('type/s', ''); //筛选学员和教练单
try{
//当前申请状态
$res = $this->model::allList($user_id,$page, $limit,$keywords,$status,$service_stauts,$sales_type,$classes_order_id,$classes_order_detail_id,$classes_lib_id);
// if($user_id =='670153'){
// file_put_contents("ceshi66.txt",(new AppointmentOrder())->getLastSql());
// }
}catch (\Exception $e){
$this->error($e->getMessage());
}
$this->success('查询成功', $res);
}
/**
* @ApiTitle( 我的售后订单数量接口)
* @ApiSummary(返回售后订单各个数量)
* @ApiMethod(GET)
* @ApiParams(name = "classes_lib_id", type = "int",required=false,description = "课程id")
* @ApiParams(name = "classes_order_id", type = "int",required=false,description = "课程订单id")
* @ApiReturn({
*
*})
*/
public function order_count(){
$user_id = 0;
$user = $this->auth->getUser();//登录用户
if($user)$user_id = $user['id'];
$classes_lib_id = $this->request->get('classes_lib_id/s', ''); //搜索关键字
$classes_order_id = $this->request->get('classes_order_id/s', '');
try{
$res = $this->model::orderCount($user_id,$classes_order_id,$classes_lib_id);
}catch (\Throwable $e){
$this->error($e->getMessage());
}
$this->success('查询成功', $res);
}
/**
* @ApiTitle( 我的售后订单记录列表接口)
* @ApiSummary(我的售后订单记录列表接口)
* @ApiMethod(GET)
* @ApiParams(name = "keywords", type = "string",required=false,description = "搜索关键字")
* @ApiParams(name = "page", type = "string",required=true,description = "页数")
* @ApiParams(name = "limit", type = "string",required=true,description = "条数")
* @ApiParams(name = "status", type = "string",required=false,description = "状态搜索条件:售后状态:1=待处理,4=处理中,7=已结单,-3=已取消")
* @ApiParams(name = "service_stauts", type = "string",required=false,description = "售后处理状态:1=待机构处理,4=待用户确认,7=售后通过结单,-3=售后驳回结单")
* @ApiParams(name = "sales_type", type = "string",required=false,description = "结单类型:-3=未结单,1=机构驳回,4=用户驳回,7=平台驳回,10=成功退款")
* @ApiParams(name = "classes_service_order_id", type = "int",required=false,description = "售后订单id")
* @ApiReturn({
*
*})
*/
public function order_log_list()
{
$user_id = 0;
$user = $this->auth->getUser();//登录用户
if($user)$user_id = $user['id'];
$page = $this->request->get('page/d', 0); //页数
$limit = $this->request->get('limit/d', 0); //条数
$keywords = $this->request->get('keywords/s', ''); //搜索关键字
$status = $this->request->get('status/s', ''); //搜索关键字
$service_stauts = $this->request->get('service_stauts/s', ''); //搜索关键字
$sales_type = $this->request->get('sales_type/s', ''); //搜索关键字
$classes_service_order_id = $this->request->get('classes_service_order_id/s', ''); //搜索关键字
// $type = $this->request->get('type/s', ''); //筛选学员和教练单
try{
//当前申请状态
$res = ServiceOrderLog::allList($user_id,$page, $limit,$keywords,$status,$service_stauts,$sales_type,$classes_service_order_id);
// if($user_id =='670153'){
// file_put_contents("ceshi66.txt",(new AppointmentOrder())->getLastSql());
// }
}catch (\Exception $e){
$this->error($e->getMessage());
}
$this->success('查询成功', $res);
}
}

View File

@ -9,7 +9,7 @@ use app\common\model\dyqc\ManystoreShop;
*/ */
class Shop extends Base class Shop extends Base
{ {
protected $noNeedLogin = ["detail",'people','spec','shop_list']; protected $noNeedLogin = ["detail",'people','spec','shop_list','auth_info'];
protected $noNeedRight = '*'; protected $noNeedRight = '*';
protected $model = null; protected $model = null;
@ -71,6 +71,10 @@ class Shop extends Base
* @ApiParams(name = "reverse_idcard_image", type = "string",required=true,description = "法人身份证反面") * @ApiParams(name = "reverse_idcard_image", type = "string",required=true,description = "法人身份证反面")
* @ApiParams(name = "images", type = "string",required=true,description = "机构环境照片(多个逗号拼接)") * @ApiParams(name = "images", type = "string",required=true,description = "机构环境照片(多个逗号拼接)")
* @ApiParams(name = "yyzz_images", type = "string",required=true,description = "营业执照照片(多个逗号拼接)") * @ApiParams(name = "yyzz_images", type = "string",required=true,description = "营业执照照片(多个逗号拼接)")
* @ApiParams(name = "address", type = "string",required=true,description = "店铺地址")
* @ApiParams(name = "address_detail", type = "string",required=true,description = "店铺详细地址")
* @ApiParams(name = "longitude", type = "string",required=true,description = "经度")
* @ApiParams(name = "latitude", type = "string",required=true,description = "纬度")
* @ApiReturn({ * @ApiReturn({
* *
*}) *})
@ -86,6 +90,13 @@ class Shop extends Base
$params["images"] = $this->request->post('images/s',''); $params["images"] = $this->request->post('images/s','');
$params["yyzz_images"] = $this->request->post('yyzz_images/s',''); $params["yyzz_images"] = $this->request->post('yyzz_images/s','');
$params["address"] = $this->request->post('address/s','');
$params["address_detail"] = $this->request->post('address_detail/s','');
$params["longitude"] = $this->request->post('longitude/s','');
$params["latitude"] = $this->request->post('latitude/s','');
// if(empty($id)){ // if(empty($id)){
// $this->error(__('缺少必要参数')); // $this->error(__('缺少必要参数'));
// } // }
@ -150,9 +161,11 @@ class Shop extends Base
* @ApiMethod(GET) * @ApiMethod(GET)
*/ */
public function auth_info(){ public function auth_info(){
$user_id = 0;
$user = $this->auth->getUser();//登录用户
if($user)$user_id = $user['id'];
try { try {
$res = ManystoreShop::getAuthInfo($this->auth->id); $res = ManystoreShop::getAuthInfo($user_id);
} catch (\Exception $e){ } catch (\Exception $e){
// Log::log($e->getMessage()); // Log::log($e->getMessage());
$this->error($e->getMessage(),['errcode'=>$e->getCode()]); $this->error($e->getMessage(),['errcode'=>$e->getCode()]);

View File

@ -121,7 +121,7 @@ class UserAuth extends Base
$status = $this->request->post('status/d', 0); //搜索关键字 $status = $this->request->post('status/d', 0); //搜索关键字
try{ try{
$res = UserAuth::auth($id,$shop_id,$user_id,$status,'user',$user_id,true); $res = $this->model::auth($id,$shop_id,$user_id,$status,'user',$user_id,true);
}catch (\Throwable $e){ }catch (\Throwable $e){
$this->error($e->getMessage()); $this->error($e->getMessage());
} }

View File

@ -269,6 +269,7 @@ class HourOrder extends Base
* @ApiParams(name = "classes_lib_id", type = "int",required=false,description = "课程id") * @ApiParams(name = "classes_lib_id", type = "int",required=false,description = "课程id")
* @ApiParams(name = "start_time", type = "string",required=false,description = "按开始时间区间查传值格式Y/m/d H:M:S-Y/m/d H:M:S") * @ApiParams(name = "start_time", type = "string",required=false,description = "按开始时间区间查传值格式Y/m/d H:M:S-Y/m/d H:M:S")
* @ApiParams(name = "createtime", type = "string",required=false,description = "按创建时间区间查传值格式Y/m/d H:M:S-Y/m/d H:M:S") * @ApiParams(name = "createtime", type = "string",required=false,description = "按创建时间区间查传值格式Y/m/d H:M:S-Y/m/d H:M:S")
* @ApiParams(name = "time", type = "string",required=false,description = "按开始和结束时间区间查传值格式Y/m/d H:M:S-Y/m/d H:M:S")
* @ApiReturn({ * @ApiReturn({
* *
*}) *})
@ -289,12 +290,13 @@ class HourOrder extends Base
$start_time = $this->request->get('start_time/s', ''); //搜索关键字 $start_time = $this->request->get('start_time/s', ''); //搜索关键字
$createtime = $this->request->get('createtime/s', ''); //搜索关键字 $createtime = $this->request->get('createtime/s', ''); //搜索关键字
$time = $this->request->get('time/s', ''); //搜索关键字
// $type = $this->request->get('type/s', ''); //筛选学员和教练单 // $type = $this->request->get('type/s', ''); //筛选学员和教练单
try{ try{
//当前申请状态 //当前申请状态
$res = $this->model::workList($page, $limit,$keywords,$status,$classes_order_id,0,$this->classes_lib_ids,$classes_lib_ids,$start_time,$createtime); $res = $this->model::workList($page, $limit,$keywords,$status,$classes_order_id,0,$this->classes_lib_ids,$classes_lib_ids,$start_time,$createtime,$time);
// var_dump($this->model->getLastSql());die; // var_dump($this->model->getLastSql());die;
// if($user_id =='670153'){ // if($user_id =='670153'){
// file_put_contents("ceshi66.txt",(new AppointmentOrder())->getLastSql()); // file_put_contents("ceshi66.txt",(new AppointmentOrder())->getLastSql());

View File

@ -0,0 +1,178 @@
<?php
namespace app\api\controller\school\worker;
use app\common\model\school\classes\order\ServiceOrder as OrderModel;
use app\common\model\school\classes\order\ServiceOrderLog;
/**
* 员工端:课程订单售后接口
*/
class ServiceOrder extends Base
{
protected $noNeedLogin = [];
protected $noNeedRight = '*';
protected $model = null;
/**
* 初始化操作
* @access protected
*/
protected function _initialize()
{
$this->model = new OrderModel;
parent::_initialize();
//判断登录用户是否是员工
}
/**
* @ApiTitle( 用户售后订单详情)
* @ApiSummary(用户售后订单详情)
* @ApiMethod(GET)
* @ApiParams(name = "id", type = "int",required=true,description = "售后订单id或售后订号")
* @ApiReturn({
*
*})
*/
public function detail(){
$id = $this->request->get('id/d','');
if(empty($id)){
$this->error(__('缺少必要参数'));
}
try {
$res = OrderModel::getDetail($id,$this->classes_lib_ids);
if(!$res)throw new \Exception('您无操作权限!',40003);
} catch (\Exception $e){
// Log::log($e->getMessage());
$this->error($e->getMessage(),['errcode'=>$e->getCode()]);
}
$this->success('获取成功', ['detail' => $res]);
}
/**
* @ApiTitle( 用户售后订单列表接口)
* @ApiSummary(用户售后订单列表接口)
* @ApiMethod(GET)
* @ApiParams(name = "keywords", type = "string",required=false,description = "搜索关键字")
* @ApiParams(name = "page", type = "string",required=true,description = "页数")
* @ApiParams(name = "limit", type = "string",required=true,description = "条数")
* @ApiParams(name = "status", type = "string",required=false,description = "状态搜索条件:售后状态:1=待处理,4=处理中,7=已结单,-3=已取消")
* @ApiParams(name = "service_stauts", type = "string",required=false,description = "售后处理状态:1=待机构处理,4=待用户确认,7=售后通过结单,-3=售后驳回结单")
* @ApiParams(name = "sales_type", type = "string",required=false,description = "结单类型:-3=未结单,1=机构驳回,4=用户驳回,7=平台驳回,10=成功退款")
* @ApiParams(name = "classes_lib_id", type = "int",required=false,description = "课程id")
* @ApiParams(name = "classes_order_id", type = "int",required=false,description = "课程订单id")
* @ApiParams(name = "classes_order_detail_id", type = "int",required=false,description = "订单课程id")
* @ApiReturn({
*
*})
*/
public function order_list()
{
$user_id = 0;
$user = $this->auth->getUser();//登录用户
if($user)$user_id = $user['id'];
$page = $this->request->get('page/d', 0); //页数
$limit = $this->request->get('limit/d', 0); //条数
$keywords = $this->request->get('keywords/s', ''); //搜索关键字
$status = $this->request->get('status/s', ''); //搜索关键字
$service_stauts = $this->request->get('service_stauts/s', ''); //搜索关键字
$sales_type = $this->request->get('sales_type/s', ''); //搜索关键字
$classes_order_id = $this->request->get('classes_order_id/s', ''); //搜索关键字
$classes_order_detail_id = $this->request->get('classes_order_detail_id/s', ''); //搜索关键字
$classes_lib_id = $this->request->get('classes_lib_id/s', ''); //搜索关键字
// $type = $this->request->get('type/s', ''); //筛选学员和教练单
try{
//当前申请状态
$res = $this->model::workList($page, $limit,$keywords,$status,$service_stauts,$sales_type,$classes_order_id,$classes_order_detail_id,$classes_lib_id,$this->classes_lib_ids);
// if($user_id =='670153'){
// file_put_contents("ceshi66.txt",(new AppointmentOrder())->getLastSql());
// }
}catch (\Exception $e){
$this->error($e->getMessage());
}
$this->success('查询成功', $res);
}
/**
* @ApiTitle( 用户售后订单数量接口)
* @ApiSummary(返回售后订单各个数量)
* @ApiMethod(GET)
* @ApiParams(name = "classes_lib_id", type = "int",required=false,description = "课程id")
* @ApiParams(name = "classes_order_id", type = "int",required=false,description = "课程订单id")
* @ApiReturn({
*
*})
*/
public function order_count(){
$user_id = 0;
$user = $this->auth->getUser();//登录用户
if($user)$user_id = $user['id'];
$classes_lib_id = $this->request->get('classes_lib_id/s', ''); //搜索关键字
$classes_order_id = $this->request->get('classes_order_id/s', '');
try{
$res = $this->model::workCount($classes_order_id,$classes_lib_id,$this->classes_lib_ids);
}catch (\Throwable $e){
$this->error($e->getMessage());
}
$this->success('查询成功', $res);
}
/**
* @ApiTitle( 售后订单记录列表接口)
* @ApiSummary(售后订单记录列表接口)
* @ApiMethod(GET)
* @ApiParams(name = "keywords", type = "string",required=false,description = "搜索关键字")
* @ApiParams(name = "page", type = "string",required=true,description = "页数")
* @ApiParams(name = "limit", type = "string",required=true,description = "条数")
* @ApiParams(name = "status", type = "string",required=false,description = "状态搜索条件:售后状态:1=待处理,4=处理中,7=已结单,-3=已取消")
* @ApiParams(name = "service_stauts", type = "string",required=false,description = "售后处理状态:1=待机构处理,4=待用户确认,7=售后通过结单,-3=售后驳回结单")
* @ApiParams(name = "sales_type", type = "string",required=false,description = "结单类型:-3=未结单,1=机构驳回,4=用户驳回,7=平台驳回,10=成功退款")
* @ApiParams(name = "classes_service_order_id", type = "int",required=false,description = "售后订单id")
* @ApiReturn({
*
*})
*/
public function order_log_list()
{
$user_id = 0;
$user = $this->auth->getUser();//登录用户
if($user)$user_id = $user['id'];
$page = $this->request->get('page/d', 0); //页数
$limit = $this->request->get('limit/d', 0); //条数
$keywords = $this->request->get('keywords/s', ''); //搜索关键字
$status = $this->request->get('status/s', ''); //搜索关键字
$service_stauts = $this->request->get('service_stauts/s', ''); //搜索关键字
$sales_type = $this->request->get('sales_type/s', ''); //搜索关键字
$classes_service_order_id = $this->request->get('classes_service_order_id/s', ''); //搜索关键字
// $type = $this->request->get('type/s', ''); //筛选学员和教练单
try{
//当前申请状态
$res = ServiceOrderLog::workList($page, $limit,$keywords,$status,$service_stauts,$sales_type,$classes_service_order_id,$this->classes_lib_ids);
// if($user_id =='670153'){
// file_put_contents("ceshi66.txt",(new AppointmentOrder())->getLastSql());
// }
}catch (\Exception $e){
$this->error($e->getMessage());
}
$this->success('查询成功', $res);
}
}

View File

@ -578,3 +578,34 @@ if (!function_exists('getDistanceBuilder')) {
return "ROUND(6378.138 * 2 * ASIN(SQRT(POW(SIN((". matchLatLng($lat) . " * PI() / 180 - latitude * PI() / 180) / 2), 2) + COS(". matchLatLng($lat). " * PI() / 180) * COS(latitude * PI() / 180) * POW(SIN((". matchLatLng($lng). " * PI() / 180 - longitude * PI() / 180) / 2), 2))) * 1000) AS distance"; return "ROUND(6378.138 * 2 * ASIN(SQRT(POW(SIN((". matchLatLng($lat) . " * PI() / 180 - latitude * PI() / 180) / 2), 2) + COS(". matchLatLng($lat). " * PI() / 180) * COS(latitude * PI() / 180) * POW(SIN((". matchLatLng($lng). " * PI() / 180 - longitude * PI() / 180) / 2), 2))) * 1000) AS distance";
} }
} }
/**
* 后端防抖
*/
if (!function_exists('repeat_filter')) {
function repeat_filter($key = null, $expire = 5)
{
if (!$key) {
$url = request()->baseUrl();
$ip = request()->ip();
$key = md5($url . ':' . $ip);
}
$hasRedis = config('redis');
if ($hasRedis) {
$redis = (new \bw\Redis())->getRedis();
if ($redis->exists($key)) {
throw new \bw\UrlLockException("请等待{$expire}秒再操作");
}
$redis->setex($key, $expire, time()); // 缓存 五秒
} else {
if (cache('?' . $key)) {
throw new \bw\UrlLockException("请等待{$expire}秒再操作");
}
cache($key, time(), $expire);
}
}
}

View File

@ -3,6 +3,7 @@
namespace app\common\controller; namespace app\common\controller;
use app\common\library\Auth; use app\common\library\Auth;
use app\common\library\Virtual;
use think\Config; use think\Config;
use think\exception\HttpResponseException; use think\exception\HttpResponseException;
use think\exception\ValidateException; use think\exception\ValidateException;
@ -144,6 +145,7 @@ class Api
// 加载当前控制器语言包 // 加载当前控制器语言包
$this->loadlang($controllername); $this->loadlang($controllername);
Virtual::visitNnmberUpdate();
} }
/** /**

View File

@ -94,6 +94,17 @@ $classesHooks = [
'classes_auth_fail_after' => [ // 课程审核失败后 'classes_auth_fail_after' => [ // 课程审核失败后
'app\\common\\listener\\classes\\ClassesHook' 'app\\common\\listener\\classes\\ClassesHook'
], ],
'classes_view_after' => [ // 课程触发浏览后
'app\\common\\listener\\classes\\ClassesHook'
],
'classes_collect_success_after' => [ // 课程收藏后
'app\\common\\listener\\classes\\ClassesHook'
],
'classes_collect_cancel_after' => [ // 课程取消收藏后
'app\\common\\listener\\classes\\ClassesHook'
],
]; ];
@ -112,6 +123,19 @@ $userHooks = [
]; ];
//售后事件钩子
$serviceHooks = [
// 订单创建
'classes_serviceorder_create_after' => [ // 售后单创建后
'app\\common\\listener\\serviceorder\\OrderHook'
],
'classes_serviceorder_cancel_after' => [ // 订单取消后
'app\\common\\listener\\serviceorder\\OrderHook'
],
];
// //
//if (file_exists(ROOT_PATH . 'addons/shopro/listener/commission')) { //if (file_exists(ROOT_PATH . 'addons/shopro/listener/commission')) {
@ -121,5 +145,6 @@ $defaultHooks = array_merge_recursive($defaultHooks, $hourHooks);
$defaultHooks = array_merge_recursive($defaultHooks, $manystoreHooks); $defaultHooks = array_merge_recursive($defaultHooks, $manystoreHooks);
$defaultHooks = array_merge_recursive($defaultHooks, $classesHooks); $defaultHooks = array_merge_recursive($defaultHooks, $classesHooks);
$defaultHooks = array_merge_recursive($defaultHooks, $userHooks); $defaultHooks = array_merge_recursive($defaultHooks, $userHooks);
$defaultHooks = array_merge_recursive($defaultHooks, $serviceHooks);
return $defaultHooks; return $defaultHooks;

View File

@ -104,4 +104,23 @@ class Virtual
} }
public static function visitNnmberUpdate(){
$key = "night_school_total_visit";
$redis = (new \bw\Redis())->getRedis();
if (!$redis->exists($key)) {
$redis->set($key, 0); // 缓存 五秒
}
// 进行累加
return $redis->incr($key);
}
public static function getVisitNnmber(){
$key = "night_school_total_visit";
$redis = (new \bw\Redis())->getRedis();
return $redis->get($key);
}
} }

View File

@ -90,4 +90,23 @@ class ClassesHook
} }
public function classesViewAfter(&$params)
{
['classes' => $classes,"user_id"=>$user_id,"oper_type"=>$oper_type,"oper_id"=>$oper_id] = $params;
}
public function classesCollectSuccessAfter(&$params)
{
['classes' => $classes,"user_id"=>$user_id,"oper_type"=>$oper_type,"oper_id"=>$oper_id] = $params;
}
public function classesCollectCancelAfter(&$params)
{
['classes' => $classes,"user_id"=>$user_id,"oper_type"=>$oper_type,"oper_id"=>$oper_id] = $params;
}
} }

View File

@ -33,6 +33,7 @@ class OrderHook
"event"=>"classes_order_create_after", "event"=>"classes_order_create_after",
"order_id"=>$order["id"], "order_id"=>$order["id"],
"order_no"=>$order["order_no"], "order_no"=>$order["order_no"],
"classes_lib_id"=>$order["classes_lib_id"],
]; ];
Message::$event_name = $params["event"]; Message::$event_name = $params["event"];
Message::send($title,$desc,$mini_type,$to_id,$to_type,$status,$platform,$params,$oper_id,$oper_type); Message::send($title,$desc,$mini_type,$to_id,$to_type,$status,$platform,$params,$oper_id,$oper_type);

View File

@ -2,6 +2,7 @@
namespace app\common\listener\manystore; namespace app\common\listener\manystore;
use app\common\model\school\classes\ClassesLib; use app\common\model\school\classes\ClassesLib;
use app\common\model\school\Message; use app\common\model\school\Message;
use app\manystore\model\Manystore;
class ShopHook class ShopHook
{ {
@ -82,11 +83,12 @@ class ShopHook
{ {
['shop' => $shop,"password"=>$password] = $params; ['shop' => $shop,"password"=>$password] = $params;
$user = $shop->user; $user = $shop->user;
$manystore = Manystore::where("shop_id",$shop["id"])->find();
$mobile = $user['mobile'] ?? ""; $mobile = $user['mobile'] ?? "";
$shop_backend_url = config("site.shop_backend_ur"); $shop_backend_url = config("site.shop_backend_url");
$desc = "您申请的认证:{$shop['name']}已审核通过,您可登录官方后台补充完其余资料,并开始发布课程<br> $desc = "您申请的认证:{$shop['name']}已审核通过,您可登录官方后台补充完其余资料,并开始发布课程<br>
后台地址是: {$shop_backend_url}<br> 后台地址是: {$shop_backend_url}<br>
账号是: {$shop['username']} 您的手机号 {$mobile}<br> 账号是: 您的手机号 {$mobile}<br>
初始化密码是: {$password}<br> 初始化密码是: {$password}<br>
"; ";
@ -99,9 +101,12 @@ class ShopHook
$oper_id=0; $oper_id=0;
$oper_type="system"; $oper_type="system";
$params=[ $params=[
"event"=>"shop_auth_success_after", "event"=>"shop_auth_success_after",
"shop_id"=>$shop["id"], "shop_id"=>$shop["id"],
"desc"=>$shop["desc"], "desc"=>$shop["desc"],
"username"=>$manystore["username"],
"mobile"=>$mobile,
"password"=>$password,
]; ];
Message::$event_name = $params["event"]; Message::$event_name = $params["event"];
Message::send($title,$desc,$mini_type,$to_id,$to_type,$status,$platform,$params,$oper_id,$oper_type); Message::send($title,$desc,$mini_type,$to_id,$to_type,$status,$platform,$params,$oper_id,$oper_type);

View File

@ -0,0 +1,75 @@
<?php
namespace app\common\listener\serviceorder;
use app\common\model\school\Message;
class OrderHook
{
// 订单创建成功后
public function classesServiceorderCreateAfter(&$params)
{
['serviceorder' => $serverorder,"oper_type"=>$oper_type,"oper_id"=>$oper_id] = $params;
$detail = $serverorder->detail;
//记录订单日志
$desc = "课程{$detail["title"]}订单已申请售后,等待机构处理";
$title = "课程订单已提交售后";
$mini_type = "aftercare";
$to_type="user";
$to_id = $serverorder["user_id"];
$status ="classes";
$platform="user";
$oper_id=0;
$oper_type="system";
$params=[
"event"=>"classes_serviceorder_create_after",
"order_id"=>$serverorder["id"],
"classes_order_id"=>$serverorder["classes_order_id"],
"order_no"=>$serverorder["order_no"],
];
Message::$event_name = $params["event"];
Message::send($title,$desc,$mini_type,$to_id,$to_type,$status,$platform,$params,$oper_id,$oper_type);
}
// 订单取消成功后
public function classesServiceorderCancelAfter(&$params)
{
['serviceorder' => $serviceorder,"user_id"=>$user_id,"oper_type"=>$oper_type,"oper_id"=>$oper_id] = $params;
$detail = $serviceorder->detail;
//记录订单日志
$desc = "课程{$detail["title"]}订单已取消售后,订单恢复原状态";
$title = "课程订单已取消售后";
$mini_type = "aftercare";
$to_type="user";
$to_id = $serviceorder["user_id"];
$status ="classes";
$platform="user";
$oper_id=0;
$oper_type="system";
$params=[
"event"=>"classes_serviceorder_cancel_after",
"order_id"=>$serviceorder["id"],
"classes_order_id"=>$serviceorder["classes_order_id"],
"order_no"=>$serviceorder["order_no"],
];
Message::$event_name = $params["event"];
Message::send($title,$desc,$mini_type,$to_id,$to_type,$status,$platform,$params,$oper_id,$oper_type);
}
}

View File

@ -1,6 +1,8 @@
<?php <?php
namespace app\common\listener\user; namespace app\common\listener\user;
use app\common\model\school\classes\Verification;
use app\common\model\school\Message; use app\common\model\school\Message;
use app\manystore\model\Manystore;
class UserHook class UserHook
{ {
@ -10,23 +12,24 @@ class UserHook
public function userAuthNeedAfter(&$params) public function userAuthNeedAfter(&$params)
{ {
['user_auth' => $user_auth,"oper_type"=>$oper_type,"oper_id"=>$oper_id] = $params; ['user_auth' => $user_auth,"oper_type"=>$oper_type,"oper_id"=>$oper_id] = $params;
$shop = $user_auth->shop;
// //课程推送给老师 // //课程推送给老师
// $desc = "您的新课程{$classes['title']}已审核通过,可以在后台操作课程上架!"; $desc = "机构{$shop['name']}已发起授权申请,请确实是否同意!";
//
// $title = "新课程审核成功"; $title = "机构授权申请待确认";
// $mini_type = "classes_apply"; $mini_type = "user_auth";
// $to_type="user"; $to_type="user";
// $to_id = $classes["user_id"]; $to_id = $user_auth["user_id"];
// $status ="classes"; $status ="system";
// $platform="user"; $platform="user";
// $oper_id=0; $oper_id=0;
// $oper_type="system"; $oper_type="system";
// $params=[ $params=[
// "event"=>"classes_auth_success_after", "event"=>"user_auth_need_after",
// "classes_lib_id"=>$classes["id"], "shop_id"=>$user_auth["shop_id"],
// ]; ];
// Message::send($title,$desc,$mini_type,$to_id,$to_type,$status,$platform,$params,$oper_id,$oper_type); Message::$event_name = $params["event"];
Message::send($title,$desc,$mini_type,$to_id,$to_type,$status,$platform,$params,$oper_id,$oper_type);
} }
@ -36,22 +39,40 @@ class UserHook
{ {
['user_auth' => $user_auth,"oper_type"=>$oper_type,"oper_id"=>$oper_id] = $params; ['user_auth' => $user_auth,"oper_type"=>$oper_type,"oper_id"=>$oper_id] = $params;
$shop = $user_auth->shop;
// //课程推送给老师 // //课程推送给老师
// $desc = "您的新课程{$classes['title']}已审核通过,可以在后台操作课程上架!"; $desc = "您已同意机构{$shop['name']}发起的授权申请。";
//
// $title = "新课程审核成功"; $title = "机构授权已确认";
// $mini_type = "classes_apply"; $mini_type = "user_auth";
// $to_type="user"; $to_type="user";
// $to_id = $classes["user_id"]; $to_id = $user_auth["user_id"];
// $status ="classes"; $status ="system";
// $platform="user"; $platform="user";
// $oper_id=0; $oper_id=0;
// $oper_type="system"; $oper_type="system";
// $params=[ $params=[
// "event"=>"classes_auth_success_after", "event"=>"user_auth_success_after",
// "classes_lib_id"=>$classes["id"], "shop_id"=>$user_auth["shop_id"],
// ]; ];
// Message::send($title,$desc,$mini_type,$to_id,$to_type,$status,$platform,$params,$oper_id,$oper_type); Message::$event_name = $params["event"];
Message::send($title,$desc,$mini_type,$to_id,$to_type,$status,$platform,$params,$oper_id,$oper_type);
$manystore = Manystore::where("shop_id",$user_auth["shop_id"])->find();
if($manystore){
//加入核销员
$verification = Verification::where("user_id",$user_auth["user_id"])
->where("shop_id",$user_auth["shop_id"])
->where("manystore_id",$manystore["id"])->find();
if(!$verification){
Verification::create([
"user_id"=>$user_auth["user_id"],
"shop_id"=>$user_auth["shop_id"],
"manystore_id"=>$manystore["id"],
"status"=>'2',
"classes_lib_ids"=>"",
]);
}
}
} }
@ -60,24 +81,24 @@ class UserHook
{ {
['user_auth' => $user_auth,"oper_type"=>$oper_type,"oper_id"=>$oper_id] = $params; ['user_auth' => $user_auth,"oper_type"=>$oper_type,"oper_id"=>$oper_id] = $params;
// $shop = $user_auth->shop;
// //课程推送给老师 // //课程推送给老师
// $desc = "您的新课程{$classes['title']}审核未通过,未通过原因为:{$classes['reason']},整改后,可以在后台重新提交!"; $desc = "您已拒绝机构{$shop['name']}发起的授权申请。";
//
// $title = "新课程审核不通过";
// $mini_type = "classes_apply";
// $to_type="user";
// $to_id = $classes["user_id"];
// $status ="classes";
// $platform="user";
// $oper_id=0;
// $oper_type="system";
// $params=[
// "event"=>"classes_auth_success_after",
// "classes_lib_id"=>$classes["id"],
// ];
// Message::send($title,$desc,$mini_type,$to_id,$to_type,$status,$platform,$params,$oper_id,$oper_type);
$title = "机构授权已拒绝";
$mini_type = "user_auth";
$to_type="user";
$to_id = $user_auth["user_id"];
$status ="system";
$platform="user";
$oper_id=0;
$oper_type="system";
$params=[
"event"=>"user_auth_fail_after",
"shop_id"=>$user_auth["shop_id"],
];
Message::$event_name = $params["event"];
Message::send($title,$desc,$mini_type,$to_id,$to_type,$status,$platform,$params,$oper_id,$oper_type);

View File

@ -70,7 +70,7 @@ class User extends BaseModel
public function getVerificationAttr($value, $data) public function getVerificationAttr($value, $data)
{ {
$value = array_filter((array)json_decode($value, true)); $value = array_filter((array)json_decode($value, true));
$value = array_merge(['email' => 0, 'mobile' => 0, 'mini_wechat' => 0], $value); $value = array_merge(['email' => 0, 'mobile' => 0, 'wechat_miniapp' => 0], $value);
return (object)$value; return (object)$value;
} }

View File

@ -294,9 +294,20 @@ class ManystoreShop extends BaseModel
'reverse_idcard_image' => 'require', 'reverse_idcard_image' => 'require',
'images' => 'require', 'images' => 'require',
'yyzz_images' => 'require', 'yyzz_images' => 'require',
'address' => 'require',
'address_detail' => 'require',
'longitude' => 'require',
'latitude' => 'require',
]; ];
$rule_msg = [ $rule_msg = [
'address.require' => '机构地址必填',
'address_detail.require' => '机构详细地址必填',
'longitude.require' => '经度必填',
'latitude.require' => '纬度必填',
'name.require' => '机构名称必须填写', 'name.require' => '机构名称必须填写',
'tel.require' => '服务电话必须填写', 'tel.require' => '服务电话必须填写',
'tel.number' => '服务电话必须是数字', 'tel.number' => '服务电话必须是数字',
@ -331,7 +342,14 @@ class ManystoreShop extends BaseModel
if(!$shop){ if(!$shop){
//创建申请单 //创建申请单
$shop = $this->creatShop($type,$user_id,$params); $shop = $this->creatShop($type,$user_id,$params);
}else{
//商家表单更新
$shop_info = $shop->allowField(true)->save($params);
if($shop_info === false){
throw new \Exception($shop->getError());
}
} }
$shop = ManystoreShop::where( 'user_id',$user_id)->find();
//更新申请单状态为审核中 //更新申请单状态为审核中
$shop['status']= '0'; $shop['status']= '0';
//清空审核时间 //清空审核时间
@ -501,6 +519,9 @@ public static function getAuthInfo($user_id){
$shop_id = 0; $shop_id = 0;
$type = '1'; $type = '1';
$reason =""; //失败原因 $reason =""; //失败原因
$apply_info = null;
if(!$user_id)return compact('auth_status','shop_id','reason','apply_info',"type");
//得到申请单 //得到申请单
$apply_info = self::where("user_id",$user_id)->where("status","1")->find(); $apply_info = self::where("user_id",$user_id)->where("status","1")->find();
if(!$apply_info)$apply_info = self::where("user_id",$user_id)->find(); if(!$apply_info)$apply_info = self::where("user_id",$user_id)->find();

View File

@ -31,8 +31,18 @@ class Message extends BaseModel
'to_type_text', 'to_type_text',
'status_text', 'status_text',
'mini_type_text', 'mini_type_text',
"type_text" "type_text",
'createtime_text',
]; ];
public function getCreatetimeTextAttr($value, $data)
{
$value = $value ? $value : (isset($data['createtime']) ? $data['createtime'] : '');
return is_numeric($value) ? date("Y.m.d|H:i", $value) : $value;
}
public function getTypeList() public function getTypeList()
{ {
return ['1' => __('Type 1'), '2' => __('Type 2')]; return ['1' => __('Type 1'), '2' => __('Type 2')];
@ -260,7 +270,7 @@ class Message extends BaseModel
if (isset($whereData['not_status'])) $model = $model->where("{$alisa}status", 'not in', $whereData['not_status']); if (isset($whereData['not_status'])) $model = $model->where("{$alisa}status", 'not in', $whereData['not_status']);
if (isset($whereData['keywords'])&&$whereData['keywords']) $model = $model->where("{$alisa}id|{$alisa}title|{$alisa}desc", '=', $whereData['keywords']); if (isset($whereData['keywords'])&&$whereData['keywords']) $model = $model->where("{$alisa}id|{$alisa}title|{$alisa}desc", '=', $whereData['keywords']);
if (isset($whereData['time'])&&$whereData['time']){ if (isset($whereData['time'])&&$whereData['time']){
$model = $model->time(['createtime',$whereData['time']]); $model = $model->time(["{$alisa}createtime",$whereData['time']]);
} }
if (isset($whereData['user_id']) && $whereData['user_id']) $model = $model->where("{$alisa}to_id", '=', $whereData['user_id']); if (isset($whereData['user_id']) && $whereData['user_id']) $model = $model->where("{$alisa}to_id", '=', $whereData['user_id']);
@ -300,7 +310,18 @@ class Message extends BaseModel
$unread_classes_number = self::getBaseWhere(array_merge(['status'=>'classes'],$where))->count(); $unread_classes_number = self::getBaseWhere(array_merge(['status'=>'classes'],$where))->count();
$unread_order_number = self::getBaseWhere(array_merge(['status'=>'order'],$where))->count(); $unread_order_number = self::getBaseWhere(array_merge(['status'=>'order'],$where))->count();
return compact('unread_number','unread_system_number','unread_classes_number','unread_order_number');
$where["type"] = '2';
$read_number = self::getBaseWhere($where)->count();
$read_system_number = self::getBaseWhere(array_merge(['status'=>'system'],$where))->count();
$read_classes_number = self::getBaseWhere(array_merge(['status'=>'classes'],$where))->count();
$read_order_number = self::getBaseWhere(array_merge(['status'=>'order'],$where))->count();
return compact('unread_number','unread_system_number','unread_classes_number','unread_order_number',
'read_number','read_system_number','read_classes_number','read_order_number');
} }
@ -310,6 +331,29 @@ class Message extends BaseModel
* @return array * @return array
*/ */
public static function messageCount($user_id = 0){ public static function messageCount($user_id = 0){
if(!$user_id){
$unread_number = 0;
$unread_system_number = 0;
$unread_classes_number = 0;
$unread_order_number = 0;
$read_number = 0;
$read_system_number = 0;
$read_classes_number = 0;
$read_order_number = 0;
return compact('unread_number',
'unread_system_number',
'unread_classes_number',
'unread_order_number',
'read_number',
'read_system_number',
'read_classes_number',
'read_order_number'
);
}
return self::baseCount(['user_id'=>$user_id]); return self::baseCount(['user_id'=>$user_id]);
} }
@ -336,4 +380,55 @@ class Message extends BaseModel
/**设置一键已读
* @param $id
* @param int $user_id
* @param bool $check
* @param bool $trans
* @throws \Exception
*/
public static function batchRead($id,$user_id,$status=null,$mini_type=null,$event=null,$oper_type='user',$oper_id=0,$trans=false){
//匹配已读查询条件
$model = self::where("to_id",$user_id);
if($status)$model = $model->where("status","in","".$status);
if($mini_type)$model = $model->where("mini_type","in","".$mini_type);
if($event)$model = $model->where("event","in","".$event);
if($id && $id!="*")$model = $model->where("id","in","".$id);
//判断逻辑
if($trans){
self::beginTrans();
}
try{
//事务逻辑
$ids = $model->column("id");
//$ids逗号拼接
$ids = implode(",",$ids);
//合并成数组
$update_data = ['type'=>'2'];
self::where("id","in",$ids)->update($update_data);
//调用事件
// $data = ['classes' => $classes_lib,"user_id"=>$user_id,"oper_type"=>$oper_type,"oper_id"=>$oper_id];
// \think\Hook::listen('classes_view_after', $data);
if($trans){
self::commitTrans();
}
}catch (\Exception $e){
if($trans){
self::rollbackTrans();
}
throw new \Exception($e->getMessage());
}
return true;
}
} }

View File

@ -325,7 +325,7 @@ class ClassesLib extends BaseModel
* @return ClassesLib|null * @return ClassesLib|null
* @throws \think\exception\DbException * @throws \think\exception\DbException
*/ */
public function detail($id,$user_id=0){ public function detail($id,$user_id=0,$oper_type='user',$trans=false){
$self = $this->get($id,['shop','teacher']); $self = $this->get($id,['shop','teacher']);
//是否收藏 //是否收藏
@ -345,11 +345,29 @@ class ClassesLib extends BaseModel
//有用户进来,参与人数+1 //有用户进来,参与人数+1
if(!$self['have_buy'])$self['virtual_people'] = $self['virtual_people'] + 1; if(!$self['have_buy'])$self['virtual_people'] = $self['virtual_people'] + 1;
} }
$cate_list = Cate::where("status",'1')->column("name","id");
$label_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 = [];
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];
}
$self['classes_label'] = $classes_label;
$self['classes_cate'] = $classes_cate;
//下架判断 //下架判断
// if($self['status'] != '1'){ // if($self['status'] != '1'){
// $this->error("该课程已下架"); // $this->error("该课程已下架");
// } // }
// //
$this->setViews($id,$user_id,$oper_type,$user_id,$trans);
//参与人数 = 虚拟人数 + 平台人数 //参与人数 = 虚拟人数 + 平台人数
@ -357,6 +375,47 @@ class ClassesLib extends BaseModel
} }
/**设置浏览量
* @param $id
* @param int $user_id
* @param bool $check
* @param bool $trans
* @throws \Exception
*/
public function setViews($id,$user_id,$oper_type='user',$oper_id=0,$trans=false){
$classes_lib = self::where("id",$id)->find();
if(!$classes_lib)throw new \Exception("找不到课程!");
//判断逻辑
if($trans){
self::beginTrans();
}
try{
//事务逻辑
$classes_lib->views = $classes_lib->views + 1;
//查询是否已收藏
$classes_lib->save();
//调用事件
$data = ['classes' => $classes_lib,"user_id"=>$user_id,"oper_type"=>$oper_type,"oper_id"=>$oper_id];
\think\Hook::listen('classes_view_after', $data);
if($trans){
self::commitTrans();
}
}catch (\Exception $e){
if($trans){
self::rollbackTrans();
}
throw new \Exception($e->getMessage());
}
return $classes_lib;
}
/**课程参与人员信息 /**课程参与人员信息
* @param $id * @param $id
* *
@ -495,10 +554,17 @@ $user_unpaid_order = $user_paid_order =null;
* @param $id * @param $id
* *
*/ */
public function spec($id){ public function spec($id,$user_id=0){
//课程规格 //课程规格
$spec_data = ClassesSpec::where("classes_lib_id",$id)->where("status",'1')->order("weigh desc")->select(); $spec_data = ClassesSpec::where("classes_lib_id",$id)->where("status",'1')->order("weigh desc")->select();
foreach ($spec_data as &$spec){
//默认未下单预约
$spec["user_reservation"] = null;
if($user_id){
$spec["user_reservation"] = \app\common\model\school\classes\hourorder\Order::where("classes_lib_id",$id)->where("classes_lib_spec_id",$spec['id'])->where("user_id",$user_id)->where("status","in",["0",'-1'])->find();
}
}
return $spec_data; return $spec_data;
} }
@ -510,7 +576,14 @@ $user_unpaid_order = $user_paid_order =null;
* @throws \think\exception\DbException * @throws \think\exception\DbException
*/ */
public function getClassesAuthIds($user_id){ public function getClassesAuthIds($user_id){
$classes_lib_ids = Verification::where("user_id",$user_id)->where("status",'1')->column("classes_lib_ids"); // $classes_lib_ids = Verification::where("user_id",$user_id)->where("status",'1')->column("classes_lib_ids");
//核销员有核销全部课程权力
$classes_lib_ids = [];
$shop_id = Verification::where("user_id",$user_id)->where("status",'1')->value("shop_id");
if($shop_id){
$classes_libids = ClassesLib::where("shop_id",$shop_id)->column("id");
if($classes_libids)$classes_lib_ids[] = implode(",", $classes_libids);
}
if($classes_lib_ids){ if($classes_lib_ids){
//遍历课程ids //遍历课程ids
foreach ($classes_lib_ids as $classes_lib_id){ foreach ($classes_lib_ids as $classes_lib_id){
@ -545,7 +618,8 @@ $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");
// 查询自提点 // 查询自提点
@ -706,8 +780,12 @@ $user_unpaid_order = $user_paid_order =null;
case "sale": //銷量优先 case "sale": //銷量优先
$selfetch = $selfetch->order("{$a}sale desc,{$a}verification_num desc,{$a}sign_num desc,{$a}recommend desc,{$a}weigh desc"); $selfetch = $selfetch->order("{$a}sale desc,{$a}verification_num desc,{$a}sign_num desc,{$a}recommend desc,{$a}weigh desc");
break; break;
case "views": //浏览量优先
$selfetch = $selfetch->order("{$a}views desc,{$a}recommend desc,{$a}weigh desc,{$a}verification_num desc,{$a}sale desc");
break;
case "collect": //收藏量优先
$selfetch = $selfetch->order("{$a}collect desc,{$a}recommend desc,{$a}weigh desc,{$a}verification_num desc,{$a}sale desc");
break;
default: default:
throw new \Exception("不支持的排序类型"); throw new \Exception("不支持的排序类型");
} }
@ -729,6 +807,17 @@ $user_unpaid_order = $user_paid_order =null;
if($row->is_collect){ if($row->is_collect){
$row["collect"] = Collect::where("user_id",$my_user_id)->find(); $row["collect"] = Collect::where("user_id",$my_user_id)->find();
} }
$classes_label_ids = $row['classes_label_ids'];
$classes_cate_ids = $row['classes_cate_ids'];
$classes_label = $classes_cate = [];
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];
}
$row['classes_label'] = $classes_label;
$row['classes_cate'] = $classes_cate;
} }
@ -748,16 +837,19 @@ $user_unpaid_order = $user_paid_order =null;
//如果课程虚拟参与者字段 数量小于 虚拟参与者实际数量 ,则等于虚拟参与者实际数量 //如果课程虚拟参与者字段 数量小于 虚拟参与者实际数量 ,则等于虚拟参与者实际数量
$classes_lib->virtual_people = $classes_lib->virtual_people < $virtual_people ? $virtual_people : $classes_lib->virtual_people; $classes_lib->virtual_people = $classes_lib->virtual_people < $virtual_people ? $virtual_people : $classes_lib->virtual_people;
//得到课程所有虚拟报名者数量 // //得到课程所有虚拟报名者数量
$virtual_num = VirtualUser::where("havetype",'1')->where("classes_lib_id",$classes_lib_id)->count(); // $virtual_num = VirtualUser::where("havetype",'1')->where("classes_lib_id",$classes_lib_id)->count();
//如果课程虚拟报名者字段 数量小于 虚拟报名者实际数量 ,则等于虚拟报名者实际数量 havetype // //如果课程虚拟报名者字段 数量小于 虚拟报名者实际数量 ,则等于虚拟报名者实际数量 havetype
$classes_lib->virtual_num = $classes_lib->virtual_num < $virtual_num ? $virtual_num : $classes_lib->virtual_num; // $classes_lib->virtual_num = $classes_lib->virtual_num < $virtual_num ? $virtual_num : $classes_lib->virtual_num;
//更新课程信息开始和结束时间信息 //更新课程信息开始和结束时间信息
//课程开始和结束时间等于所有课时的最早开始和最晚结束时间 //课程开始和结束时间等于所有课时的最早开始和最晚结束时间
$classes_lib->start_time = ClassesSpec::where("classes_lib_id",$classes_lib_id)->min("start_time"); $classes_lib->start_time = ClassesSpec::where("classes_lib_id",$classes_lib_id)->min("start_time");
$classes_lib->end_time = ClassesSpec::where("classes_lib_id",$classes_lib_id)->max("end_time"); $classes_lib->end_time = ClassesSpec::where("classes_lib_id",$classes_lib_id)->max("end_time");
//设置课程收藏
$classes_lib->collect = Collect::where("classes_lib_id",$classes_lib_id)->count();
$classes_lib->save(); $classes_lib->save();
//将课程信息和课时信息同步到所有已下单的订单信息中 //将课程信息和课时信息同步到所有已下单的订单信息中
@ -847,11 +939,24 @@ $user_unpaid_order = $user_paid_order =null;
$res1 = new Collect(); $res1 = new Collect();
$res1->allowField(true)->save($where); $res1->allowField(true)->save($where);
} }
\app\common\model\school\classes\ClassesLib::update_classes($classes_lib["id"]);
//调用事件
$data = ['classes' => $classes_lib,"user_id"=>$user_id,"oper_type"=>$oper_type,"oper_id"=>$oper_id];
\think\Hook::listen('classes_collect_success_after', $data);
}else{ }else{
//取消收藏 //取消收藏
$res1 = Collect::where($where)->delete(); $res1 = Collect::where($where)->delete();
\app\common\model\school\classes\ClassesLib::update_classes($classes_lib["id"]);
//调用事件
$data = ['classes' => $classes_lib,"user_id"=>$user_id,"oper_type"=>$oper_type,"oper_id"=>$oper_id];
\think\Hook::listen('classes_collect_cancel_after', $data);
} }
if($trans){ if($trans){
self::commitTrans(); self::commitTrans();
} }
@ -877,7 +982,7 @@ $user_unpaid_order = $user_paid_order =null;
// 课程存在未完成订单则不允许操作 // 课程存在未完成订单则不允许操作
$order = Order::where("classes_lib_id",$id)->where("status","in","0,3")->find(); $order = Order::where("classes_lib_id",$id)->where("status","in","0,3")->find();
if($order)$this->error("存在正在使用中的课程订单或存在正在售后中的课程订单无法继续操作!"); if($order)throw new \Exception("存在正在使用中的课程订单或存在正在售后中的课程订单无法继续操作!");
// 课程存在售后订单则不允许操作 // 课程存在售后订单则不允许操作
} }
@ -923,7 +1028,7 @@ $user_unpaid_order = $user_paid_order =null;
$params["user_id"] = $teacher["user_id"]; $params["user_id"] = $teacher["user_id"];
//课时必须大于等于1 //课时必须大于等于1
if($params["classes_num"] < 1) throw new \Exception("课时必须大于等于1"); // if($params["classes_num"] < 1) throw new \Exception("课时必须大于等于1");
if($params["price"] < 0) throw new \Exception("售价必须大于0"); if($params["price"] < 0) throw new \Exception("售价必须大于0");
@ -1019,7 +1124,8 @@ $user_unpaid_order = $user_paid_order =null;
foreach ($spec as $k=>&$v){ foreach ($spec as $k=>&$v){
$v["classes_lib_id"] = $row->id; $v["classes_lib_id"] = $row->id;
(new ClassesSpec)->specCheck($v,$shop_id,empty($v["id"])? null : ClassesSpec::get($v["id"])); //先不进行判定,交给提交后再判定
(new ClassesSpec)->specCheck($v,$shop_id,empty($v["id"])? null : ClassesSpec::get($v["id"]),false);
} }
$params["spec"] = $spec; $params["spec"] = $spec;
@ -1056,7 +1162,7 @@ $user_unpaid_order = $user_paid_order =null;
$params["spec"] = array_reverse($params["spec"]); $params["spec"] = array_reverse($params["spec"]);
$insert_spec = []; $insert_spec = [];
foreach ($params["spec"] as $k=>&$v){ foreach ($params["spec"] as $k=>&$v){
$v["weigh"] = $k; $v["weigh"] = $k + 1;
if(!empty($v["id"]))$insert_spec[] = $v["id"]; if(!empty($v["id"]))$insert_spec[] = $v["id"];
} }
if($insert_spec && $row){ if($insert_spec && $row){

View File

@ -42,6 +42,16 @@ class ClassesSpec extends BaseModel
}); });
} }
public function getTimeAttr($value, $data)
{
$start_time = isset($data['start_time']) ? $data['start_time'] : '';
$end_time = isset($data['end_time']) ? $data['end_time'] : '';
$start_time = is_numeric($start_time) ? date("Y/m/d H:i", $start_time) : $start_time;
$end_time = is_numeric($end_time) ? date("Y/m/d H:i", $end_time) : $end_time;
return $start_time .' - '.$end_time;
}
public function getStatusList() public function getStatusList()
{ {
@ -101,7 +111,7 @@ class ClassesSpec extends BaseModel
} }
public function specCheck(&$params,$shop_id=null,$row=null) public function specCheck(&$params,$shop_id=null,$row=null,$check=true)
{ {
//限定人数必须大于0 //限定人数必须大于0
@ -173,7 +183,7 @@ class ClassesSpec extends BaseModel
->where("classes_lib_id",$classes_lib_id) ->where("classes_lib_id",$classes_lib_id)
->where("id","<>",$row->id)->find(); ->where("id","<>",$row->id)->find();
if($spec_time_exist){ if($check && $spec_time_exist){
throw new \Exception("该课程下,{$spec_time_exist['name']}课时的开始和结束时间与你有重叠"); throw new \Exception("该课程下,{$spec_time_exist['name']}课时的开始和结束时间与你有重叠");
} }
@ -198,7 +208,7 @@ class ClassesSpec extends BaseModel
->where("classes_lib_id",$classes_lib_id) ->where("classes_lib_id",$classes_lib_id)
->find(); ->find();
if($spec_time_exist){ if($check && $spec_time_exist){
throw new \Exception("该课程下,{$spec_time_exist['name']}课时的开始和结束时间与你有重叠"); throw new \Exception("该课程下,{$spec_time_exist['name']}课时的开始和结束时间与你有重叠");
} }

View File

@ -188,12 +188,12 @@ class Order extends BaseModel
if (isset($whereData['keywords'])&&$whereData['keywords']) $model = $model->where("{$alisa}order_no|{$alisa}id", '=', $whereData['keywords']); if (isset($whereData['keywords'])&&$whereData['keywords']) $model = $model->where("{$alisa}order_no|{$alisa}id", '=', $whereData['keywords']);
if (isset($whereData['createtime'])&&$whereData['createtime']){ if (isset($whereData['createtime'])&&$whereData['createtime']){
$model = $model->time(["createtime",$whereData['createtime']]); $model = $model->time(["{$alisa}createtime",$whereData['createtime']]);
} }
if (isset($whereData['start_time'])&&$whereData['start_time']){ if (isset($whereData['start_time'])&&$whereData['start_time']){
$model = $model->time(["start_time",$whereData['start_time']]); $model = $model->time(["{$alisa}start_time",$whereData['start_time']]);
} }
if (isset($whereData['user_id']) && $whereData['user_id']) $model = $model->where("{$alisa}user_id", '=', $whereData['user_id']); if (isset($whereData['user_id']) && $whereData['user_id']) $model = $model->where("{$alisa}user_id", '=', $whereData['user_id']);
@ -201,6 +201,32 @@ class Order extends BaseModel
if (isset($whereData['classes_lib_ids']) && $whereData['classes_lib_ids']) $model = $model->where("{$alisa}classes_lib_id", 'in', $whereData['classes_lib_ids']); if (isset($whereData['classes_lib_ids']) && $whereData['classes_lib_ids']) $model = $model->where("{$alisa}classes_lib_id", 'in', $whereData['classes_lib_ids']);
if (isset($whereData['classes_lib_id']) && $whereData['classes_lib_id']) $model = $model->where("{$alisa}classes_lib_id", 'in', $whereData['classes_lib_id']); if (isset($whereData['classes_lib_id']) && $whereData['classes_lib_id']) $model = $model->where("{$alisa}classes_lib_id", 'in', $whereData['classes_lib_id']);
if (isset($whereData['time'])&&$whereData['time']){
if(strstr($whereData['time'], '---') !== false){
[$startTime, $endTime] = explode('---', $whereData['time']);
}elseif (strstr($whereData['time'], '-') !== false){
[$startTime, $endTime] = explode('-', $whereData['time']);
}
$start_time = trim($startTime);
$end_time = trim($endTime);
$start_time = strtotime($startTime);
$end_time = strtotime($endTime);
//sudo此方法必须是时间戳
$model = $model->where(function ($query) use ($alisa,$start_time,$end_time) {
// if($alisa)$alisa = "`order`.";
//兩個時間區間重合 存在任意交集 都不行
$query->where("{$alisa}start_time BETWEEN {$start_time} AND {$end_time}");
$query->whereOr("{$alisa}end_time BETWEEN {$start_time} AND {$end_time}");
$query->whereOr("{$alisa}start_time <= {$start_time} AND {$alisa}end_time >= {$end_time}");
$query->whereOr("{$alisa}start_time >= {$start_time} AND {$alisa}end_time <= {$end_time}");
});
}
return $model; return $model;
} }
@ -254,7 +280,7 @@ class Order extends BaseModel
public static function allList($user_id,$page, $limit,$keywords,$status,$classes_order_id=0,$classes_lib_id = [],$start_time = null,$createtime = null){ public static function allList($user_id,$page, $limit,$keywords,$status,$classes_order_id=0,$classes_lib_id = [],$start_time = null,$createtime = null,$time = null){
$with_field = [ $with_field = [
'user'=>['nickname','mobile','avatar','realname'], 'user'=>['nickname','mobile','avatar','realname'],
'base'=>['*'], 'base'=>['*'],
@ -268,7 +294,7 @@ class Order extends BaseModel
$FINISH = '3'; $FINISH = '3';
$alisa = (new self)->getWithAlisaName(); $alisa = (new self)->getWithAlisaName();
$sort = "field({$alisa}.status,'{$NOAUDIT}','{$HAVE}','{$FINISH}','{$CANCEL}') asc,{$alisa}.id desc"; $sort = "field({$alisa}.status,'{$NOAUDIT}','{$HAVE}','{$FINISH}','{$CANCEL}') asc,{$alisa}.id desc";
$serch_where = ['status'=>$status,'user_id'=>$user_id,'keywords'=>$keywords,'classes_order_id'=>$classes_order_id,'classes_lib_id'=>$classes_lib_id,"start_time"=>$start_time,"createtime"=>$createtime]; $serch_where = ['status'=>$status,'user_id'=>$user_id,'keywords'=>$keywords,'classes_order_id'=>$classes_order_id,'classes_lib_id'=>$classes_lib_id,"start_time"=>$start_time,"createtime"=>$createtime,"time"=>$time];
// if($type)$serch_where['type'] = $type; // if($type)$serch_where['type'] = $type;
return (new self)->getBaseList($serch_where, $page, $limit,$sort,$with_field); return (new self)->getBaseList($serch_where, $page, $limit,$sort,$with_field);
} }
@ -312,7 +338,7 @@ class Order extends BaseModel
public static function workList($page, $limit,$keywords,$status,$classes_order_id=0,$user_id=0,$classes_lib_id = [],$classes_lib_ids = [],$start_time = null,$createtime = null){ public static function workList($page, $limit,$keywords,$status,$classes_order_id=0,$user_id=0,$classes_lib_id = [],$classes_lib_ids = [],$start_time = null,$createtime = null,$time=null){
$with_field = [ $with_field = [
'user'=>['nickname','mobile','avatar','realname'], 'user'=>['nickname','mobile','avatar','realname'],
'base'=>['*'], 'base'=>['*'],
@ -326,7 +352,7 @@ class Order extends BaseModel
$FINISH = '3'; $FINISH = '3';
$alisa = (new self)->getWithAlisaName(); $alisa = (new self)->getWithAlisaName();
$sort = "field({$alisa}.status,'{$NOAUDIT}','{$HAVE}','{$FINISH}','{$CANCEL}') asc,{$alisa}.id desc"; $sort = "field({$alisa}.status,'{$NOAUDIT}','{$HAVE}','{$FINISH}','{$CANCEL}') asc,{$alisa}.id desc";
$serch_where = ['status'=>$status,'user_id'=>$user_id,'keywords'=>$keywords,'classes_order_id'=>$classes_order_id,"classes_lib_id"=>$classes_lib_id,"classes_lib_ids"=>$classes_lib_ids,"start_time"=>$start_time,"createtime"=>$createtime]; $serch_where = ['status'=>$status,'user_id'=>$user_id,'keywords'=>$keywords,'classes_order_id'=>$classes_order_id,"classes_lib_id"=>$classes_lib_id,"classes_lib_ids"=>$classes_lib_ids,"start_time"=>$start_time,"createtime"=>$createtime,"time"=>$time];
// if($type)$serch_where['type'] = $type; // if($type)$serch_where['type'] = $type;
return (new self)->getBaseList($serch_where, $page, $limit,$sort,$with_field); return (new self)->getBaseList($serch_where, $page, $limit,$sort,$with_field);
} }
@ -949,6 +975,59 @@ class Order extends BaseModel
} }
public static function checkOnlyone($user_id,$classes_lib_info,$check=false){
$as = (new self)->getWithAlisaName();
//配置
$onlyone_check = config("site.free_classes_onlyone_check");
if(!$onlyone_check)return true;
//同个免费课只能只能买一次
$order_count = \app\common\model\school\classes\order\Order::with("detail")->where("{$as}.status",'not in',["-3"])
->where("detail.feel",'1')
->where("{$as}.user_id",$user_id)
->where("{$as}.classes_lib_id" ,'=',$classes_lib_info["id"])
->count();
//已达到进入黑名单条件
if($check && $order_count){
throw new \Exception("您已有正在进行的同类型免费课程,无需重复报名!");
}
//免费课开始和结束时间有交叠无法下预约
if(!config("site.free_time_overlap_check")){
//如果是免费课
$specs = $classes_lib_info->specs;
foreach ($specs as $classes_lib_spec_info){
//判断时间是否有交叠
$start_time = $classes_lib_spec_info['start_time'];
$end_time = $classes_lib_spec_info['end_time'];
$as = (new self)->getWithAlisaName();
//判断时间是否有交叠(只查所有的免费的预约记录)
$order_info = self::with("detail")->where("detail.price",0)
->where("{$as}.status","in",["-1","0"])
->where(function ($query) use ($as,$start_time,$end_time) {
//兩個時間區間重合 存在任意交集 都不行
$query->where("{$as}.start_time BETWEEN {$start_time} AND {$end_time}");
$query->whereOr("{$as}.end_time BETWEEN {$start_time} AND {$end_time}");
$query->whereOr("{$as}.start_time <= {$start_time} AND {$as}.end_time >= {$end_time}");
$query->whereOr("{$as}.start_time >= {$start_time} AND {$as}.end_time <= {$end_time}");
})
->where("{$as}.user_id",$user_id)->find();
if($order_info) throw new \Exception("当前课程的上课时间区间内,您已预约免费课程{$order_info['detail']['title']},无法再下单其他免费课程");
}
}
}
//执行免费课黑名单判断 //执行免费课黑名单判断
public static function checkBlackList($user_id,$check=false){ public static function checkBlackList($user_id,$check=false){
$as = (new self)->getWithAlisaName(); $as = (new self)->getWithAlisaName();
@ -1021,6 +1100,10 @@ class Order extends BaseModel
case 'shop': case 'shop':
$admin_info = Manystore::where('id',$oper_id)->find(); $admin_info = Manystore::where('id',$oper_id)->find();
if(!$admin_info) throw new \Exception("代下单管理员不存在!"); if(!$admin_info) throw new \Exception("代下单管理员不存在!");
$classes_lib_ids = ClassesLib::where("manystore_id",$oper_id)->column("id");
//判断当前订单课程是否在此课程授权范围内
if(!in_array($classesOrder["classes_lib_id"],$classes_lib_ids)) throw new \Exception("该课程不在您的授权范围内,无法代操作!");
break; break;
default: default:
throw new \Exception("请选择正确的代下单类型!"); throw new \Exception("请选择正确的代下单类型!");
@ -1340,4 +1423,63 @@ class Order extends BaseModel
public static function getMonthByTime($time,$user_id=null,$status="-1,0"){
$statistics_data_time = $time;
if(!$statistics_data_time)throw new \Exception("请输入时间!");
//如果不是时间戳先格式
if(!is_numeric($statistics_data_time)){
$statistics_data_time = strtotime($statistics_data_time);
}
if($statistics_data_time){
//得到开始和结束时间
$start_time = strtotime(date( 'Y-m-1 00:00:00', $statistics_data_time ));
$end_time = strtotime('+1 month', $start_time) -1;
}
//得到$start_time 到 $end_time 时间戳的所有天
$days = [];
for($i = $start_time; $i <= $end_time; $i += 86400){
$day = [];
//得到$date当前是周几
//需处理周日为7
$day["week"] = date('w',$i)==0? '7' :date('w',$i);
$day["day"] = date('d',$i);
$day["month"] = date('m',$i);
$day["year"] = date('Y',$i);
//得到$date的开始和结束时间
$day["start_time"] = strtotime(date('Y-m-d 00:00:00',$i));
$day["end_time"] = strtotime(date('Y-m-d 23:59:59',$i));
$day["field"] = "day".$day["day"];
$week_field = $day['week'];
$day["title"] = $day["day"].""."-周{$week_field}";
$day["check"] = false;
if($statistics_data_time >= $day["start_time"] && $statistics_data_time <= $day["end_time"]){
$day["check"] = true;
}
$days[] = $day;
}
$as = "";
foreach ($days as $i=>&$day){
$start_time =$day["start_time"];
$end_time = $day["end_time"];
//查询用户在开始和结束事件内的预约
$model = new self;
if($user_id)$model = $model->where($as.'user_id',$user_id);
$model = $model->where($as.'status',"in",$status);
$day["hour_order_ids"] = $model->where(function ($query) use ($as,$start_time,$end_time) {
//兩個時間區間重合 存在任意交集 都不行
$query->where("{$as}start_time BETWEEN {$start_time} AND {$end_time}");
$query->whereOr("{$as}end_time BETWEEN {$start_time} AND {$end_time}");
$query->whereOr("{$as}start_time <= {$start_time} AND {$as}end_time >= {$end_time}");
$query->whereOr("{$as}start_time >= {$start_time} AND {$as}end_time <= {$end_time}");
})->column("{$as}id");
$day["number"] = count($day["hour_order_ids"]);
}
return $days;
}
} }

View File

@ -7,6 +7,7 @@ use app\admin\model\Admin;
use app\common\model\BaseModel; use app\common\model\BaseModel;
use app\common\model\dyqc\ManystoreShop; use app\common\model\dyqc\ManystoreShop;
use app\common\model\school\classes\ClassesLib; use app\common\model\school\classes\ClassesLib;
use app\common\model\school\classes\ClassesSpec;
use app\common\model\User; use app\common\model\User;
use bw\Common; use bw\Common;
use fast\Random; use fast\Random;
@ -54,7 +55,7 @@ class Order extends BaseModel
public function getStatusList() public function getStatusList()
{ {
return ['-3' => __('Status -3'), '0' => __('Status 0'), '3' => __('Status 3'), '6' => __('Status 6'), '9' => __('Status 9')]; return ['-3' => __('Status -3'), '0' => __('Status 0'), '3' => __('Status 3'),'4' => __('Status 4'), '6' => __('Status 6'), '9' => __('Status 9')];
} }
public function getBeforeStatusList() public function getBeforeStatusList()
@ -196,6 +197,15 @@ class Order extends BaseModel
return $this->belongsTo('app\admin\model\Admin', 'admin_id', 'id', [], 'LEFT')->setEagerlyType(0); return $this->belongsTo('app\admin\model\Admin', 'admin_id', 'id', [], 'LEFT')->setEagerlyType(0);
} }
public function serviceorder()
{
return $this->belongsTo(ServiceOrder::class, 'classes_service_order_id', 'id', [], 'LEFT')->setEagerlyType(0);
}
public function getCodeimageAttr($value, $data) public function getCodeimageAttr($value, $data)
{ {
if (!empty($value)) return cdnurl($value, true); if (!empty($value)) return cdnurl($value, true);
@ -283,6 +293,9 @@ class Order extends BaseModel
$data->user->visible(['id','nickname','mobile','avatar','realname']); $data->user->visible(['id','nickname','mobile','avatar','realname']);
//订单机构 //订单机构
$data->shop; $data->shop;
//售后单信息
$data->serviceorder;
// //得到二维码 // //得到二维码
// $data->code_url = Common::getQrcode([ // $data->code_url = Common::getQrcode([
// 'text' => $data['code'], // 'text' => $data['code'],
@ -414,6 +427,7 @@ class Order extends BaseModel
$data = ['order' => $res1]; $data = ['order' => $res1];
\think\Hook::listen('classes_order_create_after', $data); \think\Hook::listen('classes_order_create_after', $data);
//更新订单数据 //更新订单数据
self::statisticsAndUpdateClassesNumber($res1); self::statisticsAndUpdateClassesNumber($res1);
@ -454,6 +468,11 @@ class Order extends BaseModel
if($classes_lib_info && $classes_lib_info['feel']=='1'){ if($classes_lib_info && $classes_lib_info['feel']=='1'){
\app\common\model\school\classes\hourorder\Order::checkBlackList($user_id,true); \app\common\model\school\classes\hourorder\Order::checkBlackList($user_id,true);
} }
//免费课才进行判断(同個免費單只能买一次)
if($classes_lib_info && $classes_lib_info['feel']=='1'){
\app\common\model\school\classes\hourorder\Order::checkOnlyone($user_id,$classes_lib_info,true);
}
//用户存不存在 //用户存不存在
$user_info = User::where('id',$user_id)->find(); $user_info = User::where('id',$user_id)->find();
@ -496,9 +515,15 @@ class Order extends BaseModel
$order_data["totalprice"] = $classes_lib_info["price"]; $order_data["totalprice"] = $classes_lib_info["price"];
$order_data["payprice"] = $classes_lib_info["price"]; $order_data["payprice"] = $classes_lib_info["price"];
$order_data["status"] = '0'; $order_data["status"] = '0';
$order_type = "multiple";
//如果课程只存在一个规格,则订单类型为单课
$classes_spec_count = ClassesSpec::where('classes_lib_id',$classes_lib_id)->count();
if($classes_spec_count==1){
$order_type = "single";
}
return compact('order_data','classes_lib_info','user_data'); return compact('order_data','classes_lib_info','user_data','order_type');
} }
@ -661,6 +686,9 @@ class Order extends BaseModel
//事务逻辑 //事务逻辑
//不拆分订单,直接执行 //不拆分订单,直接执行
self::paySetData($order,$notify); self::paySetData($order,$notify);
//如果是免费单且是单规格
if($trans){ if($trans){
self::commitTrans(); self::commitTrans();
} }
@ -711,6 +739,8 @@ class Order extends BaseModel
$order->payprice = $notify['pay_fee'] ?? $order->totalprice; $order->payprice = $notify['pay_fee'] ?? $order->totalprice;
} }
$order->platform = $notify['platform'] ?? 'miniapp'; $order->platform = $notify['platform'] ?? 'miniapp';
$order->sub_refundprice = $order->payprice; //剩余未退 = 支付金额
$order->save(); $order->save();
return $order; return $order;
} }
@ -898,6 +928,12 @@ class Order extends BaseModel
//更新已用课程金额和剩余课程金额 //更新已用课程金额和剩余课程金额
$detail->used_price = bcmul($detail->unit_price , $detail->use_num,2); $detail->used_price = bcmul($detail->unit_price , $detail->use_num,2);
$detail->save(); $detail->save();
//得到所有售后单的已退金额
$order->real_refundprice = ServiceOrder::where("classes_order_id" , $order["id"])->where("status","in",['7'])->where("sales_type","in",['10'])->sum("real_refundprice");
//实际付款额 - 已退金额 = 剩余未退
//更新剩余未退
$order->sub_refundprice = bcsub($order->payprice,$order->real_refundprice,2);
//更新订单应退金额 //更新订单应退金额
$order->total_refundprice = bcsub($order->totalprice,$detail->used_price,2); $order->total_refundprice = bcsub($order->totalprice,$detail->used_price,2);
$order->save(); $order->save();

View File

@ -36,7 +36,7 @@ class OrderLog extends BaseModel
public function getStatusList() public function getStatusList()
{ {
return ['-3' => __('Status -3'), '0' => __('Status 0'), '3' => __('Status 3'), '6' => __('Status 6'), '9' => __('Status 9')]; return ['-3' => __('Status -3'), '0' => __('Status 0'), '3' => __('Status 3'),'4' => __('Status 4'), '6' => __('Status 6'), '9' => __('Status 9')];
} }
public function getBeforeStatusList() public function getBeforeStatusList()

View File

@ -0,0 +1,827 @@
<?php
namespace app\common\model\school\classes\order;
use app\admin\model\Admin;
use app\common\model\BaseModel;
use app\common\model\dyqc\ManystoreShop;
use app\common\model\manystore\Shop;
use app\common\model\ManystoreConfig;
use app\common\model\school\classes\ClassesLib;
use app\common\model\User;
use app\manystore\model\Manystore;
use think\Model;
use traits\model\SoftDelete;
class ServiceOrder extends BaseModel
{
use SoftDelete;
// 表名
protected $name = 'school_classes_service_order';
// 自动写入时间戳字段
protected $autoWriteTimestamp = 'integer';
// 定义时间戳字段名
protected $createTime = 'createtime';
protected $updateTime = 'updatetime';
protected $deleteTime = 'deletetime';
// 追加属性
protected $append = [
'status_text',
'service_stauts_text',
'sales_type_text',
'platform_text',
'pay_type_text',
'refundtime_text',
'rejecttime_text',
'handletime_text',
'confirmtime_text',
'checkouttime_text'
];
public function getStatusList()
{
return ['1' => __('Status 1'), '4' => __('Status 4'), '7' => __('Status 7'), '-3' => __('Status -3')];
}
public function getServiceStautsList()
{
return ['1' => __('Service_stauts 1'), '4' => __('Service_stauts 4'), '7' => __('Service_stauts 7'), '-3' => __('Service_stauts -3')];
}
public function getSalesTypeList()
{
return ['-3' => __('Sales_type -3'), '1' => __('Sales_type 1'), '4' => __('Sales_type 4'), '7' => __('Sales_type 7'), '10' => __('Sales_type 10')];
}
public function getPlatformList()
{
return ['miniapp' => __('Platform miniapp')];
}
public function getPayTypeList()
{
return ['yue' => __('Pay_type yue'), 'wechat' => __('Pay_type wechat')];
}
public function getStatusTextAttr($value, $data)
{
$value = $value ? $value : (isset($data['status']) ? $data['status'] : '');
$list = $this->getStatusList();
return isset($list[$value]) ? $list[$value] : '';
}
public function getServiceStautsTextAttr($value, $data)
{
$value = $value ? $value : (isset($data['service_stauts']) ? $data['service_stauts'] : '');
$list = $this->getServiceStautsList();
return isset($list[$value]) ? $list[$value] : '';
}
public function getSalesTypeTextAttr($value, $data)
{
$value = $value ? $value : (isset($data['sales_type']) ? $data['sales_type'] : '');
$list = $this->getSalesTypeList();
return isset($list[$value]) ? $list[$value] : '';
}
public function getPlatformTextAttr($value, $data)
{
$value = $value ? $value : (isset($data['platform']) ? $data['platform'] : '');
$list = $this->getPlatformList();
return isset($list[$value]) ? $list[$value] : '';
}
public function getPayTypeTextAttr($value, $data)
{
$value = $value ? $value : (isset($data['pay_type']) ? $data['pay_type'] : '');
$list = $this->getPayTypeList();
return isset($list[$value]) ? $list[$value] : '';
}
public function getRefundtimeTextAttr($value, $data)
{
$value = $value ? $value : (isset($data['refundtime']) ? $data['refundtime'] : '');
return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
}
public function getRejecttimeTextAttr($value, $data)
{
$value = $value ? $value : (isset($data['rejecttime']) ? $data['rejecttime'] : '');
return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
}
public function getHandletimeTextAttr($value, $data)
{
$value = $value ? $value : (isset($data['handletime']) ? $data['handletime'] : '');
return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
}
public function getConfirmtimeTextAttr($value, $data)
{
$value = $value ? $value : (isset($data['confirmtime']) ? $data['confirmtime'] : '');
return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
}
public function getCheckouttimeTextAttr($value, $data)
{
$value = $value ? $value : (isset($data['checkouttime']) ? $data['checkouttime'] : '');
return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
}
protected function setRefundtimeAttr($value)
{
return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
}
protected function setRejecttimeAttr($value)
{
return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
}
protected function setHandletimeAttr($value)
{
return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
}
protected function setConfirmtimeAttr($value)
{
return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
}
protected function setCheckouttimeAttr($value)
{
return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
}
public function classesorder()
{
return $this->belongsTo(Order::class, 'classes_order_id', 'id', [], 'LEFT')->setEagerlyType(0);
}
public function user()
{
return $this->belongsTo('app\common\model\User', 'user_id', 'id', [], 'LEFT')->setEagerlyType(0);
}
public function detail()
{
return $this->belongsTo(OrderDetail::class, 'classes_order_detail_id', 'id', [], 'LEFT')->setEagerlyType(0);
}
public function lib()
{
return $this->belongsTo(ClassesLib::class, 'classes_lib_id', 'id', [], 'LEFT')->setEagerlyType(0);
}
public function manystore()
{
return $this->belongsTo(Manystore::class, 'manystore_id', 'id', [], 'LEFT')->setEagerlyType(0);
}
public function shop()
{
return $this->belongsTo(ManystoreShop::class, 'shop_id', 'id', [], 'LEFT')->setEagerlyType(0);
}
/**发起售后
* @param $params
* @param bool $trans
* @throws \Exception
*/
public function afterSales($classes_order,$reason,$mark='更新订单状态',$oper_type='user',$oper_id = 0,$trans=false){
// var_dump($order);
if(is_numeric($classes_order)||is_string($classes_order))$classes_order = Order::where('order_no|id',$classes_order)->find();
if(!$classes_order)throw new \Exception("找不到订单");
//操作人信息(可扩展)
$data = [
'oper_type'=>$oper_type ?: 'user',
'oper_id'=>$oper_id ?: $classes_order['user_id'],
'log_text'=>$mark,
];
//判断逻辑
if($trans){
self::beginTrans();
}
$res = true;
try{
//事务逻辑
$order = $this->createOrder($classes_order,$reason,$mark,$oper_type,$oper_id);
if($trans){
self::commitTrans();
}
}catch (\Exception $e){
if($trans){
self::rollbackTrans();
}
throw new \Exception($e->getMessage());
}
return $order;
}
public static function getCost($order_no,$classes_order,$reason,$param=[],$check = false){
if(is_numeric($classes_order)||is_string($classes_order))$classes_order = Order::where('order_no|id',$classes_order)->find();
//先更新订单为最新订单
Order::statisticsAndUpdateClassesNumber($classes_order->id);
//代下单时将下单人修正成课程下单人,不影响后续判断
$user_id = $classes_order["user_id"];
if(isset($param["help_user_id"]) && $param["help_user_id"]){
}
//校验订单参数
$detail = $classes_order->detail;
$classes_lib_info = $detail;
//用户
$user_info = User::get($user_id);
$user_data = [
"nickname"=>$user_info["nickname"],
"realname"=>$user_info["realname"],
"avatar"=>$user_info["avatar"],
"mobile"=>$user_info["mobile"],
"money" =>$user_info["money"],
"score" =>$user_info["score"],
];
//组装订单下单数据
$order_data = [];
$order_data["order_no"] = $order_no;
$order_data["user_id"] = $user_id;
$order_data["classes_order_id"] = $classes_order["id"];
$order_data["classes_order_detail_id"] = $detail["id"];
$order_data["classes_lib_id"] = $detail["classes_lib_id"];
$order_data["manystore_id"] = $detail["manystore_id"];
$order_data["shop_id"] = $detail["shop_id"];
$order_data["status"] = '1';
$order_data["service_stauts"] = '1';
$order_data["sales_type"] = '-3';
$order_data["platform"] = $classes_order["platform"];
$order_data["pay_type"] = $classes_order["pay_type"];
$order_data["reason"] = $reason;
//计算退款金额
//得到租户端配置
$manystore_config = ManystoreConfig::manystore_config($detail["shop_id"]);
$loss_ratio = $manystore_config["loss_ratio"];
//修正比例大于100则等于100小于0则等于0
$loss_ratio = $loss_ratio > 100 ? 100 : $loss_ratio;
$loss_ratio = $loss_ratio < 0 ? 0 : $loss_ratio;
$order_data["loss_proportion"] = $loss_ratio;
//自动计算应退全额:
// (课程单价 减去 (课程单价乘以课程损耗比) )等于 每个课时应退金额
//损耗单价
$unit_loss_price = bcdiv(bcmul($detail["unit_price"],$loss_ratio,2), 100,2);
//修复误差小于0
$unit_loss_price = $unit_loss_price < 0 ? 0 : $unit_loss_price;
//损耗后单价
$unit_sub_loss_price = bcsub($detail["unit_price"],$unit_loss_price,2);
//修复误差小于0
$unit_sub_loss_price = $unit_sub_loss_price < 0 ? 0 : $unit_sub_loss_price;
//剩余课时数
$sub_num = $detail["sub_num"];
//用bc系列函数计算小数取两位 剩余课时数 * 每个课时应退金额 = 课程应退金额
$order_data["auto_recommend_price"] = bcmul($sub_num,$unit_sub_loss_price,2);
//修复误差:如果金额大于剩余未退金额,则取剩余未退金额
$order_data["auto_recommend_price"] = $order_data["auto_recommend_price"] > $classes_order["sub_refundprice"] ? $classes_order["sub_refundprice"] : $order_data["auto_recommend_price"];
//用bc系列函数计算小数取两位剩余课时数 * 每个课时单价 = 课程应退全额
$order_data["auto_price"] = bcmul($sub_num,$detail["unit_price"],2);
//修复误差:如果金额大于剩余未退金额,则取剩余未退金额
$order_data["auto_price"] = $order_data["auto_price"] > $classes_order["sub_refundprice"] ? $classes_order["sub_refundprice"] : $order_data["auto_price"];
//用bc系列函数计算小数取两位课程单价乘以课程损耗比* 剩余课时数 等于 每个课时应退金额
$order_data["auto_loss_price"] = bcmul($sub_num,$unit_loss_price,2);
$order_data["auto_loss_unit_price"] = $unit_loss_price;
$order_data["sub_refundprice"] = $classes_order["sub_refundprice"];
$classes_order_data = [
'before_status'=>$classes_order["status"],
'status' => "4",
'server_status' => '3',
'reason' => $reason,
'classes_service_order_id'=>0,
];
return compact('order_data','classes_lib_info','user_data','classes_order_data');
}
public function createOrder($classes_order,$reason,$mark='更新订单状态',$oper_type='user',$oper_id = 0){
if(is_numeric($classes_order)||is_string($classes_order))$classes_order = Order::where('order_no|id',$classes_order)->find();
$order_no = get_order_sn();
$this->orderVaild($order_no,$classes_order,$reason,$oper_type,$oper_id,[],true);
//订单创建信息
$order_info = self::getCost($order_no,$classes_order,$reason,[],true);
//组装订单数据
$order_data = $order_info["order_data"];
$classes_order_data = $order_info["classes_order_data"];
//创建售后单
$serverorder = self::create($order_data);
$classes_order_data["classes_service_order_id"] = $serverorder["id"];
//更新课程订单
$classes_order->allowField(true)->save($classes_order_data);
//记录订单日志
ServiceOrderLog::log($classes_order['id'],$mark ?:"售后单申请已提交,等待商家处理",$oper_type,$oper_id);
//7事件
$data = ['serviceorder' => $serverorder,"oper_type"=>$oper_type,"oper_id"=>$oper_id];
\think\Hook::listen('classes_serviceorder_create_after', $data);
return self::showInfo($order_no);
}
/**展示订单信息
* @param $order_no
* @param $price_info
* @return array
*/
public static function showInfo($order_no, $price_info = []){
$data = [];
$data['order_no'] =$order_no;
$data['order_info'] = self::getDetail($order_no);
return array_merge($data,$price_info);
}
/**得到订单详情
* @param $order_no
*/
public static function getDetail($order_no,$classes_lib_id = []){
$model = self::where('order_no|id',$order_no);
if($classes_lib_id)$model = $model->where("classes_lib_id","in",$classes_lib_id);
$data = $model->find();
if(!$data) return $data;
//加载订单详情
$data->detail->teacher;
//订单用户
// $data->user;
$data->user->visible(['id','nickname','mobile','avatar','realname']);
//订单机构
$data->shop;
// //得到二维码
// $data->code_url = Common::getQrcode([
// 'text' => $data['code'],
// 'size' => 200,
// ]);
// $data->one_code_url = Common::getBarcode([
// 'text' => $data['code'],
// 'size' => 200,
// ]);
return $data;
}
/**订单校验
* @param $user_id 用户id
* @param $classes_lib_id 课程id
* @param $order_no 订单号
* @param $param 表单扩展参数
* @return bool
*/
public function orderVaild($order_no,$classes_order,$reason,$oper_type='user',$oper_id = 0,$params=[],$check=false){
if(is_numeric($classes_order)||is_string($classes_order))$classes_order = Order::where('order_no|id',$classes_order)->find();
if(!$classes_order||!$reason )throw new \Exception("缺少必要参数");
//默认校验订单是否已创建
if($check){
//判断订单是否已创建
$order_info = self::where(['order_no'=>$order_no])->find();
if($order_info) throw new \Exception("订单已生成,如需重新下单请退出页面重新进入!");
}
$user_id = $classes_order["user_id"];
//校验订单参数
//操作人权限验证
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("该订单当前状态无法申请售后!");
//存在售后中的订单
$count = self::where( 'classes_order_id',$classes_order["id"])->where("status","not in","7,-3")->count();
if($count > 0) throw new \Exception("该订单已存在正在进行中的售后单,请等待售后处理!");
//用户存不存在
$user_info = User::where('id',$user_id)->find();
if(!$user_info) throw new \Exception("用户不存在!");
return 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_order_id,$oper_id,$oper_type){
//课程是否存在并上架
$classesOrder = \app\common\model\school\classes\order\Order::where("id",$classes_order_id)->find();
if(!$classesOrder)throw new \Exception("订单不存在!");
switch ($oper_type) {
case 'user':
//自己或操作员
if($oper_id != $classesOrder["user_id"]){
//说明是操作员
$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("该课程不在您的授权范围内,无法代操作!");
}
break;
case 'admin':
$admin_info = Admin::where('id',$oper_id)->find();
if(!$admin_info) throw new \Exception("代下单管理员不存在!");
break;
case 'shop':
$admin_info = Manystore::where('id',$oper_id)->find();
if(!$admin_info) throw new \Exception("代下单管理员不存在!");
$classes_lib_ids = ClassesLib::where("manystore_id",$oper_id)->column("id");
//判断当前订单课程是否在此课程授权范围内
if(!in_array($classesOrder["classes_lib_id"],$classes_lib_ids)) throw new \Exception("该课程不在您的授权范围内,无法代操作!");
break;
default:
throw new \Exception("请选择正确的代下单类型!");
}
}
/**得到可取消订单
* @param $order_no
* @return array|false|\PDOStatement|string|Model
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public static function getHaveCancelOrder($order_no){
// $where = [self::STATUS_NOPAY,self::STATUS_PAYED];
$order = self::where('order_no|id',$order_no)
->where("status","in",['1'])
->find();
if(!$order)throw new \Exception("只有待处理售后单可取消!");
return $order;
}
/**更新订单取消状态
* @param $order
* @return array|false|\PDOStatement|string|Model
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public static function updateCancel($order){
if(is_string($order))$order = self::getHaveCancelOrder($order);
$order->status = "-3";//refund_status
$order->canceltime = time();
$order->save();
return $order;
}
/**更新课程订单还原原状态
* @param $order
* @return array|false|\PDOStatement|string|Model
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public static function orderRestore($classes_order){
if(is_numeric($classes_order)||is_string($classes_order))$classes_order = Order::where('order_no|id',$classes_order)->find();
$classes_order->status = $classes_order->before_status;//refund_status
$classes_order->before_status = '0';
$classes_order->server_status = '0';//refund_status
$classes_order->reason = '';
$classes_order->classes_service_order_id = 0;
$classes_order->save();
return $classes_order;
}
/**订单取消
* @param $order_no
* @param int $user_id
* @param bool $check
* @param bool $trans
* @return bool
* @throws \Exception
*/
public function cancel($order_no,$user_id=0,$check=false,$oper_type='user',$oper_id=0,$trans=false){
//得到可取消订单
$order = self::getHaveCancelOrder($order_no);
if($check){
//用户操作权限检测
\app\common\model\school\classes\hourorder\Order::checkOptionAuth($order['id'],$user_id ?: $oper_id,$oper_type);
}
//判断逻辑
if($trans){
self::beginTrans();
}
$res = true;
try{
//事务逻辑
//更新售后为取消状态
$order = self::updateCancel($order);
//还原课程订单
self::orderRestore($order["classes_order_id"]);
//插入订单取消日志
if(!$user_id ||$order["user_id"] !=$user_id ){
ServiceOrderLog::log($order['id'],"[系统操作]课程订单已取消售后",$oper_type ?: 'user', $oper_id ?: $order['user_id']);
}else{
ServiceOrderLog::log($order['id'],"课程订单已取消售后",$oper_type ?: 'user', $oper_id ?: $order['user_id']);
}
//调用订单取消事件
$data = ['serviceorder' => $order,"user_id"=>$user_id,"oper_type"=>$oper_type,"oper_id"=>$oper_id];
\think\Hook::listen('classes_serviceorder_cancel_after', $data);
//执行课时数更新
$res1 = order::statisticsAndUpdateClassesNumber($order['classes_order_id']);
if($trans){
self::commitTrans();
}
}catch (\Exception $e){
if($trans){
self::rollbackTrans();
}
throw new \Exception($e->getMessage());
}
return $res1;
}
/**得到基础条件
* @param $status
* @param null $model
* @param string $alisa
*/
public static function getBaseWhere($whereData = [], $model = null, $alisa = '',$with = false)
{
if (!$model) {
$model = new static;
if ($alisa&&!$with) $model = $model->alias($alisa);
}
if ($alisa) $alisa = $alisa . '.';
$tableFields = (new static)->getTableFields();
foreach ($tableFields as $fields)
{
if(in_array($fields, ['status',"service_stauts","sales_type",'classes_lib_id','classes_order_id','user_id','classes_order_detail_id']))continue;
// if (isset($whereData[$fields]) && $whereData[$fields]) $model = $model->where("{$alisa}{$fields}", '=', $whereData[$fields]);
if (isset($whereData[$fields]) && $whereData[$fields]){
if(is_array($whereData[$fields])){
$model = $model->where("{$alisa}{$fields}", $whereData[$fields][0], $whereData[$fields][1]);
}else{
$model = $model->where("{$alisa}{$fields}", '=', $whereData[$fields]);
}
}
}
if (isset($whereData['status'])) $model = $model->where("{$alisa}status", 'in', $whereData['status']);
if (isset($whereData['service_stauts'])) $model = $model->where("{$alisa}service_stauts", 'in', $whereData['service_stauts']);
if (isset($whereData['sales_type'])) $model = $model->where("{$alisa}sales_type", 'in', $whereData['sales_type']);
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|{$alisa}reason", '=', $whereData['keywords']);
if (isset($whereData['time'])&&$whereData['time']){
$model = $model->time(["{$alisa}createtime",$whereData['time']]);
}
if (isset($whereData['user_id']) && $whereData['user_id']) $model = $model->where("{$alisa}user_id", '=', $whereData['user_id']);
if (isset($whereData['classes_order_id']) && $whereData['classes_order_id']) $model = $model->where("{$alisa}classes_order_id", 'in', $whereData['classes_order_id']);
//classes_order_detail_id
if (isset($whereData['classes_order_detail_id']) && $whereData['classes_order_detail_id']) $model = $model->where("{$alisa}classes_order_detail_id", 'in', $whereData['classes_order_detail_id']);
if (isset($whereData['classes_lib_ids']) && $whereData['classes_lib_ids']) $model = $model->where("{$alisa}classes_lib_id", 'in', $whereData['classes_lib_ids']);
if (isset($whereData['classes_lib_id']) && $whereData['classes_lib_id']) $model = $model->where("{$alisa}classes_lib_id", 'in', $whereData['classes_lib_id']);
return $model;
}
public static function allList($user_id,$page, $limit,$keywords,$status,$service_stauts,$sales_type,$classes_order_id=[],$classes_order_detail_id=[],$classes_lib_id=[]){
$with_field = [
'user'=>['nickname','mobile','avatar','realname'],
'base'=>['*'],
'classesorder'=>['*'],
'detail'=>['*'],
];
$alisa = (new self)->getWithAlisaName();
$sort = "field({$alisa}.status,'1','4','7','-3') asc,{$alisa}.id desc";
$serch_where = ['status'=>$status,'user_id'=>$user_id,
'keywords'=>$keywords,"classes_order_id"=>$classes_order_id,
"classes_order_detail_id"=>$classes_order_detail_id,"classes_lib_id"=>$classes_lib_id,
"service_stauts"=>$service_stauts,"sales_type"=>$sales_type
];
// if($type)$serch_where['type'] = $type;
return (new self)->getBaseList($serch_where, $page, $limit,$sort,$with_field);
}
public static function baseCount($where = []){
$cancel_number = self::getBaseWhere(array_merge(['status'=>'-3'],$where))->count();
$processing_number = self::getBaseWhere(array_merge(['status'=>'4'],$where))->count();
$un_processing_number = self::getBaseWhere(array_merge(['status'=>'1'],$where))->count();
$finish_number = self::getBaseWhere(array_merge(['status'=>'7'],$where))->count();
return compact('cancel_number','processing_number','un_processing_number','finish_number');
}
/**订单数量统计
* @param int $user_id
* @return array
*/
public static function orderCount($user_id = 0,$classes_order_id=0,$classes_lib_id=[]){
return self::baseCount(['user_id'=>$user_id,"classes_lib_id"=>$classes_lib_id,"classes_order_id"=>$classes_order_id]);
}
public static function workList($page, $limit,$keywords,$status,$service_stauts,$sales_type,$classes_order_id=[],$classes_order_detail_id=[],$classes_lib_id=[],$classes_lib_ids=[]){
$with_field = [
'user'=>['nickname','mobile','avatar','realname'],
'base'=>['*'],
'classesorder'=>['*'],
'detail'=>['*'],
];
$alisa = (new self)->getWithAlisaName();
$sort = "field({$alisa}.status,'1','4','7','-3') asc,{$alisa}.id desc";
$serch_where = ['status'=>$status,'keywords'=>$keywords,"classes_lib_id"=>$classes_lib_id,"classes_lib_ids"=>$classes_lib_ids,"classes_order_id"=>$classes_order_id,"classes_order_detail_id"=>$classes_order_detail_id
,"service_stauts"=>$service_stauts,"sales_type"=>$sales_type
];
// if($type)$serch_where['type'] = $type;
return (new self)->getBaseList($serch_where, $page, $limit,$sort,$with_field);
}
/**订单数量统计
* @param int $user_id
* @return array
*/
public static function workCount($classes_order_id=0,$classes_lib_id=[],$classes_lib_ids=[]){
return self::baseCount(["classes_lib_id"=>$classes_lib_id,"classes_lib_ids"=>$classes_lib_ids,"classes_order_id"=>$classes_order_id]);
}
/**机构售后提交确认信息
* @param $order_no
* @param int $user_id
* @param bool $check
* @param bool $trans
* @return bool
* @throws \Exception
*/
public function shopConfirmation($order_no,$user_id=0,$check=false,$oper_type='user',$oper_id=0,$trans=false){
//得到机构售后提交确认订单
$order = self::getHaveShopConfirmationOrder($order_no);
if($check){
//用户操作权限检测
\app\common\model\school\classes\hourorder\Order::checkOptionAuth($order['id'],$user_id ?: $oper_id,$oper_type);
}
//判断逻辑
if($trans){
self::beginTrans();
}
$res = true;
try{
//事务逻辑
//更新售后为取消状态
$order = self::updateCancel($order);
//还原课程订单
self::orderRestore($order["classes_order_id"]);
//插入订单取消日志
if(!$user_id ||$order["user_id"] !=$user_id ){
ServiceOrderLog::log($order['id'],"[系统操作]课程订单已取消售后",$oper_type ?: 'user', $oper_id ?: $order['user_id']);
}else{
ServiceOrderLog::log($order['id'],"课程订单已取消售后",$oper_type ?: 'user', $oper_id ?: $order['user_id']);
}
//调用订单取消事件
$data = ['serviceorder' => $order,"user_id"=>$user_id,"oper_type"=>$oper_type,"oper_id"=>$oper_id];
\think\Hook::listen('classes_serviceorder_cancel_after', $data);
//执行课时数更新
$res1 = order::statisticsAndUpdateClassesNumber($order['classes_order_id']);
if($trans){
self::commitTrans();
}
}catch (\Exception $e){
if($trans){
self::rollbackTrans();
}
throw new \Exception($e->getMessage());
}
return $res1;
}
}

View File

@ -0,0 +1,261 @@
<?php
namespace app\common\model\school\classes\order;
use app\admin\model\Admin;
use app\common\model\BaseModel;
use think\Model;
class ServiceOrderLog extends BaseModel
{
// 表名
protected $name = 'school_classes_service_order_log';
// 自动写入时间戳字段
protected $autoWriteTimestamp = 'integer';
// 定义时间戳字段名
protected $createTime = 'createtime';
protected $updateTime = 'updatetime';
protected $deleteTime = false;
// 追加属性
protected $append = [
'status_text',
'service_stauts_text',
'sales_type_text'
];
public function getStatusList()
{
return ['1' => __('Status 1'), '4' => __('Status 4'), '7' => __('Status 7'), '-3' => __('Status -3')];
}
public function getServiceStautsList()
{
return ['1' => __('Service_stauts 1'), '4' => __('Service_stauts 4'), '7' => __('Service_stauts 7'), '-3' => __('Service_stauts -3')];
}
public function getSalesTypeList()
{
return ['-3' => __('Sales_type -3'), '1' => __('Sales_type 1'), '4' => __('Sales_type 4'), '7' => __('Sales_type 7'), '10' => __('Sales_type 10')];
}
public function getStatusTextAttr($value, $data)
{
$value = $value ? $value : (isset($data['status']) ? $data['status'] : '');
$list = $this->getStatusList();
return isset($list[$value]) ? $list[$value] : '';
}
public function getServiceStautsTextAttr($value, $data)
{
$value = $value ? $value : (isset($data['service_stauts']) ? $data['service_stauts'] : '');
$list = $this->getServiceStautsList();
return isset($list[$value]) ? $list[$value] : '';
}
public function getSalesTypeTextAttr($value, $data)
{
$value = $value ? $value : (isset($data['sales_type']) ? $data['sales_type'] : '');
$list = $this->getSalesTypeList();
return isset($list[$value]) ? $list[$value] : '';
}
public function serviceorder()
{
return $this->belongsTo(ServiceOrder::class, 'classes_service_order_id', 'id', [], 'LEFT')->setEagerlyType(0);
}
public function classesorder()
{
return $this->belongsTo(Order::class, 'classes_order_id', 'id', [], 'LEFT')->setEagerlyType(0);
}
public function user()
{
return $this->belongsTo('app\common\model\User', 'user_id', 'id', [], 'LEFT')->setEagerlyType(0);
}
public function detail()
{
return $this->belongsTo(OrderDetail::class, 'classes_order_detail_id', 'id', [], 'LEFT')->setEagerlyType(0);
}
public function admin()
{
return $this->belongsTo(Admin::class, 'oper_id', 'id', [], 'LEFT')->setEagerlyType(0);
}
/**记录订单日志
* @param $params
* @param bool $trans
* @throws \Exception
*/
public static function log($order,$mark='更新订单状态',$oper_type='user',$oper_id = 0,$trans=false){
// var_dump($order);
if(is_numeric($order)||is_string($order))$order = Order::where('order_no|id',$order)->find();
if(!$order)throw new \Exception("找不到订单");
//操作人信息(可扩展)
$data = [
'oper_type'=>$oper_type ?: 'user',
'oper_id'=>$oper_id ?: $order['user_id'],
'log_text'=>$mark,
];
//判断逻辑
if($trans){
self::beginTrans();
}
$res = true;
try{
//事务逻辑
$log_data = $order->toArray();
$log_data["classes_service_order_id"] = $order['id'];
unset($log_data['id']);
unset($log_data['createtime']);
if($mark)$log_data['log_text'] = $mark;
$log_data = array_merge($log_data,$data);
$log = (new self);
$log->allowField(true)->save($log_data);
if($trans){
self::commitTrans();
}
}catch (\Exception $e){
if($trans){
self::rollbackTrans();
}
throw new \Exception($e->getMessage());
}
return $log;
}
/**得到基础条件
* @param $status
* @param null $model
* @param string $alisa
*/
public static function getBaseWhere($whereData = [], $model = null, $alisa = '',$with = false)
{
if (!$model) {
$model = new static;
if ($alisa&&!$with) $model = $model->alias($alisa);
}
if ($alisa) $alisa = $alisa . '.';
$tableFields = (new static)->getTableFields();
foreach ($tableFields as $fields)
{
if(in_array($fields, ['status','classes_lib_id','classes_order_id','user_id','classes_order_detail_id']))continue;
// if (isset($whereData[$fields]) && $whereData[$fields]) $model = $model->where("{$alisa}{$fields}", '=', $whereData[$fields]);
if (isset($whereData[$fields]) && $whereData[$fields]){
if(is_array($whereData[$fields])){
$model = $model->where("{$alisa}{$fields}", $whereData[$fields][0], $whereData[$fields][1]);
}else{
$model = $model->where("{$alisa}{$fields}", '=', $whereData[$fields]);
}
}
}
if (isset($whereData['status'])) $model = $model->where("{$alisa}status", 'in', $whereData['status']);
if (isset($whereData['service_stauts'])) $model = $model->where("{$alisa}service_stauts", 'in', $whereData['service_stauts']);
if (isset($whereData['sales_type'])) $model = $model->where("{$alisa}sales_type", 'in', $whereData['sales_type']);
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|{$alisa}reason", '=', $whereData['keywords']);
if (isset($whereData['time'])&&$whereData['time']){
$model = $model->time(["{$alisa}createtime",$whereData['time']]);
}
if (isset($whereData['user_id']) && $whereData['user_id']) $model = $model->where("{$alisa}user_id", '=', $whereData['user_id']);
if (isset($whereData['classes_order_id']) && $whereData['classes_order_id']) $model = $model->where("{$alisa}classes_order_id", 'in', $whereData['classes_order_id']);
if (isset($whereData['classes_service_order_id']) && $whereData['classes_service_order_id']) $model = $model->where("{$alisa}classes_service_order_id", 'in', $whereData['classes_service_order_id']);
//classes_order_detail_id
if (isset($whereData['classes_order_detail_id']) && $whereData['classes_order_detail_id']) $model = $model->where("{$alisa}classes_order_detail_id", 'in', $whereData['classes_order_detail_id']);
if (isset($whereData['classes_lib_ids']) && $whereData['classes_lib_ids']) $model = $model->where("{$alisa}classes_lib_id", 'in', $whereData['classes_lib_ids']);
if (isset($whereData['classes_lib_id']) && $whereData['classes_lib_id']) $model = $model->where("{$alisa}classes_lib_id", 'in', $whereData['classes_lib_id']);
return $model;
}
public static function allList($user_id,$page, $limit,$keywords,$status,$service_stauts,$sales_type,$classes_service_order_id=[]){
$with_field = [
'user'=>['nickname','mobile','avatar','realname'],
'base'=>['*'],
'classesorder'=>['*'],
'detail'=>['*'],
];
$alisa = (new self)->getWithAlisaName();
$sort = "{$alisa}.id desc";
$serch_where = ['status'=>$status,'user_id'=>$user_id,
'keywords'=>$keywords,"classes_service_order_id"=>$classes_service_order_id,
"service_stauts"=>$service_stauts,"sales_type"=>$sales_type
];
// if($type)$serch_where['type'] = $type;
return (new self)->getBaseList($serch_where, $page, $limit,$sort,$with_field);
}
public static function workList($page, $limit,$keywords,$status,$service_stauts,$sales_type,$classes_service_order_id=[],$classes_lib_ids=[]){
$with_field = [
'user'=>['nickname','mobile','avatar','realname'],
'base'=>['*'],
'classesorder'=>['*'],
'detail'=>['*'],
];
$alisa = (new self)->getWithAlisaName();
$sort = "{$alisa}.id desc";
$serch_where = ['status'=>$status,'keywords'=>$keywords,"classes_service_order_id"=>$classes_service_order_id,"classes_lib_ids"=>$classes_lib_ids
,"service_stauts"=>$service_stauts,"sales_type"=>$sales_type
];
// if($type)$serch_where['type'] = $type;
return (new self)->getBaseList($serch_where, $page, $limit,$sort,$with_field);
}
}

View File

@ -306,4 +306,13 @@ return [
//API接口地址 //API接口地址
'api_url' => 'https://api.fastadmin.net', 'api_url' => 'https://api.fastadmin.net',
], ],
//增加 redis 配置
'redis' => [
'host' => '127.0.0.1', // redis 主机地址
'password' => '', // redis 密码
'port' => 6379, // redis 端口
'select' => 3, // redis 数据库
'timeout' => 0, // redis 超时时间
'persistent' => false, // redis 持续性,连接复用
]
]; ];

View File

@ -83,6 +83,8 @@ class Profile extends ManystoreBase
if ($this->request->isPost()) { if ($this->request->isPost()) {
$this->token(); $this->token();
$shop = $this->request->post("shop/a"); $shop = $this->request->post("shop/a");
if($shop["address_city"] && !$shop["province"])$this->error("请选择所在城市");
$shopModel = new ManystoreShop(); $shopModel = new ManystoreShop();
$shopModel->save($shop,array('id'=>SHOP_ID)); $shopModel->save($shop,array('id'=>SHOP_ID));

View File

@ -261,6 +261,12 @@ class ClassesLib extends ManystoreBase
} }
protected function update_classes($classes_lib_id){ protected function update_classes($classes_lib_id){
//课时数必须大于等于课时核销数
$count = \app\common\model\school\classes\ClassesSpec::where("classes_lib_id",$classes_lib_id)->count();
$classes_num = \app\common\model\school\classes\ClassesLib::where("id",$classes_lib_id)->value("classes_num");
if($count < $classes_num){
throw new \Exception("课时数必须大于等于课时核销数");
}
\app\common\model\school\classes\ClassesLib::update_classes($classes_lib_id); \app\common\model\school\classes\ClassesLib::update_classes($classes_lib_id);
} }
@ -286,17 +292,18 @@ class ClassesLib extends ManystoreBase
if($this->shopIdAutoCondition && SHOP_ID){ if($this->shopIdAutoCondition && SHOP_ID){
$params['shop_id'] = SHOP_ID; $params['shop_id'] = SHOP_ID;
} }
//是否采用模型验证
$result = false;
Db::startTrans();
try {
//是否采用模型验证
if ($this->modelValidate) { if ($this->modelValidate) {
$name = str_replace("\\model\\", "\\validate\\", get_class($this->model)); $name = str_replace("\\model\\", "\\validate\\", get_class($this->model));
$validate = is_bool($this->modelValidate) ? ($this->modelSceneValidate ? $name . '.add' : $name) : $this->modelValidate; $validate = is_bool($this->modelValidate) ? ($this->modelSceneValidate ? $name . '.add' : $name) : $this->modelValidate;
$this->model->validateFailException(true)->validate($validate); $this->model->validateFailException(true)->validate($validate);
} }
$this->update_check($params,$row=null); $this->update_check($params,$row=null);
$result = false;
Db::startTrans();
try {
$spec = $params["spec"]; $spec = $params["spec"];
unset($params["spec"]); unset($params["spec"]);
$result = $this->model->allowField(true)->save($params); $result = $this->model->allowField(true)->save($params);
@ -307,6 +314,13 @@ class ClassesLib extends ManystoreBase
\app\common\model\school\classes\ClassesSpec::create($v); \app\common\model\school\classes\ClassesSpec::create($v);
} }
//因为是批量添加,所有规格重新进行检测,防止出现时间重叠
$specss = \app\common\model\school\classes\ClassesSpec::where("classes_lib_id",$this->model["id"])->select();
foreach ($specss as $k=>$specs){
$params =$specs;
(new \app\common\model\school\classes\ClassesSpec)->specCheck($params,null,$specs);
}
$this->update_classes($this->model["id"]); $this->update_classes($this->model["id"]);
if($this->have_auth){ if($this->have_auth){
//调用通过事件 //调用通过事件
@ -323,7 +337,7 @@ class ClassesLib extends ManystoreBase
} catch (PDOException $e) { } catch (PDOException $e) {
Db::rollback(); Db::rollback();
$this->error($e->getMessage()); $this->error($e->getMessage());
} catch (Exception $e) { } catch (\Exception $e) {
Db::rollback(); Db::rollback();
$this->error($e->getMessage()); $this->error($e->getMessage());
} }
@ -389,7 +403,7 @@ class ClassesLib extends ManystoreBase
} catch (PDOException $e) { } catch (PDOException $e) {
Db::rollback(); Db::rollback();
$this->error($e->getMessage()); $this->error($e->getMessage());
} catch (Exception $e) { } catch (\Exception $e) {
Db::rollback(); Db::rollback();
$this->error($e->getMessage()); $this->error($e->getMessage());
} }
@ -421,17 +435,18 @@ class ClassesLib extends ManystoreBase
$params = $this->request->post("row/a"); $params = $this->request->post("row/a");
if ($params) { if ($params) {
$params = $this->preExcludeFields($params); $params = $this->preExcludeFields($params);
//是否采用模型验证
// 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 = false; $result = false;
Db::startTrans(); Db::startTrans();
try { 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);
$spec = $params["spec"] ?? [];//$params["delete_spec_ids"] $spec = $params["spec"] ?? [];//$params["delete_spec_ids"]
$delete_spec_ids = $params["delete_spec_ids"] ?? []; $delete_spec_ids = $params["delete_spec_ids"] ?? [];
@ -454,6 +469,14 @@ class ClassesLib extends ManystoreBase
$delete_spec->delete(); $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"]); $this->update_classes($row["id"]);
if($this->have_auth){ if($this->have_auth){
@ -471,7 +494,7 @@ class ClassesLib extends ManystoreBase
} catch (PDOException $e) { } catch (PDOException $e) {
Db::rollback(); Db::rollback();
$this->error($e->getMessage()); $this->error($e->getMessage());
} catch (Exception $e) { } catch (\Exception $e) {
Db::rollback(); Db::rollback();
$this->error($e->getMessage()); $this->error($e->getMessage());
} }

View File

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

View File

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

View File

@ -7,6 +7,7 @@ return [
'Email already exists' => '邮箱已经存在', 'Email already exists' => '邮箱已经存在',
'Please input correct nickname' => '昵称仅支持输入中文、英文字母(大小写)、数字、下划线', 'Please input correct nickname' => '昵称仅支持输入中文、英文字母(大小写)、数字、下划线',
'Please input length nickname' => '昵称请最多填写10个字符', 'Please input length nickname' => '昵称请最多填写10个字符',
'Loss_ratio' => '课程损耗比(百分制)',
'Front_idcard_image' => '身份证人像面', 'Front_idcard_image' => '身份证人像面',
'Reverse_idcard_image' => '身份证国徽面', 'Reverse_idcard_image' => '身份证国徽面',

View File

@ -22,6 +22,8 @@ return [
'Status -3' => '已取消', 'Status -3' => '已取消',
'Status 0' => '待支付', 'Status 0' => '待支付',
'Status 3' => '使用中', 'Status 3' => '使用中',
'Status 4' => '售后中',
'Set status to 4' => '设为售后中',
'Status 6' => '已退款', 'Status 6' => '已退款',
'Status 9' => '已完成', 'Status 9' => '已完成',
'Before_status' => '售后前状态', 'Before_status' => '售后前状态',

View File

@ -6,6 +6,8 @@ return [
'Status -3' => '已取消', 'Status -3' => '已取消',
'Status 0' => '待支付', 'Status 0' => '待支付',
'Status 3' => '使用中', 'Status 3' => '使用中',
'Status 4' => '售后中',
'Set status to 4' => '设为售后中',
'Status 6' => '已退款', 'Status 6' => '已退款',
'Status 9' => '已完成', 'Status 9' => '已完成',
'Before_status' => '售后前状态', 'Before_status' => '售后前状态',

View File

@ -0,0 +1,63 @@
<?php
return [
'Order_no' => '售后单号',
'Reason' => '售后申请原因',
'Classes_order_id' => '课程订单id',
'User_id' => '下单人id',
'Classes_order_detail_id' => '订单课程id',
'Classes_lib_id' => '课程id',
'Manystore_id' => '机构账号id',
'Shop_id' => '机构店铺id',
'Status' => '售后状态',
'Status 1' => '待处理',
'Status 4' => '处理中',
'Status 7' => '已结单',
'Status -3' => '已取消',
'Service_stauts' => '售后处理状态',
'Service_stauts 1' => '待机构处理',
'Service_stauts 4' => '待用户确认',
'Service_stauts 7' => '售后通过结单',
'Service_stauts -3' => '售后驳回结单',
'Sales_type' => '结单类型',
'Sales_type -3' => '未结单',
'Sales_type 1' => '机构驳回',
'Sales_type 4' => '用户驳回',
'Sales_type 7' => '平台驳回',
'Sales_type 10' => '成功退款',
'Reject_reason' => '驳回原因',
'Reject_images' => '驳回图片资料',
'Auto_price' => '自动计算应退全额',
'Loss_proportion' => '课程损耗比例',
'Auto_loss_price' => '自动计算损耗金额',
'Tbc_price' => '售后待确认退款金额',
'C_price' => '售后已确认退款金额',
'Real_refundprice' => '实际退款金额',
'Sub_refundprice' => '剩余未退金额',
'Platform' => '退款平台:miniapp=微信小程序',
'Pay_type' => '退款方式',
'Pay_type yue' => '余额',
'Pay_type wechat' => '微信',
'Pay_json' => '三方支付信息json',
'Deletetime' => '删除时间',
'Refundtime' => '退款时间',
'Rejecttime' => '驳回时间',
'Handletime' => '处理时间',
'Confirmtime' => '确认时间',
'Checkouttime' => '结单时间',
'Createtime' => '创建时间',
'Updatetime' => '修改时间',
'Schoolclassesorder.order_no' => '订单号',
'Schoolclassesorder.pay_no' => '微信支付单号',
'User.nickname' => '昵称',
'User.realname' => '真实姓名',
'User.mobile' => '手机号',
'User.avatar' => '头像',
'Schoolclassesorderdetail.title' => '标题',
'Schoolclassesorderdetail.headimage' => '头图',
'Schoolclasseslib.title' => '标题',
'Schoolclasseslib.headimage' => '头图',
'Manystore.nickname' => '昵称',
'Manystoreshop.name' => '店铺名称',
'Manystoreshop.logo' => '品牌LOGO'
];

View File

@ -0,0 +1,41 @@
<?php
return [
'Classes_service_order_id' => '课程售后订单id',
'Classes_order_id' => '课程订单id',
'User_id' => '下单人id',
'Classes_order_detail_id' => '订单课程id',
'Classes_lib_id' => '课程id',
'Manystore_id' => '机构账号id',
'Shop_id' => '机构店铺id',
'Status' => '售后状态',
'Status 1' => '待处理',
'Status 4' => '处理中',
'Status 7' => '已结单',
'Status -3' => '已取消',
'Service_stauts' => '售后处理状态',
'Service_stauts 1' => '待机构处理',
'Service_stauts 4' => '待用户确认',
'Service_stauts 7' => '售后通过结单',
'Service_stauts -3' => '售后驳回结单',
'Sales_type' => '结单类型',
'Sales_type -3' => '未结单',
'Sales_type 1' => '机构驳回',
'Sales_type 4' => '用户驳回',
'Sales_type 7' => '平台驳回',
'Sales_type 10' => '成功退款',
'Log_text' => '记录内容',
'Oper_id' => '记录人id',
'Oper_type' => '记录人类型',
'Createtime' => '创建时间',
'Updatetime' => '修改时间',
'Schoolclassesserviceorder.order_no' => '售后单号',
'Schoolclassesorder.order_no' => '订单号',
'Schoolclassesorder.pay_no' => '微信支付单号',
'User.nickname' => '昵称',
'User.realname' => '真实姓名',
'User.mobile' => '手机号',
'User.avatar' => '头像',
'Schoolclassesorderdetail.title' => '标题',
'Admin.nickname' => '昵称'
];

View File

@ -45,7 +45,7 @@ class Order extends Model
public function getStatusList() public function getStatusList()
{ {
return ['-3' => __('Status -3'), '0' => __('Status 0'), '3' => __('Status 3'), '6' => __('Status 6'), '9' => __('Status 9')]; return ['-3' => __('Status -3'), '0' => __('Status 0'), '3' => __('Status 3'),'4' => __('Status 4'), '6' => __('Status 6'), '9' => __('Status 9')];
} }
public function getBeforeStatusList() public function getBeforeStatusList()

View File

@ -35,7 +35,7 @@ class OrderLog extends Model
public function getStatusList() public function getStatusList()
{ {
return ['-3' => __('Status -3'), '0' => __('Status 0'), '3' => __('Status 3'), '6' => __('Status 6'), '9' => __('Status 9')]; return ['-3' => __('Status -3'), '0' => __('Status 0'), '3' => __('Status 3'),'4' => __('Status 4'), '6' => __('Status 6'), '9' => __('Status 9')];
} }
public function getBeforeStatusList() public function getBeforeStatusList()

View File

@ -0,0 +1,205 @@
<?php
namespace app\manystore\model\school\classes\order;
use addons\manystore\Manystore;
use app\common\model\dyqc\ManystoreShop;
use app\manystore\model\school\classes\ClassesLib;
use think\Model;
use traits\model\SoftDelete;
class ServiceOrder extends Model
{
use SoftDelete;
// 表名
protected $name = 'school_classes_service_order';
// 自动写入时间戳字段
protected $autoWriteTimestamp = 'int';
// 定义时间戳字段名
protected $createTime = 'createtime';
protected $updateTime = 'updatetime';
protected $deleteTime = 'deletetime';
// 追加属性
protected $append = [
'status_text',
'service_stauts_text',
'sales_type_text',
'platform_text',
'pay_type_text',
'refundtime_text',
'rejecttime_text',
'handletime_text',
'confirmtime_text',
'checkouttime_text'
];
public function getStatusList()
{
return ['1' => __('Status 1'), '4' => __('Status 4'), '7' => __('Status 7'), '-3' => __('Status -3')];
}
public function getServiceStautsList()
{
return ['1' => __('Service_stauts 1'), '4' => __('Service_stauts 4'), '7' => __('Service_stauts 7'), '-3' => __('Service_stauts -3')];
}
public function getSalesTypeList()
{
return ['-3' => __('Sales_type -3'), '1' => __('Sales_type 1'), '4' => __('Sales_type 4'), '7' => __('Sales_type 7'), '10' => __('Sales_type 10')];
}
public function getPlatformList()
{
return ['miniapp' => __('Miniapp')];
}
public function getPayTypeList()
{
return ['yue' => __('Pay_type yue'), 'wechat' => __('Pay_type wechat')];
}
public function getStatusTextAttr($value, $data)
{
$value = $value ? $value : (isset($data['status']) ? $data['status'] : '');
$list = $this->getStatusList();
return isset($list[$value]) ? $list[$value] : '';
}
public function getServiceStautsTextAttr($value, $data)
{
$value = $value ? $value : (isset($data['service_stauts']) ? $data['service_stauts'] : '');
$list = $this->getServiceStautsList();
return isset($list[$value]) ? $list[$value] : '';
}
public function getSalesTypeTextAttr($value, $data)
{
$value = $value ? $value : (isset($data['sales_type']) ? $data['sales_type'] : '');
$list = $this->getSalesTypeList();
return isset($list[$value]) ? $list[$value] : '';
}
public function getPlatformTextAttr($value, $data)
{
$value = $value ? $value : (isset($data['platform']) ? $data['platform'] : '');
$list = $this->getPlatformList();
return isset($list[$value]) ? $list[$value] : '';
}
public function getPayTypeTextAttr($value, $data)
{
$value = $value ? $value : (isset($data['pay_type']) ? $data['pay_type'] : '');
$list = $this->getPayTypeList();
return isset($list[$value]) ? $list[$value] : '';
}
public function getRefundtimeTextAttr($value, $data)
{
$value = $value ? $value : (isset($data['refundtime']) ? $data['refundtime'] : '');
return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
}
public function getRejecttimeTextAttr($value, $data)
{
$value = $value ? $value : (isset($data['rejecttime']) ? $data['rejecttime'] : '');
return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
}
public function getHandletimeTextAttr($value, $data)
{
$value = $value ? $value : (isset($data['handletime']) ? $data['handletime'] : '');
return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
}
public function getConfirmtimeTextAttr($value, $data)
{
$value = $value ? $value : (isset($data['confirmtime']) ? $data['confirmtime'] : '');
return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
}
public function getCheckouttimeTextAttr($value, $data)
{
$value = $value ? $value : (isset($data['checkouttime']) ? $data['checkouttime'] : '');
return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
}
protected function setRefundtimeAttr($value)
{
return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
}
protected function setRejecttimeAttr($value)
{
return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
}
protected function setHandletimeAttr($value)
{
return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
}
protected function setConfirmtimeAttr($value)
{
return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
}
protected function setCheckouttimeAttr($value)
{
return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
}
public function schoolclassesorder()
{
return $this->belongsTo(Order::class, 'classes_order_id', 'id', [], 'LEFT')->setEagerlyType(0);
}
public function user()
{
return $this->belongsTo('app\common\model\User', 'user_id', 'id', [], 'LEFT')->setEagerlyType(0);
}
public function schoolclassesorderdetail()
{
return $this->belongsTo(OrderDetail::class, 'classes_order_detail_id', 'id', [], 'LEFT')->setEagerlyType(0);
}
public function schoolclasseslib()
{
return $this->belongsTo(ClassesLib::class, 'classes_lib_id', 'id', [], 'LEFT')->setEagerlyType(0);
}
public function manystore()
{
return $this->belongsTo(\app\manystore\model\Manystore::class, 'manystore_id', 'id', [], 'LEFT')->setEagerlyType(0);
}
public function manystoreshop()
{
return $this->belongsTo(ManystoreShop::class, 'shop_id', 'id', [], 'LEFT')->setEagerlyType(0);
}
}

View File

@ -0,0 +1,106 @@
<?php
namespace app\manystore\model\school\classes\order;
use app\manystore\model\Admin;
use think\Model;
class ServiceOrderLog extends Model
{
// 表名
protected $name = 'school_classes_service_order_log';
// 自动写入时间戳字段
protected $autoWriteTimestamp = 'int';
// 定义时间戳字段名
protected $createTime = 'createtime';
protected $updateTime = 'updatetime';
protected $deleteTime = false;
// 追加属性
protected $append = [
'status_text',
'service_stauts_text',
'sales_type_text'
];
public function getStatusList()
{
return ['1' => __('Status 1'), '4' => __('Status 4'), '7' => __('Status 7'), '-3' => __('Status -3')];
}
public function getServiceStautsList()
{
return ['1' => __('Service_stauts 1'), '4' => __('Service_stauts 4'), '7' => __('Service_stauts 7'), '-3' => __('Service_stauts -3')];
}
public function getSalesTypeList()
{
return ['-3' => __('Sales_type -3'), '1' => __('Sales_type 1'), '4' => __('Sales_type 4'), '7' => __('Sales_type 7'), '10' => __('Sales_type 10')];
}
public function getStatusTextAttr($value, $data)
{
$value = $value ? $value : (isset($data['status']) ? $data['status'] : '');
$list = $this->getStatusList();
return isset($list[$value]) ? $list[$value] : '';
}
public function getServiceStautsTextAttr($value, $data)
{
$value = $value ? $value : (isset($data['service_stauts']) ? $data['service_stauts'] : '');
$list = $this->getServiceStautsList();
return isset($list[$value]) ? $list[$value] : '';
}
public function getSalesTypeTextAttr($value, $data)
{
$value = $value ? $value : (isset($data['sales_type']) ? $data['sales_type'] : '');
$list = $this->getSalesTypeList();
return isset($list[$value]) ? $list[$value] : '';
}
public function schoolclassesserviceorder()
{
return $this->belongsTo(ServiceOrder::class, 'classes_service_order_id', 'id', [], 'LEFT')->setEagerlyType(0);
}
public function schoolclassesorder()
{
return $this->belongsTo(Order::class, 'classes_order_id', 'id', [], 'LEFT')->setEagerlyType(0);
}
public function user()
{
return $this->belongsTo('app\common\model\User', 'user_id', 'id', [], 'LEFT')->setEagerlyType(0);
}
public function schoolclassesorderdetail()
{
return $this->belongsTo(OrderDetail::class, 'classes_order_detail_id', 'id', [], 'LEFT')->setEagerlyType(0);
}
public function admin()
{
return $this->belongsTo(Admin::class, 'oper_id', 'id', [], 'LEFT')->setEagerlyType(0);
}
}

View File

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

View File

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

View File

@ -158,7 +158,7 @@
<div class="form-group"> <div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Classes_num')}:</label> <label class="control-label col-xs-12 col-sm-2">{:__('Classes_num')}:</label>
<div class="col-xs-12 col-sm-8"> <div class="col-xs-12 col-sm-8">
<input id="c-classes_num" class="form-control" data-rule="required" name="row[classes_num]" type="number" value="{$row.classes_num|htmlentities}"> <input id="c-classes_num" class="form-control" disabled data-rule="required" name="row[classes_num]" type="number" value="{$row.classes_num|htmlentities}">
<span style="color: red">(填写几节意味着客户购买课程后能预约上课核销几次,即购买本课程的课程节数)</span> <span style="color: red">(填写几节意味着客户购买课程后能预约上课核销几次,即购买本课程的课程节数)</span>
</div> </div>

View File

@ -0,0 +1,214 @@
<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">{:__('Order_no')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-order_no" data-rule="required" class="form-control" name="row[order_no]" type="text">
</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="classes/order/index" class="form-control selectpage" name="row[classes_order_id]" type="text" value="">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('User_id')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-user_id" data-rule="required" data-source="user/user/index" data-field="nickname" class="form-control selectpage" name="row[user_id]" type="text" value="">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Classes_order_detail_id')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-classes_order_detail_id" data-rule="required" data-source="classes/order/detail/index" class="form-control selectpage" name="row[classes_order_detail_id]" type="text" value="">
</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="classes/lib/index" class="form-control selectpage" name="row[classes_lib_id]" type="text" value="">
</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="">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Status')}:</label>
<div class="col-xs-12 col-sm-8">
<div class="radio">
{foreach name="statusList" item="vo"}
<label for="row[status]-{$key}"><input id="row[status]-{$key}" name="row[status]" type="radio" value="{$key}" {in name="key" value="1"}checked{/in} /> {$vo}</label>
{/foreach}
</div>
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Service_stauts')}:</label>
<div class="col-xs-12 col-sm-8">
<select id="c-service_stauts" data-rule="required" class="form-control selectpicker" name="row[service_stauts]">
{foreach name="serviceStautsList" item="vo"}
<option value="{$key}" {in name="key" value="1"}selected{/in}>{$vo}</option>
{/foreach}
</select>
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Sales_type')}:</label>
<div class="col-xs-12 col-sm-8">
<select id="c-sales_type" data-rule="required" class="form-control selectpicker" name="row[sales_type]">
{foreach name="salesTypeList" item="vo"}
<option value="{$key}" {in name="key" value="-3"}selected{/in}>{$vo}</option>
{/foreach}
</select>
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Reject_reason')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-reject_reason" class="form-control" name="row[reject_reason]" type="text">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Reject_images')}:</label>
<div class="col-xs-12 col-sm-8">
<div class="input-group">
<input id="c-reject_images" class="form-control" size="50" name="row[reject_images]" type="text">
<div class="input-group-addon no-border no-padding">
<span><button type="button" id="faupload-reject_images" class="btn btn-danger faupload" data-input-id="c-reject_images" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp" data-multiple="true" data-preview-id="p-reject_images"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
<span><button type="button" id="fachoose-reject_images" class="btn btn-primary fachoose" data-input-id="c-reject_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-reject_images"></span>
</div>
<ul class="row list-inline faupload-preview" id="p-reject_images"></ul>
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Auto_price')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-auto_price" data-rule="required" class="form-control" step="0.01" name="row[auto_price]" type="number">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Loss_proportion')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-loss_proportion" data-rule="required" class="form-control" step="0.01" name="row[loss_proportion]" type="number">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Auto_loss_price')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-auto_loss_price" data-rule="required" class="form-control" step="0.01" name="row[auto_loss_price]" type="number">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Tbc_price')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-tbc_price" data-rule="required" class="form-control" step="0.01" name="row[tbc_price]" type="number">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('C_price')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-c_price" data-rule="required" class="form-control" step="0.01" name="row[c_price]" type="number">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Real_refundprice')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-real_refundprice" class="form-control" step="0.01" name="row[real_refundprice]" type="number">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Sub_refundprice')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-sub_refundprice" class="form-control" step="0.01" name="row[sub_refundprice]" type="number">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Platform')}:</label>
<div class="col-xs-12 col-sm-8">
<select id="c-platform" class="form-control selectpicker" name="row[platform]">
{foreach name="platformList" item="vo"}
<option value="{$key}" {in name="key" value=""}selected{/in}>{$vo}</option>
{/foreach}
</select>
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Pay_type')}:</label>
<div class="col-xs-12 col-sm-8">
<select id="c-pay_type" class="form-control selectpicker" name="row[pay_type]">
{foreach name="payTypeList" item="vo"}
<option value="{$key}" {in name="key" value="wechat"}selected{/in}>{$vo}</option>
{/foreach}
</select>
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Pay_json')}:</label>
<div class="col-xs-12 col-sm-8">
<dl class="fieldlist" data-name="row[pay_json]">
<dd>
<ins>{:__('Key')}</ins>
<ins>{:__('Value')}</ins>
</dd>
<dd><a href="javascript:;" class="btn btn-sm btn-success btn-append"><i class="fa fa-plus"></i> {:__('Append')}</a></dd>
<textarea name="row[pay_json]" class="form-control hide" cols="30" rows="5"></textarea>
</dl>
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Refundtime')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-refundtime" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[refundtime]" 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">{:__('Rejecttime')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-rejecttime" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[rejecttime]" 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">{:__('Handletime')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-handletime" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[handletime]" 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">{:__('Confirmtime')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-confirmtime" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[confirmtime]" 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">{:__('Checkouttime')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-checkouttime" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[checkouttime]" type="text" value="{:date('Y-m-d H:i:s')}">
</div>
</div>
<div class="form-group layer-footer">
<label class="control-label col-xs-12 col-sm-2"></label>
<div class="col-xs-12 col-sm-8">
<button type="submit" class="btn btn-success btn-embossed disabled">{:__('OK')}</button>
<button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
</div>
</div>
</form>

View File

@ -0,0 +1,214 @@
<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">{:__('Order_no')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-order_no" data-rule="required" class="form-control" name="row[order_no]" type="text" value="{$row.order_no|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="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">{:__('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_order_detail_id')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-classes_order_detail_id" data-rule="required" data-source="classes/order/detail/index" class="form-control selectpage" name="row[classes_order_detail_id]" type="text" value="{$row.classes_order_detail_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="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">{:__('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">{:__('Status')}:</label>
<div class="col-xs-12 col-sm-8">
<div class="radio">
{foreach name="statusList" item="vo"}
<label for="row[status]-{$key}"><input id="row[status]-{$key}" name="row[status]" type="radio" value="{$key}" {in name="key" value="$row.status"}checked{/in} /> {$vo}</label>
{/foreach}
</div>
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Service_stauts')}:</label>
<div class="col-xs-12 col-sm-8">
<select id="c-service_stauts" data-rule="required" class="form-control selectpicker" name="row[service_stauts]">
{foreach name="serviceStautsList" item="vo"}
<option value="{$key}" {in name="key" value="$row.service_stauts"}selected{/in}>{$vo}</option>
{/foreach}
</select>
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Sales_type')}:</label>
<div class="col-xs-12 col-sm-8">
<select id="c-sales_type" data-rule="required" class="form-control selectpicker" name="row[sales_type]">
{foreach name="salesTypeList" item="vo"}
<option value="{$key}" {in name="key" value="$row.sales_type"}selected{/in}>{$vo}</option>
{/foreach}
</select>
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Reject_reason')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-reject_reason" class="form-control" name="row[reject_reason]" type="text" value="{$row.reject_reason|htmlentities}">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Reject_images')}:</label>
<div class="col-xs-12 col-sm-8">
<div class="input-group">
<input id="c-reject_images" class="form-control" size="50" name="row[reject_images]" type="text" value="{$row.reject_images|htmlentities}">
<div class="input-group-addon no-border no-padding">
<span><button type="button" id="faupload-reject_images" class="btn btn-danger faupload" data-input-id="c-reject_images" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp" data-multiple="true" data-preview-id="p-reject_images"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
<span><button type="button" id="fachoose-reject_images" class="btn btn-primary fachoose" data-input-id="c-reject_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-reject_images"></span>
</div>
<ul class="row list-inline faupload-preview" id="p-reject_images"></ul>
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Auto_price')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-auto_price" data-rule="required" class="form-control" step="0.01" name="row[auto_price]" type="number" value="{$row.auto_price|htmlentities}">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Loss_proportion')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-loss_proportion" data-rule="required" class="form-control" step="0.01" name="row[loss_proportion]" type="number" value="{$row.loss_proportion|htmlentities}">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Auto_loss_price')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-auto_loss_price" data-rule="required" class="form-control" step="0.01" name="row[auto_loss_price]" type="number" value="{$row.auto_loss_price|htmlentities}">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Tbc_price')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-tbc_price" data-rule="required" class="form-control" step="0.01" name="row[tbc_price]" type="number" value="{$row.tbc_price|htmlentities}">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('C_price')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-c_price" data-rule="required" class="form-control" step="0.01" name="row[c_price]" type="number" value="{$row.c_price|htmlentities}">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Real_refundprice')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-real_refundprice" class="form-control" step="0.01" name="row[real_refundprice]" type="number" value="{$row.real_refundprice|htmlentities}">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Sub_refundprice')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-sub_refundprice" class="form-control" step="0.01" name="row[sub_refundprice]" type="number" value="{$row.sub_refundprice|htmlentities}">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Platform')}:</label>
<div class="col-xs-12 col-sm-8">
<select id="c-platform" class="form-control selectpicker" name="row[platform]">
{foreach name="platformList" item="vo"}
<option value="{$key}" {in name="key" value="$row.platform"}selected{/in}>{$vo}</option>
{/foreach}
</select>
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Pay_type')}:</label>
<div class="col-xs-12 col-sm-8">
<select id="c-pay_type" class="form-control selectpicker" name="row[pay_type]">
{foreach name="payTypeList" item="vo"}
<option value="{$key}" {in name="key" value="$row.pay_type"}selected{/in}>{$vo}</option>
{/foreach}
</select>
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Pay_json')}:</label>
<div class="col-xs-12 col-sm-8">
<dl class="fieldlist" data-name="row[pay_json]">
<dd>
<ins>{:__('Key')}</ins>
<ins>{:__('Value')}</ins>
</dd>
<dd><a href="javascript:;" class="btn btn-sm btn-success btn-append"><i class="fa fa-plus"></i> {:__('Append')}</a></dd>
<textarea name="row[pay_json]" class="form-control hide" cols="30" rows="5">{$row.pay_json|htmlentities}</textarea>
</dl>
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Refundtime')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-refundtime" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[refundtime]" type="text" value="{:$row.refundtime?datetime($row.refundtime):''}">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Rejecttime')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-rejecttime" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[rejecttime]" type="text" value="{:$row.rejecttime?datetime($row.rejecttime):''}">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Handletime')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-handletime" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[handletime]" type="text" value="{:$row.handletime?datetime($row.handletime):''}">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Confirmtime')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-confirmtime" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[confirmtime]" type="text" value="{:$row.confirmtime?datetime($row.confirmtime):''}">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Checkouttime')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-checkouttime" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[checkouttime]" type="text" value="{:$row.checkouttime?datetime($row.checkouttime):''}">
</div>
</div>
<div class="form-group layer-footer">
<label class="control-label col-xs-12 col-sm-2"></label>
<div class="col-xs-12 col-sm-8">
<button type="submit" class="btn btn-success btn-embossed disabled">{:__('OK')}</button>
<button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
</div>
</div>
</form>

View File

@ -0,0 +1,44 @@
<div class="panel panel-default panel-intro">
<div class="panel-heading">
{:build_heading(null,FALSE)}
<ul class="nav nav-tabs" data-field="status">
<li class="{:$Think.get.status === null ? 'active' : ''}"><a href="#t-all" data-value="" data-toggle="tab">{:__('All')}</a></li>
{foreach name="statusList" item="vo"}
<li class="{:$Think.get.status === (string)$key ? 'active' : ''}"><a href="#t-{$key}" data-value="{$key}" data-toggle="tab">{$vo}</a></li>
{/foreach}
</ul>
</div>
<div class="panel-body">
<div id="myTabContent" class="tab-content">
<div class="tab-pane fade active in" id="one">
<div class="widget-body no-padding">
<div id="toolbar" class="toolbar">
<a href="javascript:;" class="btn btn-primary btn-refresh" title="{:__('Refresh')}" ><i class="fa fa-refresh"></i> </a>
<a href="javascript:;" class="btn btn-success btn-add {:$auth->check('school/classes/order/service_order/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/order/service_order/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/order/service_order/del')?'':'hide'}" title="{:__('Delete')}" ><i class="fa fa-trash"></i> {:__('Delete')}</a>
<div class="dropdown btn-group {:$auth->check('school/classes/order/service_order/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>
<a class="btn btn-success btn-recyclebin btn-dialog {:$auth->check('school/classes/order/service_order/recyclebin')?'':'hide'}" href="school/classes/order/service_order/recyclebin" title="{:__('Recycle bin')}"><i class="fa fa-recycle"></i> {:__('Recycle bin')}</a>
</div>
<table id="table" class="table table-striped table-bordered table-hover table-nowrap"
data-operate-edit="{:$auth->check('school/classes/order/service_order/edit')}"
data-operate-del="{:$auth->check('school/classes/order/service_order/del')}"
width="100%">
</table>
</div>
</div>
</div>
</div>
</div>

View File

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

View File

@ -0,0 +1,100 @@
<form id="add-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Classes_service_order_id')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-classes_service_order_id" data-rule="required" data-source="classes/service/order/index" class="form-control selectpage" name="row[classes_service_order_id]" type="text" value="">
</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="classes/order/index" class="form-control selectpage" name="row[classes_order_id]" type="text" value="">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('User_id')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-user_id" data-rule="required" data-source="user/user/index" data-field="nickname" class="form-control selectpage" name="row[user_id]" type="text" value="">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Classes_order_detail_id')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-classes_order_detail_id" data-rule="required" data-source="classes/order/detail/index" class="form-control selectpage" name="row[classes_order_detail_id]" type="text" value="">
</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="classes/lib/index" class="form-control selectpage" name="row[classes_lib_id]" type="text" value="">
</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="">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Status')}:</label>
<div class="col-xs-12 col-sm-8">
<div class="radio">
{foreach name="statusList" item="vo"}
<label for="row[status]-{$key}"><input id="row[status]-{$key}" name="row[status]" type="radio" value="{$key}" {in name="key" value="1"}checked{/in} /> {$vo}</label>
{/foreach}
</div>
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Service_stauts')}:</label>
<div class="col-xs-12 col-sm-8">
<select id="c-service_stauts" data-rule="required" class="form-control selectpicker" name="row[service_stauts]">
{foreach name="serviceStautsList" item="vo"}
<option value="{$key}" {in name="key" value="1"}selected{/in}>{$vo}</option>
{/foreach}
</select>
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Sales_type')}:</label>
<div class="col-xs-12 col-sm-8">
<select id="c-sales_type" data-rule="required" class="form-control selectpicker" name="row[sales_type]">
{foreach name="salesTypeList" item="vo"}
<option value="{$key}" {in name="key" value="-3"}selected{/in}>{$vo}</option>
{/foreach}
</select>
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Log_text')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-log_text" class="form-control" name="row[log_text]" type="text">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Oper_id')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-oper_id" data-rule="required" data-source="oper/index" class="form-control selectpage" name="row[oper_id]" type="text" value="">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Oper_type')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-oper_type" class="form-control" name="row[oper_type]" type="text">
</div>
</div>
<div class="form-group layer-footer">
<label class="control-label col-xs-12 col-sm-2"></label>
<div class="col-xs-12 col-sm-8">
<button type="submit" class="btn btn-success btn-embossed disabled">{:__('OK')}</button>
<button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
</div>
</div>
</form>

View File

@ -0,0 +1,100 @@
<form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Classes_service_order_id')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-classes_service_order_id" data-rule="required" data-source="classes/service/order/index" class="form-control selectpage" name="row[classes_service_order_id]" type="text" value="{$row.classes_service_order_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="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">{:__('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_order_detail_id')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-classes_order_detail_id" data-rule="required" data-source="classes/order/detail/index" class="form-control selectpage" name="row[classes_order_detail_id]" type="text" value="{$row.classes_order_detail_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="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">{:__('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">{:__('Status')}:</label>
<div class="col-xs-12 col-sm-8">
<div class="radio">
{foreach name="statusList" item="vo"}
<label for="row[status]-{$key}"><input id="row[status]-{$key}" name="row[status]" type="radio" value="{$key}" {in name="key" value="$row.status"}checked{/in} /> {$vo}</label>
{/foreach}
</div>
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Service_stauts')}:</label>
<div class="col-xs-12 col-sm-8">
<select id="c-service_stauts" data-rule="required" class="form-control selectpicker" name="row[service_stauts]">
{foreach name="serviceStautsList" item="vo"}
<option value="{$key}" {in name="key" value="$row.service_stauts"}selected{/in}>{$vo}</option>
{/foreach}
</select>
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Sales_type')}:</label>
<div class="col-xs-12 col-sm-8">
<select id="c-sales_type" data-rule="required" class="form-control selectpicker" name="row[sales_type]">
{foreach name="salesTypeList" item="vo"}
<option value="{$key}" {in name="key" value="$row.sales_type"}selected{/in}>{$vo}</option>
{/foreach}
</select>
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Log_text')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-log_text" class="form-control" name="row[log_text]" type="text" value="{$row.log_text|htmlentities}">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Oper_id')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-oper_id" data-rule="required" data-source="oper/index" class="form-control selectpage" name="row[oper_id]" type="text" value="{$row.oper_id|htmlentities}">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Oper_type')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-oper_type" class="form-control" name="row[oper_type]" type="text" value="{$row.oper_type|htmlentities}">
</div>
</div>
<div class="form-group layer-footer">
<label class="control-label col-xs-12 col-sm-2"></label>
<div class="col-xs-12 col-sm-8">
<button type="submit" class="btn btn-success btn-embossed disabled">{:__('OK')}</button>
<button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
</div>
</div>
</form>

View File

@ -0,0 +1,44 @@
<div class="panel panel-default panel-intro">
<div class="panel-heading">
{:build_heading(null,FALSE)}
<ul class="nav nav-tabs" data-field="status">
<li class="{:$Think.get.status === null ? 'active' : ''}"><a href="#t-all" data-value="" data-toggle="tab">{:__('All')}</a></li>
{foreach name="statusList" item="vo"}
<li class="{:$Think.get.status === (string)$key ? 'active' : ''}"><a href="#t-{$key}" data-value="{$key}" data-toggle="tab">{$vo}</a></li>
{/foreach}
</ul>
</div>
<div class="panel-body">
<div id="myTabContent" class="tab-content">
<div class="tab-pane fade active in" id="one">
<div class="widget-body no-padding">
<div id="toolbar" class="toolbar">
<a href="javascript:;" class="btn btn-primary btn-refresh" title="{:__('Refresh')}" ><i class="fa fa-refresh"></i> </a>
<a href="javascript:;" class="btn btn-success btn-add {:$auth->check('school/classes/order/service_order_log/add')?'':'hide'}" title="{:__('Add')}" ><i class="fa fa-plus"></i> {:__('Add')}</a>
<a href="javascript:;" class="btn btn-success btn-edit btn-disabled disabled {:$auth->check('school/classes/order/service_order_log/edit')?'':'hide'}" title="{:__('Edit')}" ><i class="fa fa-pencil"></i> {:__('Edit')}</a>
<a href="javascript:;" class="btn btn-danger btn-del btn-disabled disabled {:$auth->check('school/classes/order/service_order_log/del')?'':'hide'}" title="{:__('Delete')}" ><i class="fa fa-trash"></i> {:__('Delete')}</a>
<div class="dropdown btn-group {:$auth->check('school/classes/order/service_order_log/multi')?'':'hide'}">
<a class="btn btn-primary btn-more dropdown-toggle btn-disabled disabled" data-toggle="dropdown"><i class="fa fa-cog"></i> {:__('More')}</a>
<ul class="dropdown-menu text-left" role="menu">
<li><a class="btn btn-link btn-multi btn-disabled disabled" href="javascript:;" data-params="status=normal"><i class="fa fa-eye"></i> {:__('Set to normal')}</a></li>
<li><a class="btn btn-link btn-multi btn-disabled disabled" href="javascript:;" data-params="status=hidden"><i class="fa fa-eye-slash"></i> {:__('Set to hidden')}</a></li>
</ul>
</div>
</div>
<table id="table" class="table table-striped table-bordered table-hover table-nowrap"
data-operate-edit="{:$auth->check('school/classes/order/service_order_log/edit')}"
data-operate-del="{:$auth->check('school/classes/order/service_order_log/del')}"
width="100%">
</table>
</div>
</div>
</div>
</div>
</div>

View File

@ -17,12 +17,12 @@
</span> </span>
</div> </div>
</div> </div>
<div class="form-group"> <!-- <div class="form-group">-->
<label class="control-label col-xs-12 col-sm-2">{:__('Classes_lib_ids')}:</label> <!-- <label class="control-label col-xs-12 col-sm-2">{:__('Classes_lib_ids')}:</label>-->
<div class="col-xs-12 col-sm-8"> <!-- <div class="col-xs-12 col-sm-8">-->
<input id="c-classes_lib_ids" data-rule="required" data-source="school/classes/classes_lib/index" data-field="title" data-multiple="true" class="form-control selectpage" name="row[classes_lib_ids]" type="text" value=""> <!-- <input id="c-classes_lib_ids" data-rule="required" data-source="school/classes/classes_lib/index" data-field="title" data-multiple="true" class="form-control selectpage" name="row[classes_lib_ids]" type="text" value="">-->
</div> <!-- </div>-->
</div> <!-- </div>-->
<div class="form-group"> <div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Status')}:</label> <label class="control-label col-xs-12 col-sm-2">{:__('Status')}:</label>
<div class="col-xs-12 col-sm-8"> <div class="col-xs-12 col-sm-8">

View File

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

68
extend/bw/Redis.php Normal file
View File

@ -0,0 +1,68 @@
<?php
namespace bw;
class Redis
{
protected $handler = null;
protected $options = [
'host' => '127.0.0.1',
'port' => 6379,
'password' => '',
'select' => 0,
'timeout' => 0,
'expire' => 0,
'persistent' => false,
'prefix' => '',
];
/**
* 构造函数
* @param array $options 缓存参数
* @access public
*/
public function __construct($options = [])
{
if (!extension_loaded('redis')) {
throw new \BadFunctionCallException('not support: redis');
}
// 获取 redis 配置
$config = \think\Config::get('redis');
if (empty($config) && empty($options)) {
throw new \Exception('redis connection fail: no redis config');
}
if (!empty($config)) {
$this->options = array_merge($this->options, $config);
}
if (!empty($options)) {
$this->options = array_merge($this->options, $options);
}
$this->handler = new \Redis();
if ($this->options['persistent']) {
$this->handler->pconnect($this->options['host'], $this->options['port'], $this->options['timeout'], 'persistent_id_' . $this->options['select']);
} else {
$this->handler->connect($this->options['host'], $this->options['port'], $this->options['timeout']);
}
if ('' != $this->options['password']) {
$this->handler->auth($this->options['password']);
}
if (0 != $this->options['select']) {
$this->handler->select($this->options['select']);
}
// 赋值全局,避免多次实例化
$GLOBALS['SPREDIS'] = $this->handler;
}
public function getRedis() {
return $this->handler;
}
}

View File

@ -1,14 +1,9 @@
<?php <?php
namespace traits; namespace traits;
use addons\shopro\exception\Exception;
use addons\shopro\library\Redis; use bw\Redis;
use addons\shopro\model\Activity;
use addons\shopro\model\ActivityGoodsSkuPrice;
use addons\shopro\model\Goods;
use addons\shopro\model\GoodsSkuPrice;
use addons\shopro\model\OrderItem;
use addons\shopro\model\ScoreGoodsSkuPrice;
/** /**
* 缓存 * 缓存

View File

@ -148,22 +148,26 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
{field: 'auth_time', title: __('Auth_time'), operate:'RANGE',visible:false, addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime}, {field: 'auth_time', title: __('Auth_time'), operate:'RANGE',visible:false, addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
{field: 'type', title: __('Type'), searchList: {"out":__('Type out'),"in":__('Type in')}, formatter: Table.api.formatter.normal}, {field: 'type', title: __('Type'), searchList: {"out":__('Type out'),"in":__('Type in')}, formatter: Table.api.formatter.normal},
{field: 'classes_num', title: __('Classes_num')}, {field: 'classes_num', title: __('Classes_num'),sortable:true},
{field: 'limit_num', title: __('Limit_num'),sortable:true},
{field: 'sign_num', title: __('Sign_num'),sortable:true},
{field: 'verification_num', title: __('Verification_num'),sortable:true},
{field: 'collect', title: __('实际收藏量'),sortable:true},
{field: 'views', title: __('浏览量'),sortable:true},
{field: 'limit_num', title: __('Limit_num')},
{field: 'sign_num', title: __('Sign_num')},
{field: 'verification_num', title: __('Verification_num')},
{field: 'address_type', title: __('Address_type'), searchList: {"1":__('Address_type 1'),"2":__('Address_type 2')}, formatter: Table.api.formatter.normal}, {field: 'address_type', title: __('Address_type'), searchList: {"1":__('Address_type 1'),"2":__('Address_type 2')}, formatter: Table.api.formatter.normal},
{field: 'sale', title: __('Sale')}, {field: 'sale', title: __('Sale'),sortable:true},
{field: 'price', title: __('Price'), operate:'BETWEEN'}, {field: 'price', title: __('Price'),sortable:true, operate:'BETWEEN'},
{field: 'underline_price', title: __('Underline_price'), operate:'BETWEEN'}, {field: 'underline_price', title: __('Underline_price'),sortable:true, operate:'BETWEEN'},
{field: 'admin_id', title: __('Admin_id'),visible:false}, {field: 'admin_id', title: __('Admin_id'),visible:false},
{field: 'weigh', title: __('Weigh'), operate: false}, {field: 'weigh', title: __('Weigh'),sortable:true, operate: false},
{field: 'recommend', title: __('Recommend'), searchList: {"0":__('Recommend 0'),"1":__('Recommend 1')}, formatter: Table.api.formatter.normal}, {field: 'recommend', title: __('Recommend'),sortable:true, searchList: {"0":__('Recommend 0'),"1":__('Recommend 1')}, formatter: Table.api.formatter.normal},
{field: 'hot', title: __('Hot'), searchList: {"0":__('Hot 0'),"1":__('Hot 1')}, formatter: Table.api.formatter.normal}, {field: 'hot', title: __('Hot'),sortable:true, searchList: {"0":__('Hot 0'),"1":__('Hot 1')}, formatter: Table.api.formatter.normal},
{field: 'new', title: __('New'), searchList: {"0":__('New 0'),"1":__('New 1')}, formatter: Table.api.formatter.normal}, {field: 'new', title: __('New'),sortable:true, searchList: {"0":__('New 0'),"1":__('New 1')}, formatter: Table.api.formatter.normal},
{field: 'selfhot', title: __('Selfhot'), searchList: {"0":__('Selfhot 0'),"1":__('Selfhot 1')}, formatter: Table.api.formatter.normal}, {field: 'selfhot', title: __('Selfhot'),sortable:true, searchList: {"0":__('Selfhot 0'),"1":__('Selfhot 1')}, formatter: Table.api.formatter.normal},
{field: 'manystore_id', title: __('Manystore_id'),visible:false}, {field: 'manystore_id', title: __('Manystore_id'),visible:false},
{field: 'shop_id', title: __('Shop_id'),visible:false}, {field: 'shop_id', title: __('Shop_id'),visible:false},
@ -211,7 +215,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
var width = $(this).attr('data-width'); var width = $(this).attr('data-width');
var height = $(this).attr('data-height'); var height = $(this).attr('data-height');
// var ids = $(this).attr('data-id'); // var ids = $(this).attr('data-id');
var area = ['95%','95%']; var area = ['98%','98%'];
var options = { var options = {
shadeClose: false, shadeClose: false,
shade: [0.3, '#393D49'], shade: [0.3, '#393D49'],
@ -405,7 +409,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
var width = $(this).attr('data-width'); var width = $(this).attr('data-width');
var height = $(this).attr('data-height'); var height = $(this).attr('data-height');
// var ids = $(this).attr('data-id'); // var ids = $(this).attr('data-id');
var area = ['95%','95%']; var area = ['98%','98%'];
var options = { var options = {
shadeClose: false, shadeClose: false,
shade: [0.3, '#393D49'], shade: [0.3, '#393D49'],

View File

@ -120,7 +120,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
{field: 'id', title: __('Id')}, {field: 'id', title: __('Id')},
{field: 'order_no', title: __('Order_no'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, {field: 'order_no', title: __('Order_no'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
{field: 'status', title: __('Status'), searchList: {"-3":__('Status -3'),"0":__('Status 0'),"3":__('Status 3'),"6":__('Status 6'),"9":__('Status 9')}, formatter: Table.api.formatter.status}, {field: 'status', title: __('Status'), searchList: {"-3":__('Status -3'),"0":__('Status 0'),"3":__('Status 3'),"4":__('Status 4'),"6":__('Status 6'),"9":__('Status 9')}, formatter: Table.api.formatter.status},
{field: 'pay_no',visible:false, title: __('Pay_no'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, {field: 'pay_no',visible:false, title: __('Pay_no'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
{field: 'detail.title', title: __('Detail.title'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, {field: 'detail.title', title: __('Detail.title'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
@ -150,13 +150,13 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
{field: 'before_status',visible:false, title: __('Before_status'), searchList: {"-3":__('Before_status -3'),"0":__('Before_status 0'),"3":__('Before_status 3'),"6":__('Before_status 6'),"9":__('Before_status 9')}, formatter: Table.api.formatter.status}, {field: 'before_status',visible:false, title: __('Before_status'), searchList: {"-3":__('Before_status -3'),"0":__('Before_status 0'),"3":__('Before_status 3'),"6":__('Before_status 6'),"9":__('Before_status 9')}, formatter: Table.api.formatter.status},
{field: 'server_status',visible:false, title: __('Server_status'), searchList: {"0":__('Server_status 0'),"3":__('Server_status 3'),"6":__('Server_status 6')}, formatter: Table.api.formatter.status}, {field: 'server_status',visible:false, title: __('Server_status'), searchList: {"0":__('Server_status 0'),"3":__('Server_status 3'),"6":__('Server_status 6')}, formatter: Table.api.formatter.status},
{field: 'reason',visible:false, title: __('Reason'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, {field: 'reason',visible:false, title: __('Reason'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
{field: 'auth_manystore_id',visible:false, title: __('Auth_manystore_id')}, // {field: 'auth_manystore_id',visible:false, title: __('Auth_manystore_id')},
{field: 'auth_opinion',visible:false, title: __('Auth_opinion'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, // {field: 'auth_opinion',visible:false, title: __('Auth_opinion'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
{field: 'auth_file',visible:false, title: __('Auth_file'), operate: false, formatter: Table.api.formatter.file}, // {field: 'auth_file',visible:false, title: __('Auth_file'), operate: false, formatter: Table.api.formatter.file},
{field: 'admin_id',visible:false, title: __('Admin_id')}, // {field: 'admin_id',visible:false, title: __('Admin_id')},
{field: 'result_status',visible:false, title: __('Result_status'), searchList: {"0":__('Result_status 0'),"3":__('Result_status 3'),"6":__('Result_status 6')}, formatter: Table.api.formatter.status}, // {field: 'result_status',visible:false, title: __('Result_status'), searchList: {"0":__('Result_status 0'),"3":__('Result_status 3'),"6":__('Result_status 6')}, formatter: Table.api.formatter.status},
{field: 'result_text',visible:false, title: __('Result_text'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, // {field: 'result_text',visible:false, title: __('Result_text'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
{field: 'result_file',visible:false, title: __('Result_file'), operate: false, formatter: Table.api.formatter.file}, // {field: 'result_file',visible:false, title: __('Result_file'), operate: false, formatter: Table.api.formatter.file},
{field: 'canceltime', title: __('Canceltime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime}, {field: 'canceltime', title: __('Canceltime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
{field: 'paytime', title: __('Paytime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime}, {field: 'paytime', title: __('Paytime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
{field: 'finishtime', title: __('Finishtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime}, {field: 'finishtime', title: __('Finishtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
@ -176,6 +176,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
{field: 'shop.district',visible:false, title: __('Shop.district')}, {field: 'shop.district',visible:false, title: __('Shop.district')},
{field: 'shop.address',visible:false, title: __('Shop.address'), operate: 'LIKE'}, {field: 'shop.address',visible:false, title: __('Shop.address'), operate: 'LIKE'},
{field: 'shop.address_detail',visible:false, title: __('Shop.address_detail'), operate: 'LIKE'}, {field: 'shop.address_detail',visible:false, title: __('Shop.address_detail'), operate: 'LIKE'},
{field: 'classes_service_order_id', title: __('售后订单id'),visible:false},
// {field: 'lib.title', title: __('Lib.title'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, // {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: 'lib.headimage', title: __('Lib.headimage'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image},
// {field: 'admin.nickname', title: __('Admin.nickname'), operate: 'LIKE'}, // {field: 'admin.nickname', title: __('Admin.nickname'), operate: 'LIKE'},

View File

@ -28,7 +28,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
{field: 'id', title: __('Id')}, {field: 'id', title: __('Id')},
{field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime}, {field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
{field: 'log_text', title: __('Log_text'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, {field: 'log_text', title: __('Log_text'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
{field: 'status', title: __('Status'), searchList: {"-3":__('Status -3'),"0":__('Status 0'),"3":__('Status 3'),"6":__('Status 6'),"9":__('Status 9')}, formatter: Table.api.formatter.status}, {field: 'status', title: __('Status'), searchList: {"-3":__('Status -3'),"0":__('Status 0'),"3":__('Status 3'),"4":__('Status 4'),"6":__('Status 6'),"9":__('Status 9')}, formatter: Table.api.formatter.status},
{field: 'classes_order_id', title: __('Classes_order_id')}, {field: 'classes_order_id', title: __('Classes_order_id')},
{field: 'before_status', title: __('Before_status'), searchList: {"-3":__('Before_status -3'),"0":__('Before_status 0'),"3":__('Before_status 3'),"6":__('Before_status 6'),"9":__('Before_status 9')}, formatter: Table.api.formatter.status}, {field: 'before_status', title: __('Before_status'), searchList: {"-3":__('Before_status -3'),"0":__('Before_status 0'),"3":__('Before_status 3'),"6":__('Before_status 6'),"9":__('Before_status 9')}, formatter: Table.api.formatter.status},
{field: 'server_status', title: __('Server_status'), searchList: {"0":__('Server_status 0'),"3":__('Server_status 3'),"6":__('Server_status 6')}, formatter: Table.api.formatter.status}, {field: 'server_status', title: __('Server_status'), searchList: {"0":__('Server_status 0'),"3":__('Server_status 3'),"6":__('Server_status 6')}, formatter: Table.api.formatter.status},

View File

@ -0,0 +1,155 @@
define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
var Controller = {
index: function () {
// 初始化表格参数配置
Table.api.init({
extend: {
index_url: 'school/classes/order/service_order/index' + location.search,
add_url: 'school/classes/order/service_order/add',
edit_url: 'school/classes/order/service_order/edit',
del_url: 'school/classes/order/service_order/del',
multi_url: 'school/classes/order/service_order/multi',
import_url: 'school/classes/order/service_order/import',
table: 'school_classes_service_order',
}
});
var table = $("#table");
// 初始化表格
table.bootstrapTable({
url: $.fn.bootstrapTable.defaults.extend.index_url,
pk: 'id',
sortName: 'id',
fixedColumns: true,
fixedRightNumber: 1,
columns: [
[
{checkbox: true},
{field: 'id', title: __('Id')},
{field: 'order_no', title: __('Order_no'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
{field: 'reason', title: __('Reason'), operate: 'LIKE'},
{field: 'classes_order_id', title: __('Classes_order_id')},
{field: 'user_id', title: __('User_id')},
{field: 'classes_order_detail_id', title: __('Classes_order_detail_id')},
{field: 'classes_lib_id', title: __('Classes_lib_id')},
{field: 'manystore_id', title: __('Manystore_id')},
{field: 'shop_id', title: __('Shop_id')},
{field: 'status', title: __('Status'), searchList: {"1":__('Status 1'),"4":__('Status 4'),"7":__('Status 7'),"-3":__('Status -3')}, formatter: Table.api.formatter.status},
{field: 'service_stauts', title: __('Service_stauts'), searchList: {"1":__('Service_stauts 1'),"4":__('Service_stauts 4'),"7":__('Service_stauts 7'),"-3":__('Service_stauts -3')}, formatter: Table.api.formatter.normal},
{field: 'sales_type', title: __('Sales_type'), searchList: {"-3":__('Sales_type -3'),"1":__('Sales_type 1'),"4":__('Sales_type 4'),"7":__('Sales_type 7'),"10":__('Sales_type 10')}, formatter: Table.api.formatter.normal},
{field: 'reject_reason', title: __('Reject_reason'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
{field: 'reject_images', title: __('Reject_images'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.images},
{field: 'auto_price', title: __('Auto_price'), operate:'BETWEEN'},
{field: 'loss_proportion', title: __('Loss_proportion'), operate:'BETWEEN'},
{field: 'auto_loss_price', title: __('Auto_loss_price'), operate:'BETWEEN'},
{field: 'tbc_price', title: __('Tbc_price'), operate:'BETWEEN'},
{field: 'c_price', title: __('C_price'), operate:'BETWEEN'},
{field: 'real_refundprice', title: __('Real_refundprice'), operate:'BETWEEN'},
{field: 'sub_refundprice', title: __('Sub_refundprice'), operate:'BETWEEN'},
{field: 'platform', title: __('Platform'), searchList: {"miniapp":__('Platform miniapp')}, formatter: Table.api.formatter.normal},
{field: 'pay_type', title: __('Pay_type'), searchList: {"yue":__('Pay_type yue'),"wechat":__('Pay_type wechat')}, formatter: Table.api.formatter.normal},
{field: 'refundtime', title: __('Refundtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
{field: 'rejecttime', title: __('Rejecttime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
{field: 'handletime', title: __('Handletime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
{field: 'confirmtime', title: __('Confirmtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
{field: 'checkouttime', title: __('Checkouttime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
{field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
{field: 'updatetime', title: __('Updatetime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
{field: 'classesorder.order_no', title: __('Order.order_no'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
{field: 'classesorder.pay_no', title: __('Order.pay_no'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
{field: 'user.nickname', title: __('User.nickname'), operate: 'LIKE'},
{field: 'user.realname', title: __('User.realname'), operate: 'LIKE'},
{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: 'detail.title', title: __('Detail.title'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
{field: 'detail.headimage', title: __('Detail.headimage'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image},
{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: 'manystore.nickname', title: __('Manystore.nickname'), operate: 'LIKE'},
{field: 'shop.name', title: __('Shop.name'), operate: 'LIKE'},
{field: 'shop.logo', title: __('Shop.logo'), operate: 'LIKE'},
{field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
]
]
});
// 为表格绑定事件
Table.api.bindevent(table);
},
recyclebin: function () {
// 初始化表格参数配置
Table.api.init({
extend: {
'dragsort_url': ''
}
});
var table = $("#table");
// 初始化表格
table.bootstrapTable({
url: 'school/classes/order/service_order/recyclebin' + location.search,
pk: 'id',
sortName: 'id',
columns: [
[
{checkbox: true},
{field: 'id', title: __('Id')},
{
field: 'deletetime',
title: __('Deletetime'),
operate: 'RANGE',
addclass: 'datetimerange',
formatter: Table.api.formatter.datetime
},
{
field: 'operate',
width: '140px',
title: __('Operate'),
table: table,
events: Table.api.events.operate,
buttons: [
{
name: 'Restore',
text: __('Restore'),
classname: 'btn btn-xs btn-info btn-ajax btn-restoreit',
icon: 'fa fa-rotate-left',
url: 'school/classes/order/service_order/restore',
refresh: true
},
{
name: 'Destroy',
text: __('Destroy'),
classname: 'btn btn-xs btn-danger btn-ajax btn-destroyit',
icon: 'fa fa-times',
url: 'school/classes/order/service_order/destroy',
refresh: true
}
],
formatter: Table.api.formatter.operate
}
]
]
});
// 为表格绑定事件
Table.api.bindevent(table);
},
add: function () {
Controller.api.bindevent();
},
edit: function () {
Controller.api.bindevent();
},
api: {
bindevent: function () {
Form.api.bindevent($("form[role=form]"));
}
}
};
return Controller;
});

View File

@ -0,0 +1,76 @@
define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
var Controller = {
index: function () {
// 初始化表格参数配置
Table.api.init({
extend: {
index_url: 'school/classes/order/service_order_log/index' + location.search,
add_url: 'school/classes/order/service_order_log/add',
edit_url: 'school/classes/order/service_order_log/edit',
del_url: 'school/classes/order/service_order_log/del',
multi_url: 'school/classes/order/service_order_log/multi',
import_url: 'school/classes/order/service_order_log/import',
table: 'school_classes_service_order_log',
}
});
var table = $("#table");
// 初始化表格
table.bootstrapTable({
url: $.fn.bootstrapTable.defaults.extend.index_url,
pk: 'id',
sortName: 'id',
fixedColumns: true,
fixedRightNumber: 1,
columns: [
[
{checkbox: true},
{field: 'id', title: __('Id')},
{field: 'classes_service_order_id', title: __('Classes_service_order_id')},
{field: 'classes_order_id', title: __('Classes_order_id')},
{field: 'user_id', title: __('User_id')},
{field: 'classes_order_detail_id', title: __('Classes_order_detail_id')},
{field: 'classes_lib_id', title: __('Classes_lib_id')},
{field: 'manystore_id', title: __('Manystore_id')},
{field: 'shop_id', title: __('Shop_id')},
{field: 'status', title: __('Status'), searchList: {"1":__('Status 1'),"4":__('Status 4'),"7":__('Status 7'),"-3":__('Status -3')}, formatter: Table.api.formatter.status},
{field: 'service_stauts', title: __('Service_stauts'), searchList: {"1":__('Service_stauts 1'),"4":__('Service_stauts 4'),"7":__('Service_stauts 7'),"-3":__('Service_stauts -3')}, formatter: Table.api.formatter.normal},
{field: 'sales_type', title: __('Sales_type'), searchList: {"-3":__('Sales_type -3'),"1":__('Sales_type 1'),"4":__('Sales_type 4'),"7":__('Sales_type 7'),"10":__('Sales_type 10')}, formatter: Table.api.formatter.normal},
{field: 'log_text', title: __('Log_text'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
{field: 'oper_id', title: __('Oper_id')},
{field: 'oper_type', title: __('Oper_type'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
{field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
{field: 'updatetime', title: __('Updatetime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
{field: 'serviceorder.order_no', title: __('Order.order_no'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
{field: 'classesorder.order_no', title: __('Order.order_no'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
{field: 'classesorder.pay_no', title: __('Order.pay_no'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
{field: 'user.nickname', title: __('User.nickname'), operate: 'LIKE'},
{field: 'user.realname', title: __('User.realname'), operate: 'LIKE'},
{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: 'detail.title', title: __('Detail.title'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
{field: 'admin.nickname', title: __('Admin.nickname'), operate: 'LIKE'},
{field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
]
]
});
// 为表格绑定事件
Table.api.bindevent(table);
},
add: function () {
Controller.api.bindevent();
},
edit: function () {
Controller.api.bindevent();
},
api: {
bindevent: function () {
Form.api.bindevent($("form[role=form]"));
}
}
};
return Controller;
});

View File

@ -30,7 +30,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
{field: 'shop_id', title: __('Shop_id')}, {field: 'shop_id', title: __('Shop_id')},
{field: 'user_id', title: __('User_id')}, {field: 'user_id', title: __('User_id')},
{field: 'classes_title', title: __('Classes_lib_ids'), operate: false, formatter: Table.api.formatter.flag}, {field: 'classes_title', title: __('Classes_lib_ids'),visible:false, operate: false, formatter: Table.api.formatter.flag},
{field: 'classes_lib_ids', title: __('Classes_lib_ids'),visible:false, operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, {field: 'classes_lib_ids', title: __('Classes_lib_ids'),visible:false, operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},

View File

@ -18,6 +18,23 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'upload'], function (
return true; return true;
}); });
$("#c-address_city").on("cp:updated", function() {
var citypicker = $(this).data("citypicker");
var province = citypicker.getCode("province");
var city = citypicker.getCode("city");
var district = citypicker.getCode("district");
if(province){
$("#province").val(province);
}
if(city){
$("#city").val(city);
}
if(district){
$("#district").val(district);
}
});
Form.api.bindevent($("#shop-form")); Form.api.bindevent($("#shop-form"));
}, },
}; };

View File

@ -144,24 +144,27 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
{field: 'auth_time', title: __('Auth_time'), operate:'RANGE',visible:false, addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime}, {field: 'auth_time', title: __('Auth_time'), operate:'RANGE',visible:false, addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
{field: 'type', title: __('Type'), searchList: {"out":__('Type out'),"in":__('Type in')}, formatter: Table.api.formatter.normal}, {field: 'type', title: __('Type'), searchList: {"out":__('Type out'),"in":__('Type in')}, formatter: Table.api.formatter.normal},
{field: 'classes_num', title: __('Classes_num')}, {field: 'classes_num', title: __('Classes_num'),sortable:true},
{field: 'limit_num', title: __('Limit_num')}, {field: 'limit_num', title: __('Limit_num'),sortable:true},
{field: 'sign_num', title: __('Sign_num')}, {field: 'sign_num', title: __('Sign_num'),sortable:true},
{field: 'verification_num', title: __('Verification_num')},
{field: 'verification_num', title: __('Verification_num'),sortable:true},
{field: 'collect', title: __('实际收藏量'),sortable:true},
{field: 'views', title: __('浏览量'),sortable:true},
{field: 'address_type', title: __('Address_type'), searchList: {"1":__('Address_type 1'),"2":__('Address_type 2')}, formatter: Table.api.formatter.normal}, {field: 'address_type', title: __('Address_type'), searchList: {"1":__('Address_type 1'),"2":__('Address_type 2')}, formatter: Table.api.formatter.normal},
{field: 'sale', title: __('Sale')}, {field: 'sale', title: __('Sale'),sortable:true},
{field: 'price', title: __('Price'), operate:'BETWEEN'}, {field: 'price', title: __('Price'),sortable:true, operate:'BETWEEN'},
{field: 'underline_price', title: __('Underline_price'), operate:'BETWEEN'}, {field: 'underline_price', title: __('Underline_price'),sortable:true, operate:'BETWEEN'},
{field: 'admin_id', title: __('Admin_id'),visible:false}, {field: 'admin_id', title: __('Admin_id'),visible:false},
{field: 'weigh', title: __('Weigh'), operate: false}, {field: 'weigh', title: __('Weigh'), operate: false,sortable:true},
{field: 'recommend', title: __('Recommend'), searchList: {"0":__('Recommend 0'),"1":__('Recommend 1')}, formatter: Table.api.formatter.normal}, {field: 'recommend', title: __('Recommend'),sortable:true, searchList: {"0":__('Recommend 0'),"1":__('Recommend 1')}, formatter: Table.api.formatter.normal},
{field: 'hot', title: __('Hot'), searchList: {"0":__('Hot 0'),"1":__('Hot 1')}, formatter: Table.api.formatter.normal}, {field: 'hot', title: __('Hot'),sortable:true, searchList: {"0":__('Hot 0'),"1":__('Hot 1')}, formatter: Table.api.formatter.normal},
{field: 'new', title: __('New'), searchList: {"0":__('New 0'),"1":__('New 1')}, formatter: Table.api.formatter.normal}, {field: 'new', title: __('New'),sortable:true, searchList: {"0":__('New 0'),"1":__('New 1')}, formatter: Table.api.formatter.normal},
{field: 'selfhot', title: __('Selfhot'), searchList: {"0":__('Selfhot 0'),"1":__('Selfhot 1')}, formatter: Table.api.formatter.normal}, {field: 'selfhot', title: __('Selfhot'),sortable:true, searchList: {"0":__('Selfhot 0'),"1":__('Selfhot 1')}, formatter: Table.api.formatter.normal},
{field: 'manystore_id', title: __('Manystore_id'),visible:false}, {field: 'manystore_id', title: __('Manystore_id'),visible:false},
{field: 'shop_id', title: __('Shop_id'),visible:false}, {field: 'shop_id', title: __('Shop_id'),visible:false},
@ -211,7 +214,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
var width = $(this).attr('data-width'); var width = $(this).attr('data-width');
var height = $(this).attr('data-height'); var height = $(this).attr('data-height');
// var ids = $(this).attr('data-id'); // var ids = $(this).attr('data-id');
var area = ['95%','95%']; var area = ['98%','98%'];
var options = { var options = {
shadeClose: false, shadeClose: false,
shade: [0.3, '#393D49'], shade: [0.3, '#393D49'],
@ -404,7 +407,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
var width = $(this).attr('data-width'); var width = $(this).attr('data-width');
var height = $(this).attr('data-height'); var height = $(this).attr('data-height');
// var ids = $(this).attr('data-id'); // var ids = $(this).attr('data-id');
var area = ['95%','95%']; var area = ['98%','98%'];
var options = { var options = {
shadeClose: false, shadeClose: false,
shade: [0.3, '#393D49'], shade: [0.3, '#393D49'],

View File

@ -123,7 +123,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
{field: 'id', title: __('Id')}, {field: 'id', title: __('Id')},
{field: 'order_no', title: __('Order_no'), operate: 'LIKE'}, {field: 'order_no', title: __('Order_no'), operate: 'LIKE'},
{field: 'status', title: __('Status'), searchList: {"-3":__('Status -3'),"0":__('Status 0'),"3":__('Status 3'),"6":__('Status 6'),"9":__('Status 9')}, formatter: Table.api.formatter.status}, {field: 'status', title: __('Status'), searchList: {"-3":__('Status -3'),"0":__('Status 0'),"3":__('Status 3'),"4":__('Status 4'),"6":__('Status 6'),"9":__('Status 9')}, formatter: Table.api.formatter.status},
{field: 'pay_no', title: __('Pay_no'), operate: 'LIKE',visible:false}, {field: 'pay_no', title: __('Pay_no'), operate: 'LIKE',visible:false},
{field: 'schoolclassesorderdetail.title', title: __('Schoolclassesorderdetail.title'), operate: 'LIKE'}, {field: 'schoolclassesorderdetail.title', title: __('Schoolclassesorderdetail.title'), operate: 'LIKE'},
@ -151,13 +151,13 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
{field: 'before_status',visible:false, title: __('Before_status'), searchList: {"-3":__('Before_status -3'),"0":__('Before_status 0'),"3":__('Before_status 3'),"6":__('Before_status 6'),"9":__('Before_status 9')}, formatter: Table.api.formatter.status}, {field: 'before_status',visible:false, title: __('Before_status'), searchList: {"-3":__('Before_status -3'),"0":__('Before_status 0'),"3":__('Before_status 3'),"6":__('Before_status 6'),"9":__('Before_status 9')}, formatter: Table.api.formatter.status},
{field: 'server_status',visible:false, title: __('Server_status'), searchList: {"0":__('Server_status 0'),"3":__('Server_status 3'),"6":__('Server_status 6')}, formatter: Table.api.formatter.status}, {field: 'server_status',visible:false, title: __('Server_status'), searchList: {"0":__('Server_status 0'),"3":__('Server_status 3'),"6":__('Server_status 6')}, formatter: Table.api.formatter.status},
{field: 'reason',visible:false, title: __('Reason'), operate: 'LIKE'}, {field: 'reason',visible:false, title: __('Reason'), operate: 'LIKE'},
{field: 'auth_manystore_id',visible:false, title: __('Auth_manystore_id')}, // {field: 'auth_manystore_id',visible:false, title: __('Auth_manystore_id')},
{field: 'auth_opinion',visible:false, title: __('Auth_opinion'), operate: 'LIKE'}, // {field: 'auth_opinion',visible:false, title: __('Auth_opinion'), operate: 'LIKE'},
{field: 'auth_file',visible:false, title: __('Auth_file'), operate: false}, // {field: 'auth_file',visible:false, title: __('Auth_file'), operate: false},
{field: 'admin_id',visible:false, title: __('Admin_id')}, // {field: 'admin_id',visible:false, title: __('Admin_id')},
{field: 'result_status',visible:false, title: __('Result_status'), searchList: {"0":__('Result_status 0'),"3":__('Result_status 3'),"6":__('Result_status 6')}, formatter: Table.api.formatter.status}, // {field: 'result_status',visible:false, title: __('Result_status'), searchList: {"0":__('Result_status 0'),"3":__('Result_status 3'),"6":__('Result_status 6')}, formatter: Table.api.formatter.status},
{field: 'result_text',visible:false, title: __('Result_text'), operate: 'LIKE'}, // {field: 'result_text',visible:false, title: __('Result_text'), operate: 'LIKE'},
{field: 'result_file',visible:false, title: __('Result_file'), operate: false}, // {field: 'result_file',visible:false, title: __('Result_file'), operate: false},
{field: 'canceltime', title: __('Canceltime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime}, {field: 'canceltime', title: __('Canceltime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
{field: 'paytime', title: __('Paytime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime}, {field: 'paytime', title: __('Paytime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
{field: 'finishtime', title: __('Finishtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime}, {field: 'finishtime', title: __('Finishtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
@ -181,6 +181,8 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
{field: 'schoolclasseslib.headimage',visible:false, title: __('Schoolclasseslib.headimage'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image}, {field: 'schoolclasseslib.headimage',visible:false, title: __('Schoolclasseslib.headimage'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image},
{field: 'admin.nickname', title: __('Admin.nickname'),visible:false, operate: 'LIKE'}, {field: 'admin.nickname', title: __('Admin.nickname'),visible:false, operate: 'LIKE'},
{field: 'admin.avatar', title: __('Admin.avatar'),visible:false, operate: 'LIKE', events: Table.api.events.image, formatter: Table.api.formatter.image}, {field: 'admin.avatar', title: __('Admin.avatar'),visible:false, operate: 'LIKE', events: Table.api.events.image, formatter: Table.api.formatter.image},
{field: 'classes_service_order_id', title: __('售后订单id'),visible:false},
// {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}
] ]
] ]

View File

@ -28,7 +28,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
{field: 'id', title: __('Id')}, {field: 'id', title: __('Id')},
{field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime}, {field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
{field: 'log_text', title: __('Log_text'), operate: 'LIKE'}, {field: 'log_text', title: __('Log_text'), operate: 'LIKE'},
{field: 'status', title: __('Status'), searchList: {"-3":__('Status -3'),"0":__('Status 0'),"3":__('Status 3'),"6":__('Status 6'),"9":__('Status 9')}, formatter: Table.api.formatter.status}, {field: 'status', title: __('Status'), searchList: {"-3":__('Status -3'),"0":__('Status 0'),"3":__('Status 3'),"4":__('Status 4'),"6":__('Status 6'),"9":__('Status 9')}, formatter: Table.api.formatter.status},
{field: 'classes_order_id', title: __('Classes_order_id')}, {field: 'classes_order_id', title: __('Classes_order_id')},
{field: 'before_status', title: __('Before_status'), searchList: {"-3":__('Before_status -3'),"0":__('Before_status 0'),"3":__('Before_status 3'),"6":__('Before_status 6'),"9":__('Before_status 9')}, formatter: Table.api.formatter.status}, {field: 'before_status', title: __('Before_status'), searchList: {"-3":__('Before_status -3'),"0":__('Before_status 0'),"3":__('Before_status 3'),"6":__('Before_status 6'),"9":__('Before_status 9')}, formatter: Table.api.formatter.status},

View File

@ -0,0 +1,151 @@
define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
var Controller = {
index: function () {
// 初始化表格参数配置
Table.api.init({
extend: {
index_url: 'school/classes/order/service_order/index' + location.search,
add_url: 'school/classes/order/service_order/add',
edit_url: 'school/classes/order/service_order/edit',
del_url: 'school/classes/order/service_order/del',
multi_url: 'school/classes/order/service_order/multi',
import_url: 'school/classes/order/service_order/import',
table: 'school_classes_service_order',
}
});
var table = $("#table");
// 初始化表格
table.bootstrapTable({
url: $.fn.bootstrapTable.defaults.extend.index_url,
pk: 'id',
sortName: 'id',
columns: [
[
{checkbox: true},
{field: 'id', title: __('Id')},
{field: 'order_no', title: __('Order_no'), operate: 'LIKE'},
{field: 'reason', title: __('Reason'), operate: 'LIKE'},
{field: 'classes_order_id', title: __('Classes_order_id')},
{field: 'user_id', title: __('User_id')},
{field: 'classes_order_detail_id', title: __('Classes_order_detail_id')},
{field: 'classes_lib_id', title: __('Classes_lib_id')},
{field: 'manystore_id', title: __('Manystore_id')},
{field: 'shop_id', title: __('Shop_id')},
{field: 'status', title: __('Status'), searchList: {"1":__('Status 1'),"4":__('Status 4'),"7":__('Status 7'),"-3":__('Status -3')}, formatter: Table.api.formatter.status},
{field: 'service_stauts', title: __('Service_stauts'), searchList: {"1":__('Service_stauts 1'),"4":__('Service_stauts 4'),"7":__('Service_stauts 7'),"-3":__('Service_stauts -3')}, formatter: Table.api.formatter.normal},
{field: 'sales_type', title: __('Sales_type'), searchList: {"-3":__('Sales_type -3'),"1":__('Sales_type 1'),"4":__('Sales_type 4'),"7":__('Sales_type 7'),"10":__('Sales_type 10')}, formatter: Table.api.formatter.normal},
{field: 'reject_reason', title: __('Reject_reason'), operate: 'LIKE'},
{field: 'reject_images', title: __('Reject_images'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.images},
{field: 'auto_price', title: __('Auto_price'), operate:'BETWEEN'},
{field: 'loss_proportion', title: __('Loss_proportion'), operate:'BETWEEN'},
{field: 'auto_loss_price', title: __('Auto_loss_price'), operate:'BETWEEN'},
{field: 'tbc_price', title: __('Tbc_price'), operate:'BETWEEN'},
{field: 'c_price', title: __('C_price'), operate:'BETWEEN'},
{field: 'real_refundprice', title: __('Real_refundprice'), operate:'BETWEEN'},
{field: 'sub_refundprice', title: __('Sub_refundprice'), operate:'BETWEEN'},
{field: 'platform', title: __('Platform'), searchList: {"miniapp":__('Miniapp')}, formatter: Table.api.formatter.normal},
{field: 'pay_type', title: __('Pay_type'), searchList: {"yue":__('Pay_type yue'),"wechat":__('Pay_type wechat')}, formatter: Table.api.formatter.normal},
{field: 'refundtime', title: __('Refundtime')},
{field: 'rejecttime', title: __('Rejecttime')},
{field: 'handletime', title: __('Handletime')},
{field: 'confirmtime', title: __('Confirmtime')},
{field: 'checkouttime', title: __('Checkouttime')},
{field: 'createtime', title: __('Createtime')},
{field: 'updatetime', title: __('Updatetime')},
{field: 'schoolclassesorder.order_no', title: __('Schoolclassesorder.order_no'), operate: 'LIKE'},
{field: 'schoolclassesorder.pay_no', title: __('Schoolclassesorder.pay_no'), operate: 'LIKE'},
{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: 'schoolclassesorderdetail.title', title: __('Schoolclassesorderdetail.title'), operate: 'LIKE'},
{field: 'schoolclassesorderdetail.headimage', title: __('Schoolclassesorderdetail.headimage'), operate: false, 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: 'manystore.nickname', title: __('Manystore.nickname'), operate: 'LIKE'},
{field: 'manystoreshop.name', title: __('Manystoreshop.name'), operate: 'LIKE'},
{field: 'manystoreshop.logo', title: __('Manystoreshop.logo'), operate: 'LIKE'},
{field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
]
]
});
// 为表格绑定事件
Table.api.bindevent(table);
},
recyclebin: function () {
// 初始化表格参数配置
Table.api.init({
extend: {
'dragsort_url': ''
}
});
var table = $("#table");
// 初始化表格
table.bootstrapTable({
url: 'school/classes/order/service_order/recyclebin' + location.search,
pk: 'id',
sortName: 'id',
columns: [
[
{checkbox: true},
{field: 'id', title: __('Id')},
{
field: 'deletetime',
title: __('Deletetime'),
operate: 'RANGE',
addclass: 'datetimerange',
formatter: Table.api.formatter.datetime
},
{
field: 'operate',
width: '130px',
title: __('Operate'),
table: table,
events: Table.api.events.operate,
buttons: [
{
name: 'Restore',
text: __('Restore'),
classname: 'btn btn-xs btn-info btn-ajax btn-restoreit',
icon: 'fa fa-rotate-left',
url: 'school/classes/order/service_order/restore',
refresh: true
},
{
name: 'Destroy',
text: __('Destroy'),
classname: 'btn btn-xs btn-danger btn-ajax btn-destroyit',
icon: 'fa fa-times',
url: 'school/classes/order/service_order/destroy',
refresh: true
}
],
formatter: Table.api.formatter.operate
}
]
]
});
// 为表格绑定事件
Table.api.bindevent(table);
},
add: function () {
Controller.api.bindevent();
},
edit: function () {
Controller.api.bindevent();
},
api: {
bindevent: function () {
Form.api.bindevent($("form[role=form]"));
}
}
};
return Controller;
});

View File

@ -0,0 +1,74 @@
define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
var Controller = {
index: function () {
// 初始化表格参数配置
Table.api.init({
extend: {
index_url: 'school/classes/order/service_order_log/index' + location.search,
add_url: 'school/classes/order/service_order_log/add',
edit_url: 'school/classes/order/service_order_log/edit',
del_url: 'school/classes/order/service_order_log/del',
multi_url: 'school/classes/order/service_order_log/multi',
import_url: 'school/classes/order/service_order_log/import',
table: 'school_classes_service_order_log',
}
});
var table = $("#table");
// 初始化表格
table.bootstrapTable({
url: $.fn.bootstrapTable.defaults.extend.index_url,
pk: 'id',
sortName: 'id',
columns: [
[
{checkbox: true},
{field: 'id', title: __('Id')},
{field: 'classes_service_order_id', title: __('Classes_service_order_id')},
{field: 'classes_order_id', title: __('Classes_order_id')},
{field: 'user_id', title: __('User_id')},
{field: 'classes_order_detail_id', title: __('Classes_order_detail_id')},
{field: 'classes_lib_id', title: __('Classes_lib_id')},
{field: 'manystore_id', title: __('Manystore_id')},
{field: 'shop_id', title: __('Shop_id')},
{field: 'status', title: __('Status'), searchList: {"1":__('Status 1'),"4":__('Status 4'),"7":__('Status 7'),"-3":__('Status -3')}, formatter: Table.api.formatter.status},
{field: 'service_stauts', title: __('Service_stauts'), searchList: {"1":__('Service_stauts 1'),"4":__('Service_stauts 4'),"7":__('Service_stauts 7'),"-3":__('Service_stauts -3')}, formatter: Table.api.formatter.normal},
{field: 'sales_type', title: __('Sales_type'), searchList: {"-3":__('Sales_type -3'),"1":__('Sales_type 1'),"4":__('Sales_type 4'),"7":__('Sales_type 7'),"10":__('Sales_type 10')}, formatter: Table.api.formatter.normal},
{field: 'log_text', title: __('Log_text'), operate: 'LIKE'},
{field: 'oper_id', title: __('Oper_id')},
{field: 'oper_type', title: __('Oper_type'), operate: 'LIKE'},
{field: 'createtime', title: __('Createtime')},
{field: 'updatetime', title: __('Updatetime')},
{field: 'schoolclassesserviceorder.order_no', title: __('Schoolclassesserviceorder.order_no'), operate: 'LIKE'},
{field: 'schoolclassesorder.order_no', title: __('Schoolclassesorder.order_no'), operate: 'LIKE'},
{field: 'schoolclassesorder.pay_no', title: __('Schoolclassesorder.pay_no'), operate: 'LIKE'},
{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: 'schoolclassesorderdetail.title', title: __('Schoolclassesorderdetail.title'), operate: 'LIKE'},
{field: 'admin.nickname', title: __('Admin.nickname'), operate: 'LIKE'},
{field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
]
]
});
// 为表格绑定事件
Table.api.bindevent(table);
},
add: function () {
Controller.api.bindevent();
},
edit: function () {
Controller.api.bindevent();
},
api: {
bindevent: function () {
Form.api.bindevent($("form[role=form]"));
}
}
};
return Controller;
});

View File

@ -29,7 +29,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
{field: 'manystore_id', title: __('Manystore_id'),visible:false}, {field: 'manystore_id', title: __('Manystore_id'),visible:false},
{field: 'shop_id', title: __('Shop_id'),visible:false}, {field: 'shop_id', title: __('Shop_id'),visible:false},
{field: 'user_id', title: __('User_id'),visible:false}, {field: 'user_id', title: __('User_id'),visible:false},
{field: 'classes_title', title: __('Classes_lib_ids'), operate: false, formatter: Table.api.formatter.flag}, {field: 'classes_title', title: __('Classes_lib_ids'),visible:false, operate: false, formatter: Table.api.formatter.flag},
{field: 'classes_lib_ids', title: __('Classes_lib_ids'),visible:false, operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, {field: 'classes_lib_ids', title: __('Classes_lib_ids'),visible:false, operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},