diff --git a/application/admin/controller/manystore/Index.php b/application/admin/controller/manystore/Index.php index cce8a69..7da7b55 100644 --- a/application/admin/controller/manystore/Index.php +++ b/application/admin/controller/manystore/Index.php @@ -59,6 +59,7 @@ class Index extends Backend $this->view->assign("statusList", $this->shopModel->getStatusList()); $this->view->assign("typeList", $this->shopModel->getTypeList()); $this->view->assign("shop_backend_url", config("site.shop_backend_url")); + $this->getCity(); } @@ -514,11 +515,12 @@ class Index extends Backend exception('商家信息删除失败'); } db()->commit(); - $this->success('删除成功'); + }catch (\Exception $e){ db()->rollback(); $this->error($e->getMessage()); } + $this->success('删除成功'); } $this->error(__('You have no permission')); } diff --git a/application/admin/controller/school/classes/ClassesLib.php b/application/admin/controller/school/classes/ClassesLib.php index 8d385a6..dfce4f2 100644 --- a/application/admin/controller/school/classes/ClassesLib.php +++ b/application/admin/controller/school/classes/ClassesLib.php @@ -61,7 +61,7 @@ class ClassesLib extends Backend $this->view->assign("specStatusList", (new \app\admin\model\school\classes\ClassesSpec)->getStatusList()); - + $this->getCity(); } diff --git a/application/admin/controller/school/classes/Type.php b/application/admin/controller/school/classes/Type.php new file mode 100644 index 0000000..e745c54 --- /dev/null +++ b/application/admin/controller/school/classes/Type.php @@ -0,0 +1,37 @@ +model = new \app\admin\model\school\classes\Type; + $this->view->assign("statusList", $this->model->getStatusList()); + } + + + + /** + * 默认生成的控制器所继承的父类中有index/add/edit/del/multi五个基础方法、destroy/restore/recyclebin三个回收站方法 + * 因此在当前控制器中可不用编写增删改查的代码,除非需要自己控制这部分逻辑 + * 需要将application/admin/library/traits/Backend.php中对应的方法复制到当前控制器,然后进行修改 + */ + + +} diff --git a/application/admin/controller/school/classes/order/Order.php b/application/admin/controller/school/classes/order/Order.php index 894655a..1c66271 100644 --- a/application/admin/controller/school/classes/order/Order.php +++ b/application/admin/controller/school/classes/order/Order.php @@ -105,4 +105,40 @@ class Order extends Backend return $this->view->fetch(); } + + + /**发起售后 + * @return string + * @throws \think\Exception + * @throws \think\exception\DbException + */ + public function after_sales($ids = ""){ + + if($this->request->isPost()) + { + try{ + $params = $this->request->post("row/a"); + $classes_order = $params["id"]; + $reason = $params["reason"]; + + $model = (new \app\common\model\school\classes\order\ServiceOrder()); + $remark = "总后台管理员帮忙下售后单"; + $model->afterSales($classes_order,$reason,$remark,'admin',$this->auth->id,true); + }catch (\Exception $e){ + $this->error($e->getMessage()); + } + $this->success("执行成功"); + } + + $row = $this->model->where(array('id'=>$ids))->find(); + if (!$row) { + $this->error(__('No Results were found')); + } + +// $row = $this->model->get($param['ids']); + $this->view->assign('row', $row); + return $this->view->fetch(); + } + + } diff --git a/application/admin/controller/school/classes/order/ServiceOrder.php b/application/admin/controller/school/classes/order/ServiceOrder.php index d9e34ed..3ce84d8 100644 --- a/application/admin/controller/school/classes/order/ServiceOrder.php +++ b/application/admin/controller/school/classes/order/ServiceOrder.php @@ -77,4 +77,160 @@ class ServiceOrder extends Backend return $this->view->fetch(); } + + + + + + + /**用户确认 + * @return string + * @throws \think\Exception + * @throws \think\exception\DbException + */ + public function user_confirmation($ids = ""){ + + if($this->request->isPost()) + { + try{ + $params = $this->request->post("row/a"); + $order_no = $params["order_no"]; + $reject_images = $params["reject_images"]; + $reject_reason = $params["reject_reason"]; + $status = $params["status"]; + $model = (new \app\common\model\school\classes\order\ServiceOrder()); + $model->userConfirmation($order_no,$status,$reject_reason,$reject_images,0,true,'admin',$this->auth->id,true); + }catch (\Exception $e){ + $this->error($e->getMessage()); + } + + $this->success("已完成审核"); + } + + $row = $this->model->where(array('id'=>$ids))->find(); + if (!$row) { + $this->error(__('No Results were found')); + } + +// $row = $this->model->get($param['ids']); + $this->view->assign("statusList", ["yes"=>"同意", "no"=>"拒绝"]); + $this->view->assign('row', $row); + return $this->view->fetch(); + } + + + + + /**机构确认 + * @return string + * @throws \think\Exception + * @throws \think\exception\DbException + */ + public function shop_confirmation($ids = ""){ + + if($this->request->isPost()) + { + try{ + $params = $this->request->post("row/a"); + $order_no = $params["order_no"]; + $reject_images = $params["reject_images"]; + $reject_reason = $params["reject_reason"]; + $price = $params["price"]; + $status = $params["status"]; + $model = (new \app\common\model\school\classes\order\ServiceOrder()); + $model->shopConfirmation($order_no,$status,$price,$reject_reason,$reject_images,0,true,'admin',$this->auth->id,true); + }catch (\Exception $e){ + $this->error($e->getMessage()); + } + + $this->success("已完成审核"); + } + + $row = $this->model->where(array('id'=>$ids))->find(); + if (!$row) { + $this->error(__('No Results were found')); + } + +// $row = $this->model->get($param['ids']); + $this->view->assign("statusList", ["yes"=>"同意", "no"=>"拒绝"]); + $this->view->assign('row', $row); + return $this->view->fetch(); + } + + + + /**系统确认 + * @return string + * @throws \think\Exception + * @throws \think\exception\DbException + */ + public function admin_confirmation($ids = ""){ + + if($this->request->isPost()) + { + try{ + $params = $this->request->post("row/a"); + $order_no = $params["order_no"]; + $reject_images = $params["reject_images"]; + $reject_reason = $params["reject_reason"]; + $status = $params["status"]; + $model = (new \app\common\model\school\classes\order\ServiceOrder()); + $model->adminConfirmation($order_no,$status,$reject_reason,$reject_images,0,true,'admin',$this->auth->id,true); + }catch (\Exception $e){ + $this->error($e->getMessage()); + } + + $this->success("已完成审核"); + } + + $row = $this->model->where(array('id'=>$ids))->find(); + if (!$row) { + $this->error(__('No Results were found')); + } + +// $row = $this->model->get($param['ids']); + + $this->view->assign("statusList", ["yes"=>"同意", "no"=>"拒绝"]); + $this->view->assign('row', $row); + return $this->view->fetch(); + } + + + + + + /** + * 后台核销 + * @return string + * @throws \think\Exception + * @throws \think\db\exception\BindParamException + * @throws \think\exception\DbException + * @throws \think\exception\PDOException + */ + public function cancel($ids = ''){ + $param = $this->request->param(); + if($this->request->isPost()){ + try{ + if(isset($param['ids']))$ids = $param['ids']; + //设置模拟资格 + $model = (new \app\common\model\school\classes\order\ServiceOrder()); + $model->cancel($ids,0,true,'admin',$this->auth->id,true); + + }catch (\Exception $e){ + $this->error($e->getMessage()); + } + $this->success('取消成功!'); + } + $row = $this->model->get($ids); + + $this->view->assign('vo', $row); + return $this->view->fetch(); + } + + + + + + + } diff --git a/application/admin/lang/zh-cn/school/classes/type.php b/application/admin/lang/zh-cn/school/classes/type.php new file mode 100644 index 0000000..29e7fc8 --- /dev/null +++ b/application/admin/lang/zh-cn/school/classes/type.php @@ -0,0 +1,14 @@ + '分类名', + 'Status' => '状态', + 'Status 1' => '上架', + 'Set status to 1'=> '设为上架', + 'Status 2' => '下架', + 'Set status to 2'=> '设为下架', + 'Weigh' => '权重', + 'Createtime' => '创建时间', + 'Updatetime' => '修改时间', + 'Deletetime' => '删除时间' +]; diff --git a/application/admin/model/school/classes/Type.php b/application/admin/model/school/classes/Type.php new file mode 100644 index 0000000..37614df --- /dev/null +++ b/application/admin/model/school/classes/Type.php @@ -0,0 +1,59 @@ +getPk(); + $row->getQuery()->where($pk, $row[$pk])->update(['weigh' => $row[$pk]]); + } + }); + } + + + public function getStatusList() + { + return ['1' => __('Status 1'), '2' => __('Status 2')]; + } + + + public function getStatusTextAttr($value, $data) + { + $value = $value ? $value : (isset($data['status']) ? $data['status'] : ''); + $list = $this->getStatusList(); + return isset($list[$value]) ? $list[$value] : ''; + } + + + + +} diff --git a/application/admin/validate/school/classes/Type.php b/application/admin/validate/school/classes/Type.php new file mode 100644 index 0000000..c8c9b23 --- /dev/null +++ b/application/admin/validate/school/classes/Type.php @@ -0,0 +1,27 @@ + [], + 'edit' => [], + ]; + +} diff --git a/application/admin/view/manystore/index/add.html b/application/admin/view/manystore/index/add.html index 22a177f..ec66c5d 100644 --- a/application/admin/view/manystore/index/add.html +++ b/application/admin/view/manystore/index/add.html @@ -142,11 +142,11 @@
- +
- - - + + +
diff --git a/application/admin/view/manystore/index/edit.html b/application/admin/view/manystore/index/edit.html index f45c967..3f02f8a 100644 --- a/application/admin/view/manystore/index/edit.html +++ b/application/admin/view/manystore/index/edit.html @@ -153,11 +153,11 @@
- +
- - - + + +
diff --git a/application/admin/view/school/classes/classes_lib/addnew.html b/application/admin/view/school/classes/classes_lib/addnew.html index 6c66719..c90e52b 100644 --- a/application/admin/view/school/classes/classes_lib/addnew.html +++ b/application/admin/view/school/classes/classes_lib/addnew.html @@ -65,6 +65,26 @@
+ + + + +
+ +
+ + + + (没找到类型则点击按钮创建类型后重新下拉框选类型) + {:__('Add')} + + + +
+
+ + +
@@ -149,11 +169,11 @@
- +
- + @@ -216,11 +236,11 @@
- +
- - - + + +
diff --git a/application/admin/view/school/classes/classes_lib/edit.html b/application/admin/view/school/classes/classes_lib/edit.html index ce09c5e..cc34155 100644 --- a/application/admin/view/school/classes/classes_lib/edit.html +++ b/application/admin/view/school/classes/classes_lib/edit.html @@ -103,6 +103,25 @@
+ + + +
+ +
+ + + + (没找到类型则点击按钮创建类型后重新下拉框选类型) + {:__('Add')} + + + +
+
+ + +
@@ -188,11 +207,11 @@
- +
规格名每节课名 开始结束时间 限定人数
- + @@ -311,13 +330,13 @@
- +
- +
diff --git a/application/admin/view/school/classes/order/order/after_sales.html b/application/admin/view/school/classes/order/order/after_sales.html new file mode 100644 index 0000000..ae5d723 --- /dev/null +++ b/application/admin/view/school/classes/order/order/after_sales.html @@ -0,0 +1,21 @@ + + +
+

帮用户售后需填写原因!

+ +
+ +
+ +
+
+
+ + + + \ No newline at end of file diff --git a/application/admin/view/school/classes/order/service_order/admin_confirmation.html b/application/admin/view/school/classes/order/service_order/admin_confirmation.html new file mode 100644 index 0000000..86e594e --- /dev/null +++ b/application/admin/view/school/classes/order/service_order/admin_confirmation.html @@ -0,0 +1,61 @@ + + +
+

平台处理退款到账(如果同意退款,提交后需等待微信退款回调,回调成功才会更新订单状态!)

+ +
+ +
+ +
+ {foreach name="statusList" item="vo"} + + {/foreach} +
+ +
+
+
+ +
+
+ +
+ + +
+
+
+ + + + + + + \ No newline at end of file diff --git a/application/admin/view/school/classes/order/service_order/index.html b/application/admin/view/school/classes/order/service_order/index.html index f6b245f..ff049cf 100644 --- a/application/admin/view/school/classes/order/service_order/index.html +++ b/application/admin/view/school/classes/order/service_order/index.html @@ -17,25 +17,25 @@
- {:__('Add')} - {:__('Edit')} - {:__('Delete')} - + + + + - + + + + + + + + {:__('Recycle bin')}
规格名每节课名 开始结束时间 限定人数
diff --git a/application/admin/view/school/classes/order/service_order/shop_confirmation.html b/application/admin/view/school/classes/order/service_order/shop_confirmation.html new file mode 100644 index 0000000..ad84362 --- /dev/null +++ b/application/admin/view/school/classes/order/service_order/shop_confirmation.html @@ -0,0 +1,61 @@ +
+ +
+

帮机构售后处理

+ +
+ +
+ +
+ {foreach name="statusList" item="vo"} + + {/foreach} +
+ +
+
+
+ +
+
+ +
+ + ( 当前订单损耗比为 {$row.loss_proportion|htmlentities}% | 忽略损耗应退全额为 {$row.auto_price|htmlentities} | 退款金额不能超过订单应退全额 ) +
+
+
+ + + + + + +
\ No newline at end of file diff --git a/application/admin/view/school/classes/order/service_order/user_confirmation.html b/application/admin/view/school/classes/order/service_order/user_confirmation.html new file mode 100644 index 0000000..e3a7b10 --- /dev/null +++ b/application/admin/view/school/classes/order/service_order/user_confirmation.html @@ -0,0 +1,61 @@ +
+ +
+

帮用户售后处理

+ +
+ +
+ +
+ {foreach name="statusList" item="vo"} + + {/foreach} +
+ +
+
+
+ +
+
+ +
+ + +
+
+
+ + + + + + +
\ No newline at end of file diff --git a/application/admin/view/school/classes/order/service_order_log/index.html b/application/admin/view/school/classes/order/service_order_log/index.html index 696b02f..6714277 100644 --- a/application/admin/view/school/classes/order/service_order_log/index.html +++ b/application/admin/view/school/classes/order/service_order_log/index.html @@ -17,25 +17,25 @@
- {:__('Add')} - {:__('Edit')} - {:__('Delete')} - + + + + - + + + + + + + +
diff --git a/application/admin/view/school/classes/type/add.html b/application/admin/view/school/classes/type/add.html new file mode 100644 index 0000000..7fc2e3e --- /dev/null +++ b/application/admin/view/school/classes/type/add.html @@ -0,0 +1,33 @@ +
+ +
+ +
+ +
+
+
+ +
+ +
+ {foreach name="statusList" item="vo"} + + {/foreach} +
+ +
+
+
+ +
+ +
+
+ +
diff --git a/application/admin/view/school/classes/type/edit.html b/application/admin/view/school/classes/type/edit.html new file mode 100644 index 0000000..1b5468d --- /dev/null +++ b/application/admin/view/school/classes/type/edit.html @@ -0,0 +1,33 @@ +
+ +
+ +
+ +
+
+
+ +
+ +
+ {foreach name="statusList" item="vo"} + + {/foreach} +
+ +
+
+
+ +
+ +
+
+ +
diff --git a/application/admin/view/school/classes/type/index.html b/application/admin/view/school/classes/type/index.html new file mode 100644 index 0000000..dccb8b5 --- /dev/null +++ b/application/admin/view/school/classes/type/index.html @@ -0,0 +1,46 @@ +
+ +
+ {:build_heading(null,FALSE)} + +
+ + +
+
+
+
+
+ + {:__('Add')} + {:__('Edit')} + {:__('Delete')} + + + + + {:__('Recycle bin')} +
+ +
+
+
+ +
+
+
diff --git a/application/admin/view/school/classes/type/recyclebin.html b/application/admin/view/school/classes/type/recyclebin.html new file mode 100644 index 0000000..12b7775 --- /dev/null +++ b/application/admin/view/school/classes/type/recyclebin.html @@ -0,0 +1,25 @@ +
+ {:build_heading()} + +
+
+
+ +
+ +
+
+
diff --git a/application/api/controller/Index.php b/application/api/controller/Index.php index a3192f3..5406445 100644 --- a/application/api/controller/Index.php +++ b/application/api/controller/Index.php @@ -25,7 +25,7 @@ class Index extends Api /** * 各种协议文章 - * @ApiSummary(about_us 关于夜校 site.entry_agreement 入驻协议) + * @ApiSummary(about_us 关于夜校 entry_agreement 入驻协议 privacy 隐私协议) * @ApiMethod (GET) */ public function agreement() @@ -33,7 +33,8 @@ class Index extends Api $data = [ 'about_us' => config("site.about_us"), - 'entry_agreement' => config("site.entry_agreement") + 'entry_agreement' => config("site.entry_agreement"), + "privacy"=> config("site.privacy"), ]; $this->success(__('查询成功'), $data); diff --git a/application/api/controller/school/Classes.php b/application/api/controller/school/Classes.php index 9429ee0..b8b5367 100644 --- a/application/api/controller/school/Classes.php +++ b/application/api/controller/school/Classes.php @@ -5,6 +5,7 @@ namespace app\api\controller\school; use app\common\model\school\classes\Cate; use app\common\model\school\classes\ClassesLib; use app\common\model\school\classes\Label; +use app\common\model\school\classes\Type; use app\common\model\school\SearchCity; use think\Cache; use think\Log; @@ -14,7 +15,7 @@ use think\Log; */ class Classes extends Base { - protected $noNeedLogin = ["detail",'people','spec','label_list','cate_list',"index","classes_list"]; + protected $noNeedLogin = ["detail",'people','spec','label_list','cate_list',"index","classes_list","type_list"]; protected $noNeedRight = '*'; protected $model = null; @@ -67,7 +68,9 @@ class Classes extends Base $label = Label::showList(1, 20,""); - $this->success('获取成功', compact('distance_config_data',"distance_city","cate" ,"label" )); + $type = config("site.classes_type"); + + $this->success('获取成功', compact('distance_config_data',"distance_city","cate" ,"label" ,"type")); } @@ -213,6 +216,43 @@ class Classes extends Base } + + /** + * @ApiTitle( 课程类型列表) + * @ApiSummary(课程类型列表) + * @ApiRoute(/api/school/classes/type_list) + * @ApiMethod(GET) + * @ApiParams(name = "keywords", type = "string",required=false,description = "搜索关键字") + * @ApiParams(name = "page", type = "string",required=true,description = "页数") + * @ApiParams(name = "limit", type = "string",required=true,description = "条数") + * @ApiReturn({ + * + *}) + */ + public function type_list() + { + $user_id = 0; + $user = $this->auth->getUser();//登录用户 + if($user)$user_id = $user['id']; + $page = $this->request->get('page/d', 0); //页数 + $limit = $this->request->get('limit/d', 0); //条数 + $keywords = $this->request->get('keywords/s', ''); //搜索关键字 +// $type = $this->request->get('type/s', ''); //筛选学员和教练单 + + try{ + //当前申请状态 + $res = Type::showList($page, $limit,$keywords); +// if($user_id =='670153'){ +// file_put_contents("ceshi66.txt",(new AppointmentOrder())->getLastSql()); +// } + }catch (\Exception $e){ + + $this->error($e->getMessage()); + } + $this->success('查询成功', $res); + } + + /** * @ApiTitle( 课程标签列表) * @ApiSummary(课程标签列表) @@ -269,6 +309,7 @@ class Classes extends Base * @ApiParams(name = "classes_cate_ids", type = "string",required=false,description = "平台课程分类ids") * @ApiParams(name = "classes_label_ids", type = "string",required=false,description = "平台课程热门标签ids") * @ApiParams(name = "self_label_tag", type = "string",required=false,description = "机构特色标签") + * @ApiParams(name = "classes_type", type = "string",required=false,description = "平台课程类型") * @ApiParams(name = "keyword", type = "string",required=false,description = "关键字搜索") * @ApiParams(name = "type", type = "string",required=false,description = "地点类型:out=户外,in=室内") * @ApiParams(name = "address_type", type = "string",required=false,description = "地址类型:1=按机构,2=独立位置") @@ -312,6 +353,8 @@ class Classes extends Base $params["address_type"] = $this->request->get('address_type/s', ''); //机构店铺id $params["province"] = $this->request->get('province/s', ''); //机构店铺id + $params["classes_type"] = $this->request->get('classes_type/s', ''); //机构店铺id + $params["city"] = $this->request->get('city/s', ''); //机构店铺id $params["district"] = $this->request->get('district/s', ''); //机构店铺id $params["status"] = $this->request->get('status/s', ''); //机构店铺id diff --git a/application/common/controller/Backend.php b/application/common/controller/Backend.php index b0e0cad..eda3214 100644 --- a/application/common/controller/Backend.php +++ b/application/common/controller/Backend.php @@ -4,6 +4,8 @@ namespace app\common\controller; use app\admin\controller\famysql\Field; use app\admin\library\Auth; +use app\common\library\Virtual; +use app\common\model\school\Area; use Monolog\Handler\IFTTTHandler; use think\Config; use think\Controller; @@ -187,6 +189,21 @@ class Backend extends Controller + protected function getCity(){ + $city_data = Virtual::getNowCity(); + //全部参数前缀加 "q_" 塞入模板 + $this->assign('q_city', $city_data['city']); + $this->assign('q_area', $city_data['area']); + $this->assign('q_province', $city_data['province']); + $this->assign('q_city_code', $city_data['city_code']); + $this->assign('q_area_code', $city_data['area_code']); + $this->assign('q_province_code', $city_data['province_code']); + $this->assign('q_address_city', $city_data['address_city']); + } + + + + /** * 引入后台控制器的traits */ @@ -307,6 +324,9 @@ class Backend extends Controller //渲染管理员对象 $this->assign('admin', Session::get('admin')); $this->checkAssemblyParameters(); + +// $this->view->assign("selfhotList", $this->model->getSelfhotList()); + } /** diff --git a/application/common/controller/ManystoreBase.php b/application/common/controller/ManystoreBase.php index 79e5eb2..580262f 100644 --- a/application/common/controller/ManystoreBase.php +++ b/application/common/controller/ManystoreBase.php @@ -3,6 +3,7 @@ namespace app\common\controller; use app\admin\controller\famysql\Field; +use app\common\library\Virtual; use app\common\model\dyqc\ManystoreShop; use app\manystore\library\Auth; use app\common\model\ManystoreConfig; @@ -193,6 +194,19 @@ class ManystoreBase extends Controller } + protected function getCity(){ + $city_data = Virtual::getNowCity(); + //全部参数前缀加 "q_" 塞入模板 + $this->assign('q_city', $city_data['city']); + $this->assign('q_area', $city_data['area']); + $this->assign('q_province', $city_data['province']); + $this->assign('q_city_code', $city_data['city_code']); + $this->assign('q_area_code', $city_data['area_code']); + $this->assign('q_province_code', $city_data['province_code']); + $this->assign('q_address_city', $city_data['address_city']); + } + + /** * 引入后台控制器的traits @@ -202,7 +216,7 @@ class ManystoreBase extends Controller public function _initialize() { //移除HTML标签 - $this->request->filter('trim,strip_tags,htmlspecialchars'); + $this->request->filter('trim'); $modulename = $this->request->module(); $controllername = Loader::parseName($this->request->controller()); $actionname = strtolower($this->request->action()); diff --git a/application/common/library/Virtual.php b/application/common/library/Virtual.php index 3b38d95..0aa3815 100644 --- a/application/common/library/Virtual.php +++ b/application/common/library/Virtual.php @@ -2,6 +2,7 @@ namespace app\common\library; +use app\common\model\school\Area; use app\common\model\school\classes\VirtualHead; use app\common\model\school\classes\VirtualUser; @@ -122,5 +123,41 @@ class Virtual } + public static function getNowCity(){ + $address_city = config("site.the_city"); + //按/符号分割 + $the_city = explode("/",$address_city); + //初始化省市区变量 + $province = $city = $area = null; + $province_code = $city_code = $area_code = 0; + //只分割出一个为省 + //只分割出两个为省和市 + //分割出三个为省、市、县 + if(count($the_city)==1){ + $province = $the_city[0]; + }elseif(count($the_city)==2){ + $province = $the_city[0]; + $city = $the_city[1]; + }elseif(count($the_city)==3){ + $province = $the_city[0]; + $city = $the_city[1]; + $area = $the_city[2]; + } + //省市区分别模糊查询区域编码表获取编码 + if($province) $province_code = Area::where("level",1)->where("name","like","%$province%")->value("id"); + if($city) $city_code = Area::where("level",2)->where( "pid",$province_code)->where("name","like","%$city%")->value("id"); + if($area) $area_code = Area::where("level",3)->where( "pid",$city_code)->where("name","like","%$area%")->value("id"); + return [ + "address_city"=>$address_city, + "province"=>$province, + "city"=>$city, + "area"=>$area, + "province_code"=>$province_code, + "city_code"=>$city_code, + "area_code"=>$area_code + ]; + } + + } \ No newline at end of file diff --git a/application/common/model/school/classes/ClassesLib.php b/application/common/model/school/classes/ClassesLib.php index 94b128f..818768e 100644 --- a/application/common/model/school/classes/ClassesLib.php +++ b/application/common/model/school/classes/ClassesLib.php @@ -730,6 +730,11 @@ $user_unpaid_order = $user_paid_order =null; $selfetch = $selfetch->whereRaw(" {$a}self_label_tag REGEXP '({$self_label_tag})'"); } + if (isset($classes_type) && $classes_type) { + $classes_type = implode("|",explode(',',$classes_type)); + $selfetch = $selfetch->whereRaw(" {$a}classes_type REGEXP '({$classes_type})'"); + } + @@ -891,7 +896,7 @@ $user_unpaid_order = $user_paid_order =null; $classes_lib = self::get($classes_lib_id); if($classes_lib){ //如果课程虚拟参与者字300-2000随机 - $classes_lib->virtual_people = mt_rand(300, 2000); + $classes_lib->virtual_people = mt_rand(10, 50); //如果课程虚拟报名者字段 $classes_lib->virtual_num = 0; $classes_lib->save(); diff --git a/application/common/model/school/classes/Type.php b/application/common/model/school/classes/Type.php new file mode 100644 index 0000000..2f02018 --- /dev/null +++ b/application/common/model/school/classes/Type.php @@ -0,0 +1,109 @@ +getPk(); + $row->getQuery()->where($pk, $row[$pk])->update(['weigh' => $row[$pk]]); + } + }); + } + + + public function getStatusList() + { + return ['1' => __('Status 1'), '2' => __('Status 2')]; + } + + + public function getStatusTextAttr($value, $data) + { + $value = $value ? $value : (isset($data['status']) ? $data['status'] : ''); + $list = $this->getStatusList(); + return isset($list[$value]) ? $list[$value] : ''; + } + + + + + + /**得到基础条件 + * @param $status + * @param null $model + * @param string $alisa + */ + public static function getBaseWhere($whereData = [], $model = null, $alisa = '',$with = false) + { + + if (!$model) { + $model = new static; + if ($alisa&&!$with) $model = $model->alias($alisa); + } + if ($alisa) $alisa = $alisa . '.'; + $tableFields = (new static)->getTableFields(); + foreach ($tableFields as $fields) + { + if(in_array($fields, ['status']))continue; +// if (isset($whereData[$fields]) && $whereData[$fields]) $model = $model->where("{$alisa}{$fields}", '=', $whereData[$fields]); + + if (isset($whereData[$fields]) && $whereData[$fields]){ + if(is_array($whereData[$fields])){ + $model = $model->where("{$alisa}{$fields}", $whereData[$fields][0], $whereData[$fields][1]); + }else{ + $model = $model->where("{$alisa}{$fields}", '=', $whereData[$fields]); + } + + } + + + } + if (isset($whereData['status'])) $model = $model->where("{$alisa}status", 'in', $whereData['status']); + if (isset($whereData['keywords'])&&$whereData['keywords']) $model = $model->where("{$alisa}id|{$alisa}name", 'Like', "%{$whereData['keywords']}%"); + if (isset($whereData['time'])&&$whereData['time']){ + $model = $model->time($whereData['time']); + } + return $model; + } + + + public static function showList($page, $limit,$keywords){ + $field = ['*']; + $sort = "weigh desc,id desc"; + $serch_where = ['keywords'=>$keywords,"status"=>"1"]; + return (new self)->getBaseList($serch_where, $page, $limit,$sort,$field); + } + + + +} diff --git a/application/common/model/school/classes/order/ServiceOrder.php b/application/common/model/school/classes/order/ServiceOrder.php index 1d7048d..6d96ed1 100644 --- a/application/common/model/school/classes/order/ServiceOrder.php +++ b/application/common/model/school/classes/order/ServiceOrder.php @@ -603,7 +603,7 @@ class ServiceOrder extends BaseModel $classes_order->before_status = '0'; $classes_order->server_status = '0';//refund_status $classes_order->reason = ''; - $classes_order->classes_service_order_id = 0; +// $classes_order->classes_service_order_id = 0; //先不清楚上次售后记录 $classes_order->save(); return $classes_order; } @@ -1055,6 +1055,22 @@ class ServiceOrder extends BaseModel + /**更新课程订单售后成功 + * @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 orderSuccess($classes_order){ + if(is_numeric($classes_order)||is_string($classes_order))$classes_order = Order::where('order_no|id',$classes_order)->find(); + $classes_order->status = '6';//refund_status + $classes_order->server_status = '6';//refund_status + $classes_order->refundtime = time(); + $classes_order->save(); + return $classes_order; + } + /**用户售后提交确认信息 @@ -1373,7 +1389,9 @@ class ServiceOrder extends BaseModel 'refund_desc' => $refund_desc ?: "课程[{$detail["title"]}]订单[ID:{$classesorder['id']}]退款{$refund_money}已到账户", ]); - $config = Service::getConfig('wechat'); + $config = Service::getConfig('wechat',[],$classesorder->platform); + + $notify_url = request()->domain() . '/api/school/pay/notifyr/payment/' . $classesorder->pay_type . '/platform/' . $classesorder->platform; @@ -1399,7 +1417,7 @@ class ServiceOrder extends BaseModel if($trans){ self::rollbackTrans(); } - throw new \Exception($e->getMessage()); + throw new \Exception($e->getMessage().$e->getFile().$e->getLine()); } return $res; } @@ -1424,11 +1442,14 @@ class ServiceOrder extends BaseModel try{ //事务逻辑 //更新订单状态为同意 - $order = self::updateAdminConfirmationOrder($order); + $order = self::updateAdminConfirmationOrder($order); + self::orderSuccess($order["classes_order_id"]); //插入订单日志 ServiceOrderLog::log($order['id'],"[系统操作]课程订单售后系统退款已原路退回", 'admin', 0); + //执行课时数更新 + $res1 = order::statisticsAndUpdateClassesNumber($order['classes_order_id']); //调用订单取消事件 $data = ['serviceorder' => $order,"user_id"=>$order['user_id'],"oper_type"=>'admin',"oper_id"=>0]; diff --git a/application/manystore/controller/general/Profile.php b/application/manystore/controller/general/Profile.php index eba901a..fdc0da1 100644 --- a/application/manystore/controller/general/Profile.php +++ b/application/manystore/controller/general/Profile.php @@ -29,6 +29,7 @@ class Profile extends ManystoreBase $this->view->assign('typeList',$shop_info->getTypeList()); $this->view->assign('shop_info',$shop_info); + $this->getCity(); return $this->view->fetch(); } diff --git a/application/manystore/controller/school/classes/ClassesLib.php b/application/manystore/controller/school/classes/ClassesLib.php index cf83466..23a667c 100644 --- a/application/manystore/controller/school/classes/ClassesLib.php +++ b/application/manystore/controller/school/classes/ClassesLib.php @@ -60,7 +60,7 @@ class ClassesLib extends ManystoreBase $this->view->assign("specStatusList", (new \app\manystore\model\school\classes\ClassesSpec)->getStatusList()); - + $this->getCity(); } public function import() @@ -298,6 +298,9 @@ class ClassesLib extends ManystoreBase $validate = is_bool($this->modelValidate) ? ($this->modelSceneValidate ? $name . '.add' : $name) : $this->modelValidate; $this->model->validateFailException(true)->validate($validate); } + + + $this->update_check($params,$row=null); $result = false; Db::startTrans(); @@ -433,6 +436,9 @@ class ClassesLib extends ManystoreBase if ($this->request->isPost()) { $params = $this->request->post("row/a"); + + + if ($params) { $params = $this->preExcludeFields($params); diff --git a/application/manystore/controller/school/classes/Type.php b/application/manystore/controller/school/classes/Type.php new file mode 100644 index 0000000..9ecc183 --- /dev/null +++ b/application/manystore/controller/school/classes/Type.php @@ -0,0 +1,40 @@ +model = new \app\manystore\model\school\classes\Type; + $this->view->assign("statusList", $this->model->getStatusList()); + } + + public function import() + { + parent::import(); + } + + /** + * 默认生成的控制器所继承的父类中有index/add/edit/del/multi五个基础方法、destroy/restore/recyclebin三个回收站方法 + * 因此在当前控制器中可不用编写增删改查的代码,除非需要自己控制这部分逻辑 + * 需要将application/admin/library/traits/Backend.php中对应的方法复制到当前控制器,然后进行修改 + */ + + +} diff --git a/application/manystore/controller/school/classes/order/ServiceOrder.php b/application/manystore/controller/school/classes/order/ServiceOrder.php index deee654..05c01e7 100644 --- a/application/manystore/controller/school/classes/order/ServiceOrder.php +++ b/application/manystore/controller/school/classes/order/ServiceOrder.php @@ -80,4 +80,152 @@ class ServiceOrder extends ManystoreBase return $this->view->fetch(); } + + + + + + + /**用户确认 + * @return string + * @throws \think\Exception + * @throws \think\exception\DbException + */ + public function user_confirmation($ids = ""){ + + if($this->request->isPost()) + { + try{ + $params = $this->request->post("row/a"); + $order_no = $params["order_no"]; + $reject_images = $params["reject_images"]; + $reject_reason = $params["reject_reason"]; + $status = $params["status"]; + $model = (new \app\common\model\school\classes\order\ServiceOrder()); + $model->userConfirmation($order_no,$status,$reject_reason,$reject_images,0,true,'shop',$this->auth->id,true); + }catch (\Exception $e){ + $this->error($e->getMessage()); + } + + $this->success("已完成审核"); + } + + $row = $this->model->where(array('id'=>$ids))->find(); + if (!$row) { + $this->error(__('No Results were found')); + } + +// $row = $this->model->get($param['ids']); + $this->view->assign("statusList", ["yes"=>"同意", "no"=>"拒绝"]); + $this->view->assign('row', $row); + return $this->view->fetch(); + } + + + + + /**机构确认 + * @return string + * @throws \think\Exception + * @throws \think\exception\DbException + */ + public function shop_confirmation($ids = ""){ + + if($this->request->isPost()) + { + try{ + $params = $this->request->post("row/a"); + $order_no = $params["order_no"]; + $reject_images = $params["reject_images"]; + $reject_reason = $params["reject_reason"]; + $price = $params["price"]; + $status = $params["status"]; + $model = (new \app\common\model\school\classes\order\ServiceOrder()); + $model->shopConfirmation($order_no,$status,$price,$reject_reason,$reject_images,0,true,'shop',$this->auth->id,true); + }catch (\Exception $e){ + $this->error($e->getMessage()); + } + + $this->success("已完成审核"); + } + + $row = $this->model->where(array('id'=>$ids))->find(); + if (!$row) { + $this->error(__('No Results were found')); + } + +// $row = $this->model->get($param['ids']); + $this->view->assign("statusList", ["yes"=>"同意", "no"=>"拒绝"]); + $this->view->assign('row', $row); + return $this->view->fetch(); + } + + + + /**系统确认 + * @return string + * @throws \think\Exception + * @throws \think\exception\DbException + */ + public function admin_confirmation($ids = ""){ + + if($this->request->isPost()) + { + try{ + $params = $this->request->post("row/a"); + $order_no = $params["order_no"]; + $reject_images = $params["reject_images"]; + $reject_reason = $params["reject_reason"]; + $status = $params["status"]; + $model = (new \app\common\model\school\classes\order\ServiceOrder()); + $model->adminConfirmation($order_no,$status,$reject_reason,$reject_images,0,true,'shop',$this->auth->id,true); + }catch (\Exception $e){ + $this->error($e->getMessage()); + } + + $this->success("已完成审核"); + } + + $row = $this->model->where(array('id'=>$ids))->find(); + if (!$row) { + $this->error(__('No Results were found')); + } + +// $row = $this->model->get($param['ids']); + $this->view->assign("statusList", ["yes"=>"同意", "no"=>"拒绝"]); + $this->view->assign('row', $row); + return $this->view->fetch(); + } + + + + + + /** + * 后台核销 + * @return string + * @throws \think\Exception + * @throws \think\db\exception\BindParamException + * @throws \think\exception\DbException + * @throws \think\exception\PDOException + */ + public function cancel($ids = ''){ + $param = $this->request->param(); + if($this->request->isPost()){ + try{ + if(isset($param['ids']))$ids = $param['ids']; + //设置模拟资格 + $model = (new \app\common\model\school\classes\order\ServiceOrder()); + $model->cancel($ids,0,true,'shop',$this->auth->id,true); + + }catch (\Exception $e){ + $this->error($e->getMessage()); + } + $this->success('取消成功!'); + } + $row = $this->model->get($ids); + $this->view->assign('vo', $row); + return $this->view->fetch(); + } + } diff --git a/application/manystore/lang/zh-cn/school/classes/order/service_order.php b/application/manystore/lang/zh-cn/school/classes/order/service_order.php index 568e510..af29506 100644 --- a/application/manystore/lang/zh-cn/school/classes/order/service_order.php +++ b/application/manystore/lang/zh-cn/school/classes/order/service_order.php @@ -35,7 +35,8 @@ return [ 'C_price' => '售后已确认退款金额', 'Real_refundprice' => '实际退款金额', 'Sub_refundprice' => '剩余未退金额', - 'Platform' => '退款平台:miniapp=微信小程序', + 'Platform' => '退款平台', + 'Platform miniapp' => '微信小程序', 'Pay_type' => '退款方式', 'Pay_type yue' => '余额', 'Pay_type wechat' => '微信', diff --git a/application/manystore/lang/zh-cn/school/classes/type.php b/application/manystore/lang/zh-cn/school/classes/type.php new file mode 100644 index 0000000..ea24c0a --- /dev/null +++ b/application/manystore/lang/zh-cn/school/classes/type.php @@ -0,0 +1,12 @@ + '分类名', + 'Status' => '状态', + 'Status 1' => '上架', + 'Status 2' => '下架', + 'Weigh' => '权重', + 'Createtime' => '创建时间', + 'Updatetime' => '修改时间', + 'Deletetime' => '删除时间' +]; diff --git a/application/manystore/model/school/classes/Type.php b/application/manystore/model/school/classes/Type.php new file mode 100644 index 0000000..999cf93 --- /dev/null +++ b/application/manystore/model/school/classes/Type.php @@ -0,0 +1,57 @@ +getPk(); + $row->getQuery()->where($pk, $row[$pk])->update(['weigh' => $row[$pk]]); + }); + } + + + public function getStatusList() + { + return ['1' => __('Status 1'), '2' => __('Status 2')]; + } + + + public function getStatusTextAttr($value, $data) + { + $value = $value ? $value : (isset($data['status']) ? $data['status'] : ''); + $list = $this->getStatusList(); + return isset($list[$value]) ? $list[$value] : ''; + } + + + + +} diff --git a/application/manystore/validate/school/classes/Type.php b/application/manystore/validate/school/classes/Type.php new file mode 100644 index 0000000..00158a2 --- /dev/null +++ b/application/manystore/validate/school/classes/Type.php @@ -0,0 +1,27 @@ + [], + 'edit' => [], + ]; + +} diff --git a/application/manystore/view/school/classes/classes_lib/add.html b/application/manystore/view/school/classes/classes_lib/add.html index d5f3993..1c1fa56 100644 --- a/application/manystore/view/school/classes/classes_lib/add.html +++ b/application/manystore/view/school/classes/classes_lib/add.html @@ -142,11 +142,11 @@
- +
- - - + + +
diff --git a/application/manystore/view/school/classes/classes_lib/addnew.html b/application/manystore/view/school/classes/classes_lib/addnew.html index 341befd..89b9e46 100644 --- a/application/manystore/view/school/classes/classes_lib/addnew.html +++ b/application/manystore/view/school/classes/classes_lib/addnew.html @@ -44,6 +44,22 @@
+ + + + +
+ +
+ + + + +
+
+ + +
@@ -126,11 +142,11 @@
- +
- + @@ -197,11 +213,11 @@
- +
- - - + + +
diff --git a/application/manystore/view/school/classes/classes_lib/edit.html b/application/manystore/view/school/classes/classes_lib/edit.html index e201f25..24fb652 100644 --- a/application/manystore/view/school/classes/classes_lib/edit.html +++ b/application/manystore/view/school/classes/classes_lib/edit.html @@ -85,6 +85,18 @@
+ + +
+ +
+ + + +
+
+ +
@@ -167,11 +179,11 @@
- +
规格名每节课名 开始结束时间 限定人数
- + @@ -291,13 +303,13 @@
- +
- +
diff --git a/application/manystore/view/school/classes/order/service_order/admin_confirmation.html b/application/manystore/view/school/classes/order/service_order/admin_confirmation.html new file mode 100644 index 0000000..6a5327f --- /dev/null +++ b/application/manystore/view/school/classes/order/service_order/admin_confirmation.html @@ -0,0 +1,61 @@ + + +
+

平台处理退款到账

+ +
+ +
+ +
+ {foreach name="statusList" item="vo"} + + {/foreach} +
+ +
+
+
+ +
+
+ +
+ + +
+
+
+ + + + + + + \ No newline at end of file diff --git a/application/manystore/view/school/classes/order/service_order/index.html b/application/manystore/view/school/classes/order/service_order/index.html index 93d5790..fa94f74 100644 --- a/application/manystore/view/school/classes/order/service_order/index.html +++ b/application/manystore/view/school/classes/order/service_order/index.html @@ -17,23 +17,23 @@
规格名每节课名 开始结束时间 限定人数
diff --git a/application/manystore/view/school/classes/order/service_order/shop_confirmation.html b/application/manystore/view/school/classes/order/service_order/shop_confirmation.html new file mode 100644 index 0000000..ad84362 --- /dev/null +++ b/application/manystore/view/school/classes/order/service_order/shop_confirmation.html @@ -0,0 +1,61 @@ +
+ +
+

帮机构售后处理

+ +
+ +
+ +
+ {foreach name="statusList" item="vo"} + + {/foreach} +
+ +
+
+
+ +
+
+ +
+ + ( 当前订单损耗比为 {$row.loss_proportion|htmlentities}% | 忽略损耗应退全额为 {$row.auto_price|htmlentities} | 退款金额不能超过订单应退全额 ) +
+
+
+ + + + + + +
\ No newline at end of file diff --git a/application/manystore/view/school/classes/order/service_order/user_confirmation.html b/application/manystore/view/school/classes/order/service_order/user_confirmation.html new file mode 100644 index 0000000..e3a7b10 --- /dev/null +++ b/application/manystore/view/school/classes/order/service_order/user_confirmation.html @@ -0,0 +1,61 @@ +
+ +
+

帮用户售后处理

+ +
+ +
+ +
+ {foreach name="statusList" item="vo"} + + {/foreach} +
+ +
+
+
+ +
+
+ +
+ + +
+
+
+ + + + + + +
\ No newline at end of file diff --git a/application/manystore/view/school/classes/order/service_order_log/index.html b/application/manystore/view/school/classes/order/service_order_log/index.html index cf62f45..f8dffd4 100644 --- a/application/manystore/view/school/classes/order/service_order_log/index.html +++ b/application/manystore/view/school/classes/order/service_order_log/index.html @@ -17,23 +17,23 @@ diff --git a/application/manystore/view/school/classes/type/add.html b/application/manystore/view/school/classes/type/add.html new file mode 100644 index 0000000..2a4fc8c --- /dev/null +++ b/application/manystore/view/school/classes/type/add.html @@ -0,0 +1,34 @@ +
+ +
+ +
+ +
+
+
+ +
+ +
+ {foreach name="statusList" item="vo"} + + {/foreach} +
+ +
+
+
+ +
+ +
+
+ +
diff --git a/application/manystore/view/school/classes/type/edit.html b/application/manystore/view/school/classes/type/edit.html new file mode 100644 index 0000000..8a2301c --- /dev/null +++ b/application/manystore/view/school/classes/type/edit.html @@ -0,0 +1,34 @@ +
+ +
+ +
+ +
+
+
+ +
+ +
+ {foreach name="statusList" item="vo"} + + {/foreach} +
+ +
+
+
+ +
+ +
+
+ +
diff --git a/application/manystore/view/school/classes/type/index.html b/application/manystore/view/school/classes/type/index.html new file mode 100644 index 0000000..ba72e69 --- /dev/null +++ b/application/manystore/view/school/classes/type/index.html @@ -0,0 +1,44 @@ +
+ +
+ {:build_heading(null,FALSE)} + +
+ + + +
diff --git a/application/manystore/view/school/classes/type/recyclebin.html b/application/manystore/view/school/classes/type/recyclebin.html new file mode 100644 index 0000000..12b7775 --- /dev/null +++ b/application/manystore/view/school/classes/type/recyclebin.html @@ -0,0 +1,25 @@ +
+ {:build_heading()} + +
+
+
+ +
+ +
+
+
diff --git a/public/assets/js/backend/manystore/index.js b/public/assets/js/backend/manystore/index.js index f7733ae..8ea0c9c 100644 --- a/public/assets/js/backend/manystore/index.js +++ b/public/assets/js/backend/manystore/index.js @@ -176,6 +176,9 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin ], events: Table.api.events.operate, formatter: Table.api.formatter.operate}, {field: 'id', title: 'ID'}, + {field: 'shop.name', title: __('申请姓名|机构名'), operate: 'LIKE'}, + {field: 'shop.logo', title: __('Logo'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image}, + {field: 'username', title: __('Username')}, {field: 'nickname', title: __('Nickname')}, @@ -191,8 +194,6 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin // {field: 'user_id', title: __('申请姓名|机构名'), operate: 'LIKE'}, - {field: 'shop.name', title: __('申请姓名|机构名'), operate: 'LIKE'}, - {field: 'shop.logo', title: __('Logo'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image}, {field: 'shop.image', title: __('Image'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image}, {field: 'shop.address_city', title: __('Address_city'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, {field: 'shop.province', title: __('Province'),visible:false}, @@ -235,9 +236,14 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin $("#district").val(district); } $(this).blur(); + }); + // $(".city-select-tab a").removeClass('active'); + $('[data-count="district"]').tab('show'); + + $(document).on('click', '.btn-changeuser', function (event) { var url = $(this).attr('data-url'); diff --git a/public/assets/js/backend/school/classes/order/order.js b/public/assets/js/backend/school/classes/order/order.js index 59f6aec..36fcd46 100644 --- a/public/assets/js/backend/school/classes/order/order.js +++ b/public/assets/js/backend/school/classes/order/order.js @@ -10,6 +10,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin edit_url: 'school/classes/order/order/edit', del_url: 'school/classes/order/order/del', cancel_url: 'school/classes/order/order/cancel', + after_sales_url: 'school/classes/order/order/after_sales', multi_url: 'school/classes/order/order/multi', import_url: 'school/classes/order/order/import', table: 'school_classes_order', @@ -64,6 +65,37 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin return row.paytime; } }, + { + name: 'after_sales', + text: __('平台发起售后'), + title: __('平台发起售后'), + classname: 'btn btn-xs btn-danger btn-dialog', + icon: 'fa fa-sign-in', + url: $.fn.bootstrapTable.defaults.extend.after_sales_url, + callback: function (data) { + + }, + visible: function (row) { + return row.status == '3'; + } + }, + + { + name: 'service_order', + text: __('售后单情况'), + title: __('售后单情况'), + classname: 'btn btn-xs btn-primary btn-dialog', + icon: 'fa fa-list', + url: service_order_url, + callback: function (data) { + + }, + visible: function (row) { + return row.classes_service_order_id; + } + }, + + { name: 'order', text: __('课时预约记录'), @@ -255,6 +287,13 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin edit: function () { Controller.api.bindevent(); }, + after_sales: function(){ + $("#after_sales").on('click', function() { + $("#after_sales-form").attr("action",'school/classes/order/order/after_sales').submit(); + }); + Controller.api.bindevent(); + }, + api: { bindevent: function () { Form.api.bindevent($("form[role=form]")); @@ -275,5 +314,10 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin return 'school/classes/hourorder/order/index?classes_order_id='+row.id + '&classes_lib_id='+row.classes_lib_id; } + var service_order_url = function (row,dom) { + return 'school/classes/order/service_order/index?id='+row.classes_service_order_id; + } + + return Controller; }); diff --git a/public/assets/js/backend/school/classes/order/service_order.js b/public/assets/js/backend/school/classes/order/service_order.js index 3d09577..4915205 100644 --- a/public/assets/js/backend/school/classes/order/service_order.js +++ b/public/assets/js/backend/school/classes/order/service_order.js @@ -6,10 +6,16 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin Table.api.init({ extend: { index_url: 'school/classes/order/service_order/index' + location.search, - add_url: 'school/classes/order/service_order/add', + add_url: 'school/classes/order/service_order/add'+ location.search, edit_url: 'school/classes/order/service_order/edit', del_url: 'school/classes/order/service_order/del', multi_url: 'school/classes/order/service_order/multi', + cancel_url: 'school/classes/order/service_order/cancel', + user_confirmation_url: 'school/classes/order/service_order/user_confirmation', + shop_confirmation_url: 'school/classes/order/service_order/shop_confirmation', + admin_confirmation_url: 'school/classes/order/service_order/admin_confirmation', + + import_url: 'school/classes/order/service_order/import', table: 'school_classes_service_order', } @@ -27,18 +33,145 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin columns: [ [ {checkbox: true}, + + {field: 'operate', title: __('Operate'), table: table , buttons: [ + {name: 'cancel', + text: '帮用户取消售后', + icon: 'fa fa-sign-in', + classname: 'btn btn-xs btn-warning btn-magic btn-ajax', + url: $.fn.bootstrapTable.defaults.extend.cancel_url, + confirm: '帮用户取消售后', + success: function (data, ret) { + Layer.alert(ret.msg ); + $(".btn-refresh").trigger("click"); + }, + error: function (data, ret) { + Layer.alert(ret.msg); + return false; + }, + visible: function (row) { + //显示条件 只能待入住订单 + if(row.status == "1" && row.service_stauts == "1"){ + return true; + } + return false; + }}, + { + name: 'user_confirmation', + text: __('帮用户确认价格'), + title: __('帮用户确认价格'), + classname: 'btn btn-xs btn-danger btn-dialog', + icon: 'fa fa-sign-in', + url: $.fn.bootstrapTable.defaults.extend.user_confirmation_url, + callback: function (data) { + + }, + visible: function (row) { + return row.status == '4' && row.service_stauts == "4"; + } + }, + { + name: 'shop_confirmation', + text: __('帮机构处理售后'), + title: __('帮机构处理售后'), + classname: 'btn btn-xs btn-danger btn-dialog', + icon: 'fa fa-sign-in', + url: $.fn.bootstrapTable.defaults.extend.shop_confirmation_url, + callback: function (data) { + + }, + visible: function (row) { + return row.status == '1' && row.service_stauts == "1"; + } + }, + { + name: 'admin_confirmation', + text: __('平台处理退款'), + title: __('平台处理退款'), + classname: 'btn btn-xs btn-danger btn-dialog', + icon: 'fa fa-sign-in', + url: $.fn.bootstrapTable.defaults.extend.admin_confirmation_url, + callback: function (data) { + + }, + visible: function (row) { + return row.status == '4' && row.service_stauts == "7"; + } + }, + + { + name: 'order_log', + text: __('售后日志'), + title: __('售后日志'), + classname: 'btn btn-xs btn-primary btn-dialog', + icon: 'fa fa-list', + url: order_log_url, + callback: function (data) { + + }, + // visible: function (row) { + // return row.status == '2'||row.status == '3'; + // } + }, + { + name: 'order_detail', + text: __('课程信息'), + title: __('课程信息'), + classname: 'btn btn-xs btn-primary btn-dialog', + icon: 'fa fa-list', + url: order_detail_url, + callback: function (data) { + + }, + // visible: function (row) { + // return row.paytime; + // } + }, + // + // {name: 'unsetmockauth', + // text: '取消加圈资格', + // icon: 'fa fa-sign-in', + // classname: 'btn btn-xs btn-danger btn-magic btn-ajax', + // url: $.fn.bootstrapTable.defaults.extend.unsetmockauth_url, + // confirm: '(分车版本)确认取消用户加圈资格!', + // success: function (data, ret) { + // Layer.alert(ret.msg ); + // $(".btn-refresh").trigger("click"); + // }, + // error: function (data, ret) { + // Layer.alert(ret.msg); + // return false; + // }, + // visible: function (row) { + // //显示条件 只能待入住订单 + // if((row.status == 2 || row.status == 3) && row.mock_type == "base" && row.add_mock_status == "2"){ + // return true; + // } + // return false; + // }}, + + ], events: Table.api.events.operate, formatter: Table.api.formatter.operate}, + + {field: 'id', title: __('Id')}, {field: 'order_no', title: __('Order_no'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, + {field: 'status', title: __('Status'), searchList: {"1":__('Status 1'),"4":__('Status 4'),"7":__('Status 7'),"-3":__('Status -3')}, formatter: Table.api.formatter.status}, + + {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: 'user.nickname', title: __('User.nickname'), operate: 'LIKE'}, + {field: 'user.realname',visible:false, 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: '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'),"10":__('Service_stauts 10'),"-3":__('Service_stauts -3')}, formatter: Table.api.formatter.normal}, + {field: 'classes_order_id',visible:false, title: __('Classes_order_id')}, + {field: 'user_id',visible:false, title: __('User_id')}, + {field: 'classes_order_detail_id',visible:false, title: __('Classes_order_detail_id')}, + {field: 'classes_lib_id',visible:false, title: __('Classes_lib_id')}, + {field: 'manystore_id',visible:false, title: __('Manystore_id')}, + {field: 'shop_id',visible:false, title: __('Shop_id')}, + {field: 'service_stauts', title: __('Service_stauts'), searchList: {"1":__('Service_stauts 1'),"4":__('Service_stauts 4'),"7":__('Service_stauts 7'),"10":__('Service_stauts 10'),"-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}, @@ -49,6 +182,8 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin {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}, @@ -58,20 +193,14 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin {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} + {field: 'classesorder.order_no',visible:false, title: __('Order.order_no'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, + {field: 'classesorder.pay_no',visible:false, title: __('Order.pay_no'), 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: 'manystore.nickname',visible:false, title: __('Manystore.nickname'), operate: 'LIKE'}, + {field: 'shop.name',visible:false, title: __('Shop.name'), operate: 'LIKE'}, + {field: 'shop.logo',visible:false, title: __('Shop.logo'), operate: 'LIKE'}, + // {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate} ] ] }); @@ -145,11 +274,73 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin edit: function () { Controller.api.bindevent(); }, + admin_confirmation: function(){ + $("#admin_confirmation").on('click', function() { + $("#admin_confirmation-form").attr("action",'school/classes/order/service_order/admin_confirmation').submit(); + }); + Controller.api.bindevent(); + }, + user_confirmation: function(){ + $("#user_confirmation").on('click', function() { + $("#user_confirmation-form").attr("action",'school/classes/order/service_order/user_confirmation').submit(); + }); + Controller.api.bindevent(); + }, + shop_confirmation: function(){ + $("#shop_confirmation").on('click', function() { + $("#shop_confirmation-form").attr("action",'school/classes/order/service_order/shop_confirmation').submit(); + }); + Controller.api.bindevent(); + }, + + + api: { bindevent: function () { + generrate.listen(); Form.api.bindevent($("form[role=form]")); } } }; + + + var order_log_url = function (row,dom) { + return 'school/classes/order/service_order_log/index?classes_service_order_id='+row.id; + } + + var order_detail_url = function (row,dom) { + return 'school/classes/order/order_detail/index?id='+row.classes_order_detail_id; + } + + + + var generrate = { + listen:function () { + this.offlineListen(); + // this.priceListen(); + }, + offlineListen:function () { + var that = this; + // console.log($("input:radio[name='row[address_type]']").val()) + // this.setOfflineType($("input:radio[name='row[address_type]']").val()); + $("input:radio[name='row[status]']").change(function (){ + that.setOfflineType($(this).val()); + }); + }, + setOfflineType:function (val) { + switch (val) { + case 'yes': + $('#status_no').hide(); + $('#status_yes').show(); + break; + case 'no': + $('#status_yes').hide(); + $('#status_no').show(); + break; + } + } + } + + return Controller; }); diff --git a/public/assets/js/backend/school/classes/order/service_order_log.js b/public/assets/js/backend/school/classes/order/service_order_log.js index ce0848f..3b2cbd5 100644 --- a/public/assets/js/backend/school/classes/order/service_order_log.js +++ b/public/assets/js/backend/school/classes/order/service_order_log.js @@ -28,13 +28,13 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin [ {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: 'classes_service_order_id',visible:false, title: __('Classes_service_order_id')}, + {field: 'classes_order_id',visible:false, title: __('Classes_order_id')}, + {field: 'user_id',visible:false, title: __('User_id')}, + {field: 'classes_order_detail_id',visible:false, title: __('Classes_order_detail_id')}, + {field: 'classes_lib_id',visible:false, title: __('Classes_lib_id')}, + {field: 'manystore_id',visible:false, title: __('Manystore_id')}, + {field: 'shop_id',visible:false, 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'),"10":__('Service_stauts 10'),"-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}, @@ -43,16 +43,16 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin {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} + // {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',visible:false, title: __('User.nickname'), operate: 'LIKE'}, + {field: 'user.realname',visible:false, title: __('User.realname'), operate: 'LIKE'}, + {field: 'user.mobile',visible:false, title: __('User.mobile'), operate: 'LIKE'}, + {field: 'user.avatar',visible:false, 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} ] ] }); @@ -72,5 +72,10 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin } } }; + + + + + return Controller; }); diff --git a/public/assets/js/backend/school/classes/type.js b/public/assets/js/backend/school/classes/type.js new file mode 100644 index 0000000..08f210f --- /dev/null +++ b/public/assets/js/backend/school/classes/type.js @@ -0,0 +1,116 @@ +define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) { + + var Controller = { + index: function () { + // 初始化表格参数配置 + Table.api.init({ + extend: { + index_url: 'school/classes/type/index' + location.search, + add_url: 'school/classes/type/add', + edit_url: 'school/classes/type/edit', + del_url: 'school/classes/type/del', + multi_url: 'school/classes/type/multi', + import_url: 'school/classes/type/import', + table: 'school_classes_type', + } + }); + + var table = $("#table"); + + // 初始化表格 + table.bootstrapTable({ + url: $.fn.bootstrapTable.defaults.extend.index_url, + pk: 'id', + sortName: 'weigh', + columns: [ + [ + {checkbox: true}, + {field: 'id', title: __('Id')}, + {field: 'name', title: __('Name'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, + {field: 'status', title: __('Status'), searchList: {"1":__('Status 1'),"2":__('Status 2')}, formatter: Table.api.formatter.status}, + {field: 'weigh', title: __('Weigh'), operate: false}, + {field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime}, + {field: 'updatetime', title: __('Updatetime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime}, + {field: '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/type/recyclebin' + location.search, + pk: 'id', + sortName: 'id', + columns: [ + [ + {checkbox: true}, + {field: 'id', title: __('Id')}, + {field: 'name', title: __('Name'), align: 'left'}, + { + 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/type/restore', + refresh: true + }, + { + name: 'Destroy', + text: __('Destroy'), + classname: 'btn btn-xs btn-danger btn-ajax btn-destroyit', + icon: 'fa fa-times', + url: 'school/classes/type/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; +}); diff --git a/public/assets/js/manystore/school/classes/order/order.js b/public/assets/js/manystore/school/classes/order/order.js index 563d2b4..bec7ef0 100644 --- a/public/assets/js/manystore/school/classes/order/order.js +++ b/public/assets/js/manystore/school/classes/order/order.js @@ -65,7 +65,20 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin } }, + { + name: 'service_order', + text: __('售后单情况'), + title: __('售后单情况'), + classname: 'btn btn-xs btn-primary btn-dialog', + icon: 'fa fa-list', + url: service_order_url, + callback: function (data) { + }, + visible: function (row) { + return row.classes_service_order_id; + } + }, { name: 'order', @@ -276,6 +289,9 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin return 'school/classes/hourorder/order/index?classes_order_id='+row.id + '&classes_lib_id='+row.classes_lib_id; } + var service_order_url = function (row,dom) { + return 'school/classes/order/service_order/index?classes_order_id='+row.id; + } return Controller; }); \ No newline at end of file diff --git a/public/assets/js/manystore/school/classes/order/service_order.js b/public/assets/js/manystore/school/classes/order/service_order.js index 093242f..c012985 100644 --- a/public/assets/js/manystore/school/classes/order/service_order.js +++ b/public/assets/js/manystore/school/classes/order/service_order.js @@ -6,10 +6,15 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin Table.api.init({ extend: { index_url: 'school/classes/order/service_order/index' + location.search, - add_url: 'school/classes/order/service_order/add', + add_url: 'school/classes/order/service_order/add'+ location.search, edit_url: 'school/classes/order/service_order/edit', del_url: 'school/classes/order/service_order/del', multi_url: 'school/classes/order/service_order/multi', + + cancel_url: 'school/classes/order/service_order/cancel', + user_confirmation_url: 'school/classes/order/service_order/user_confirmation', + shop_confirmation_url: 'school/classes/order/service_order/shop_confirmation', + admin_confirmation_url: 'school/classes/order/service_order/admin_confirmation', import_url: 'school/classes/order/service_order/import', table: 'school_classes_service_order', } @@ -25,19 +30,102 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin columns: [ [ {checkbox: true}, + + + {field: 'operate', title: __('Operate'), table: table , buttons: [ + + + { + name: 'shop_confirmation', + text: __('机构处理售后'), + title: __('机构处理售后'), + classname: 'btn btn-xs btn-danger btn-dialog', + icon: 'fa fa-sign-in', + url: $.fn.bootstrapTable.defaults.extend.shop_confirmation_url, + callback: function (data) { + + }, + visible: function (row) { + return row.status == '1' && row.service_stauts == "1"; + } + }, + + + { + name: 'order_log', + text: __('售后日志'), + title: __('售后日志'), + classname: 'btn btn-xs btn-primary btn-dialog', + icon: 'fa fa-list', + url: order_log_url, + callback: function (data) { + + }, + // visible: function (row) { + // return row.status == '2'||row.status == '3'; + // } + }, + { + name: 'order_detail', + text: __('课程信息'), + title: __('课程信息'), + classname: 'btn btn-xs btn-primary btn-dialog', + icon: 'fa fa-list', + url: order_detail_url, + callback: function (data) { + + }, + // visible: function (row) { + // return row.paytime; + // } + }, + // + // {name: 'unsetmockauth', + // text: '取消加圈资格', + // icon: 'fa fa-sign-in', + // classname: 'btn btn-xs btn-danger btn-magic btn-ajax', + // url: $.fn.bootstrapTable.defaults.extend.unsetmockauth_url, + // confirm: '(分车版本)确认取消用户加圈资格!', + // success: function (data, ret) { + // Layer.alert(ret.msg ); + // $(".btn-refresh").trigger("click"); + // }, + // error: function (data, ret) { + // Layer.alert(ret.msg); + // return false; + // }, + // visible: function (row) { + // //显示条件 只能待入住订单 + // if((row.status == 2 || row.status == 3) && row.mock_type == "base" && row.add_mock_status == "2"){ + // return true; + // } + // return false; + // }}, + + ], events: Table.api.events.operate, formatter: Table.api.formatter.operate}, + + + {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: 'order_no', title: __('Order_no'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, + {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: 'user.nickname', title: __('User.nickname'), operate: 'LIKE'}, + {field: 'user.realname',visible:false, 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: 'reason', title: __('Reason'), operate: 'LIKE'}, + {field: 'classes_order_id',visible:false, title: __('Classes_order_id')}, + {field: 'user_id',visible:false, title: __('User_id')}, + {field: 'classes_order_detail_id',visible:false, title: __('Classes_order_detail_id')}, + {field: 'classes_lib_id',visible:false, title: __('Classes_lib_id')}, + {field: 'manystore_id',visible:false, title: __('Manystore_id')}, + {field: 'shop_id',visible:false, 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'),"10":__('Service_stauts 10'),"-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_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'}, @@ -46,29 +134,28 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin {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: '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')}, - {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} + {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: 'schoolclassesorder.order_no',visible:false, title: __('Schoolclassesorder.order_no'), operate: 'LIKE'}, + {field: 'schoolclassesorder.pay_no',visible:false, title: __('Schoolclassesorder.pay_no'), operate: 'LIKE'}, + // {field: 'lib.title', title: __('Lib.title'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, + // {field: 'lib.headimage', title: __('Lib.headimage'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image}, + {field: 'manystore.nickname',visible:false, title: __('Manystore.nickname'), operate: 'LIKE'}, + {field: 'manystoreshop.name',visible:false, title: __('Manystoreshop.name'), operate: 'LIKE'}, + {field: 'manystoreshop.logo',visible:false, title: __('Manystoreshop.logo'), operate: 'LIKE'}, + + + + // {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate} ] ] }); @@ -141,11 +228,70 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin edit: function () { Controller.api.bindevent(); }, + admin_confirmation: function(){ + $("#admin_confirmation").on('click', function() { + $("#admin_confirmation-form").attr("action",'school/classes/order/service_order/admin_confirmation').submit(); + }); + Controller.api.bindevent(); + }, + user_confirmation: function(){ + $("#user_confirmation").on('click', function() { + $("#user_confirmation-form").attr("action",'school/classes/order/service_order/user_confirmation').submit(); + }); + Controller.api.bindevent(); + }, + shop_confirmation: function(){ + $("#shop_confirmation").on('click', function() { + $("#shop_confirmation-form").attr("action",'school/classes/order/service_order/shop_confirmation').submit(); + }); + Controller.api.bindevent(); + }, + api: { bindevent: function () { + generrate.listen(); Form.api.bindevent($("form[role=form]")); } } }; + + + var order_log_url = function (row,dom) { + return 'school/classes/order/service_order_log/index?classes_service_order_id='+row.id; + } + + var order_detail_url = function (row,dom) { + return 'school/classes/order/order_detail/index?id='+row.classes_order_detail_id; + } + + + var generrate = { + listen:function () { + this.offlineListen(); + // this.priceListen(); + }, + offlineListen:function () { + var that = this; + // console.log($("input:radio[name='row[address_type]']").val()) + // this.setOfflineType($("input:radio[name='row[address_type]']").val()); + $("input:radio[name='row[status]']").change(function (){ + that.setOfflineType($(this).val()); + }); + }, + setOfflineType:function (val) { + switch (val) { + case 'yes': + $('#status_no').hide(); + $('#status_yes').show(); + break; + case 'no': + $('#status_yes').hide(); + $('#status_no').show(); + break; + } + } + } + + return Controller; }); \ No newline at end of file diff --git a/public/assets/js/manystore/school/classes/order/service_order_log.js b/public/assets/js/manystore/school/classes/order/service_order_log.js index 1420b5e..e686f32 100644 --- a/public/assets/js/manystore/school/classes/order/service_order_log.js +++ b/public/assets/js/manystore/school/classes/order/service_order_log.js @@ -26,13 +26,13 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin [ {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: 'classes_service_order_id',visible:false, title: __('Classes_service_order_id')}, + {field: 'classes_order_id',visible:false, title: __('Classes_order_id')}, + {field: 'user_id',visible:false, title: __('User_id')}, + {field: 'classes_order_detail_id',visible:false, title: __('Classes_order_detail_id')}, + {field: 'classes_lib_id',visible:false, title: __('Classes_lib_id')}, + {field: 'manystore_id',visible:false, title: __('Manystore_id')}, + {field: 'shop_id',visible:false, 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'),"10":__('Service_stauts 10'),"-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}, @@ -41,16 +41,16 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin {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} + {field: 'schoolclassesserviceorder.order_no',visible:false, title: __('Schoolclassesserviceorder.order_no'), operate: 'LIKE'}, + {field: 'schoolclassesorder.order_no',visible:false, title: __('Schoolclassesorder.order_no'), operate: 'LIKE'}, + {field: 'schoolclassesorder.pay_no',visible:false, title: __('Schoolclassesorder.pay_no'), operate: 'LIKE'}, + {field: 'user.nickname',visible:false, title: __('User.nickname'), operate: 'LIKE'}, + {field: 'user.realname',visible:false, title: __('User.realname'), operate: 'LIKE'}, + {field: 'user.mobile',visible:false, title: __('User.mobile'), operate: 'LIKE'}, + {field: 'user.avatar',visible:false, 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} ] ] }); diff --git a/public/assets/js/manystore/school/classes/type.js b/public/assets/js/manystore/school/classes/type.js new file mode 100644 index 0000000..b8b647d --- /dev/null +++ b/public/assets/js/manystore/school/classes/type.js @@ -0,0 +1,115 @@ +define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) { + + var Controller = { + index: function () { + // 初始化表格参数配置 + Table.api.init({ + extend: { + index_url: 'school/classes/type/index' + location.search, + add_url: 'school/classes/type/add', + edit_url: 'school/classes/type/edit', + del_url: 'school/classes/type/del', + multi_url: 'school/classes/type/multi', + import_url: 'school/classes/type/import', + table: 'school_classes_type', + } + }); + + var table = $("#table"); + + // 初始化表格 + table.bootstrapTable({ + url: $.fn.bootstrapTable.defaults.extend.index_url, + pk: 'id', + sortName: 'weigh', + columns: [ + [ + {checkbox: true}, + {field: 'id', title: __('Id')}, + {field: 'name', title: __('Name'), operate: 'LIKE'}, + {field: 'status', title: __('Status'), searchList: {"1":__('Status 1'),"2":__('Status 2')}, formatter: Table.api.formatter.status}, + {field: 'weigh', title: __('Weigh'), operate: false}, + {field: 'createtime', title: __('Createtime')}, + {field: 'updatetime', title: __('Updatetime')}, + {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/type/recyclebin' + location.search, + pk: 'id', + sortName: 'id', + columns: [ + [ + {checkbox: true}, + {field: 'id', title: __('Id')}, + {field: 'name', title: __('Name'), align: 'left'}, + { + 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/type/restore', + refresh: true + }, + { + name: 'Destroy', + text: __('Destroy'), + classname: 'btn btn-xs btn-danger btn-ajax btn-destroyit', + icon: 'fa fa-times', + url: 'school/classes/type/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; +}); \ No newline at end of file