From 166f5716efcb3510218d4edebd134ee449e9eb9a Mon Sep 17 00:00:00 2001 From: qinzexin <“731344816@qq.com”> Date: Thu, 12 Jun 2025 18:41:45 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84=E4=B8=BB=E7=90=86=E4=BA=BA?= =?UTF-8?q?=E7=AE=80=E6=98=93=E5=90=8E=E5=8F=B0=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../school/activity/order/Order.php | 56 +- .../school/activity/order/order/index.html | 16 +- .../controller/school/newactivity/Order.php | 5 + .../common/model/school/activity/Activity.php | 8 +- .../model/school/activity/order/Order.php | 31 +- .../school/activity/order/Order.php | 227 +++--- .../school/activity/order/OrderCode.php | 36 +- .../school/activity/order/OrderDetail.php | 8 +- .../school/activity/order/OrderLog.php | 3 +- .../school/activity/order/SettleLog.php | 8 +- .../user/withdrawal/UserwithdrawalLog.php | 9 +- .../school/activity/order/order_detail.php | 2 + .../school/activity/order/settle_log.php | 12 +- .../model/school/activity/order/Order.php | 3 +- .../model/school/activity/order/OrderCode.php | 3 +- .../school/activity/order/OrderDetail.php | 3 +- .../model/school/activity/order/OrderLog.php | 3 +- .../model/school/activity/order/SettleLog.php | 15 +- .../user/withdrawal/UserwithdrawalLog.php | 3 +- .../manystore/view/general/profile/index.html | 6 +- .../order/order/admin_confirmation.html | 42 ++ .../activity/order/order/after_sales.html | 31 + .../school/activity/order/order/edit.html | 385 +++++----- .../school/activity/order/order/index.html | 53 +- .../order/order/shop_confirmation.html | 47 ++ .../activity/order/order_code/index.html | 26 +- .../activity/order/order_detail/index.html | 29 +- .../activity/order/settle_log/index.html | 26 +- .../withdrawal/userwithdrawal_log/index.html | 34 +- .../js/backend/school/activity/order/order.js | 26 + .../manystore/school/activity/order/order.js | 662 ++++++++++++++++-- .../school/activity/order/order_code.js | 64 +- .../school/activity/order/order_detail.js | 86 ++- .../school/activity/order/order_log.js | 6 +- .../school/activity/order/settle_log.js | 95 ++- .../user/withdrawal/userwithdrawal_log.js | 117 +++- 36 files changed, 1578 insertions(+), 608 deletions(-) create mode 100644 application/manystore/view/school/activity/order/order/admin_confirmation.html create mode 100644 application/manystore/view/school/activity/order/order/after_sales.html create mode 100644 application/manystore/view/school/activity/order/order/shop_confirmation.html diff --git a/application/admin/controller/school/activity/order/Order.php b/application/admin/controller/school/activity/order/Order.php index 3d6fc06..67fbb51 100644 --- a/application/admin/controller/school/activity/order/Order.php +++ b/application/admin/controller/school/activity/order/Order.php @@ -143,34 +143,6 @@ class Order extends Backend - /** - * 后台核销 - * @return string - * @throws \think\Exception - * @throws \think\db\exception\BindParamException - * @throws \think\exception\DbException - * @throws \think\exception\PDOException - */ - public function verification($ids = ''){ - $param = $this->request->param(); - if($this->request->isPost()){ - try{ - if(isset($param['ids']))$ids = $param['ids']; - //设置模拟资格 - $model = (new \app\common\model\school\classes\activity\order\Order); - $model->verification($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(); - } - @@ -318,6 +290,34 @@ class Order extends Backend } + /** + * 退剩余款项 + * @return string + * @throws \think\Exception + * @throws \think\db\exception\BindParamException + * @throws \think\exception\DbException + * @throws \think\exception\PDOException + */ + public function refund_all($ids = ''){ + $param = $this->request->param(); + if($this->request->isPost()){ + try{ + if(isset($param['ids']))$ids = $param['ids']; + $order = \app\common\model\school\activity\order\Order::getHaveOrder($ids); + + \app\common\model\school\activity\order\Order::orderRefund($order,$order['sub_refundprice'],'admin',$this->auth->id,true,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/view/school/activity/order/order/index.html b/application/admin/view/school/activity/order/order/index.html index dd6e997..ec11ca3 100644 --- a/application/admin/view/school/activity/order/order/index.html +++ b/application/admin/view/school/activity/order/order/index.html @@ -52,14 +52,14 @@ - + + + + + + + + {:__('Recycle bin')} diff --git a/application/api/controller/school/newactivity/Order.php b/application/api/controller/school/newactivity/Order.php index 88381f4..f14097f 100644 --- a/application/api/controller/school/newactivity/Order.php +++ b/application/api/controller/school/newactivity/Order.php @@ -319,4 +319,9 @@ class Order extends Base + + + + + } \ No newline at end of file diff --git a/application/common/model/school/activity/Activity.php b/application/common/model/school/activity/Activity.php index 1eea285..6c74006 100644 --- a/application/common/model/school/activity/Activity.php +++ b/application/common/model/school/activity/Activity.php @@ -371,14 +371,14 @@ class Activity extends BaseModel $end_time = $params["end_time"]; if(empty($start_time) || empty($end_time)){ - throw new \Exception("请选择开始和结束时间".$time); + throw new \Exception("请选择活动开始和结束时间".$time); } //转化时间戳 $start_time = $params["start_time"] && !is_numeric($params["start_time"]) ? strtotime($params["start_time"]) : $params["start_time"]; $end_time = $params["end_time"] && !is_numeric($params["end_time"]) ? strtotime($params["end_time"]) : $params["end_time"]; //结束时间不能小于开始时间 if($end_time<=$start_time){ - throw new \Exception("结束时间不能小于开始时间"); + throw new \Exception("活动结束时间不能小于开始时间"); } @@ -416,7 +416,7 @@ class Activity extends BaseModel ($start_time<=$sign_end_time && $sign_end_time<=$end_time) || ($sign_start_time<=$start_time && $end_time<=$sign_end_time) || ($sign_start_time>=$start_time && $sign_end_time<=$end_time)){ - throw new \Exception("报名时间段和开始时间段有交叉请修改"); + throw new \Exception("报名时间段和活动开始时间段有交叉请修改"); } //报名时间必须早于开始时间 @@ -441,7 +441,7 @@ class Activity extends BaseModel }else{ - if(!$row && empty($params["time"])) throw new \Exception("请选择开始和结束时间"); + if(!$row && empty($params["time"])) throw new \Exception("请选择活动开始和结束时间"); if(!$row && empty($params["sign_time"])) throw new \Exception("请选择报名开始和结束时间"); if($row){ if(empty($params["time"])){ diff --git a/application/common/model/school/activity/order/Order.php b/application/common/model/school/activity/order/Order.php index f670d91..dea8b06 100644 --- a/application/common/model/school/activity/order/Order.php +++ b/application/common/model/school/activity/order/Order.php @@ -608,7 +608,7 @@ class Order extends BaseModel if($order_info) throw new \Exception("订单已生成,如需重新下单请退出页面重新进入!"); //下单必须传规格id $num = (int)$num; - if(!$num) throw new \Exception("请选择报名人数!"); + if(!$num) throw new \Exception("请勾选正确的报名人信息!"); $activity_max_people = config("site.activity_max_people"); if($activity_max_people){ if($num > $activity_max_people || $num < 1) throw new \Exception("单次报名人数不能超过{$activity_max_people}人!"); @@ -638,7 +638,7 @@ class Order extends BaseModel $people_num = count($param["people"]?? []) ; //人数与参与数量需对上 if($people_num != $num){ - throw new \Exception("请选择正确的报名人数!"); + throw new \Exception("报名人信息需要跟报名人数一致!"); } } @@ -1801,6 +1801,22 @@ class Order extends BaseModel } + /**得到可直接退款订单(正常取消退全款非售后) + * @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 getHaveOrder($refund_sn){ +// $where = [self::STATUS_NOPAY,self::STATUS_PAYED]; + $order = self::where('refund_no|order_no|id',$refund_sn)->where("sub_refundprice",">",0)->find(); + if(!$order)throw new \Exception("不是可直接退款的订单!"); + + return $order; + } + + @@ -1819,16 +1835,16 @@ class Order extends BaseModel $res = true; try{ //生成退款单号 - if(!$order['refund_no']){ +// if(!$order['refund_no']){ $order['refund_no'] = get_order_sn(); // $order->save(); - } +// } if(!$refund_money)$refund_money = $order["total_refundprice"] ?: $order['sub_refundprice']; if($refund_money<=0)$refund_money = 0; if(!$refund_money)throw new \Exception("退款金额异常!"); //保存应退款额 - $order->total_refundprice = $refund_money; + if(!$order->total_refundprice)$order->total_refundprice = $refund_money; $order->save(); @@ -1836,6 +1852,7 @@ class Order extends BaseModel switch ($order['pay_type']) { case "wechat": //微信退款 +// var_dump($refund_money); self::wechatRefund($order,$refund_money,$oper_type,$oper_id); break; // case "alipay": //支付宝退款 @@ -1941,7 +1958,7 @@ class Order extends BaseModel * @throws \think\exception\DbException */ public static function updateRefundOrder($order,$price=0,$pay_json=[]){ - if(is_string($order))$order = self::getHaveRefundOrder($order); + if(is_string($order))$order = self::getHaveOrder($order); // //如果$price为0,尝试从$pay_json退款回调中获取退款金额 // if(!$price && $pay_json){ // if(isset($pay_json['refund_fee']))$price = bcdiv($pay_json['refund_fee'],100,2); @@ -1991,7 +2008,7 @@ class Order extends BaseModel */ public static function refundSuccess($refund_sn,$refund_json=[],$price=0,$trans=false){ //得到机构售后提交确认订单 - $order = self::getHaveRefundOrder($refund_sn); + $order = self::getHaveOrder($refund_sn); //判断逻辑 if($trans){ diff --git a/application/manystore/controller/school/activity/order/Order.php b/application/manystore/controller/school/activity/order/Order.php index 46bf594..39080ad 100644 --- a/application/manystore/controller/school/activity/order/Order.php +++ b/application/manystore/controller/school/activity/order/Order.php @@ -63,16 +63,18 @@ class Order extends ManystoreBase } list($where, $sort, $order, $offset, $limit) = $this->buildparams(); + $as = $this->model->getWithAlisaName(); $list = $this->model ->with(['schoolactivity','schoolactivityorderdetail','user']) + ->where("schoolactivityorderdetail.user_id", SHOP_USER_ID) ->where($where) ->order($sort, $order) ->paginate($limit); foreach ($list as $row) { - $row->getRelation('schoolactivity')->visible(['title','images']); - $row->getRelation('schoolactivityorderdetail')->visible(['title','images']); + $row->getRelation('schoolactivity')->visible(['title','images','price']); + $row->getRelation('schoolactivityorderdetail')->visible(['title','price']); $row->getRelation('user')->visible(['nickname','mobile','avatar']); } @@ -86,96 +88,71 @@ class Order extends ManystoreBase - /** - * 订单未支付取消 - * @return string - * @throws \think\Exception - * @throws \think\db\exception\BindParamException - * @throws \think\exception\DbException - * @throws \think\exception\PDOException - */ - public function freecancel($ids = ''){ - $param = $this->request->param(); - if($this->request->isPost()){ - try{ - if(isset($param['ids']))$ids = $param['ids']; - //设置模拟资格 - $model = (new \app\common\model\school\activity\order\Order); - $model->freecancel($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(); - } + +// +// /** +// * 订单未支付取消 +// * @return string +// * @throws \think\Exception +// * @throws \think\db\exception\BindParamException +// * @throws \think\exception\DbException +// * @throws \think\exception\PDOException +// */ +// public function freecancel($ids = ''){ +// $param = $this->request->param(); +// if($this->request->isPost()){ +// try{ +// if(isset($param['ids']))$ids = $param['ids']; +// //设置模拟资格 +// $model = (new \app\common\model\school\activity\order\Order); +// $model->freecancel($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(); +// } +// +// +// +// /** +// * 订单已支付取消 +// * @return string +// * @throws \think\Exception +// * @throws \think\db\exception\BindParamException +// * @throws \think\exception\DbException +// * @throws \think\exception\PDOException +// */ +// public function paidcancel($ids = ''){ +// $param = $this->request->param(); +// if($this->request->isPost()){ +// try{ +// if(isset($param['ids']))$ids = $param['ids']; +// //设置模拟资格 +// $model = (new \app\common\model\school\activity\order\Order); +// $model->paidcancel($ids,0,true,'admin',$this->auth->id,false,true); +// +// }catch (\Exception $e){ +// $this->error($e->getMessage()); +// } +// $this->success('取消成功!'); +// } +// $row = $this->model->get($ids); +// $this->view->assign('vo', $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 paidcancel($ids = ''){ - $param = $this->request->param(); - if($this->request->isPost()){ - try{ - if(isset($param['ids']))$ids = $param['ids']; - //设置模拟资格 - $model = (new \app\common\model\school\activity\order\Order); - $model->paidcancel($ids,0,true,'admin',$this->auth->id,false,true); - }catch (\Exception $e){ - $this->error($e->getMessage()); - } - $this->success('取消成功!'); - } - $row = $this->model->get($ids); - $this->view->assign('vo', $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 verification($ids = ''){ - $param = $this->request->param(); - if($this->request->isPost()){ - try{ - if(isset($param['ids']))$ids = $param['ids']; - //设置模拟资格 - $model = (new \app\common\model\school\classes\activity\order\Order); - $model->verification($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(); - } @@ -212,6 +189,7 @@ class Order extends ManystoreBase + /**发布者售后确认 * @return string * @throws \think\Exception @@ -228,7 +206,7 @@ class Order extends ManystoreBase $price = $params["price"] ?? 0; $status = $params["status"]; $model = (new \app\common\model\school\activity\order\Order()); - $model->shopConfirmation($order_no,$status,$price,$reject_reason,0,true,'admin',$this->auth->id,true); + $model->shopConfirmation($order_no,$status,$price,$reject_reason,0,true,'user',SHOP_USER_ID,true); }catch (\Exception $e){ $this->error($e->getMessage()); } @@ -248,48 +226,45 @@ class Order extends ManystoreBase } +// +// /**系统确认 +// * @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"]; +// $status = $params["status"]; +// $price = $params["price"] ?? 0; +// $model = (new \app\common\model\school\activity\order\Order()); +// $model->adminConfirmation($order_no,$status,$price,0,true,'admin',$this->auth->id,true); +// }catch (\Exception $e){ +// $this->error($e->getMessage() . $e->getFile() . $e->getLine()); +// } +// +// $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"]; - $status = $params["status"]; - $price = $params["price"] ?? 0; - $model = (new \app\common\model\school\activity\order\Order()); - $model->adminConfirmation($order_no,$status,$price,0,true,'admin',$this->auth->id,true); - }catch (\Exception $e){ - $this->error($e->getMessage() . $e->getFile() . $e->getLine()); - } - - $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 @@ -305,7 +280,7 @@ class Order extends ManystoreBase $num = $params["num"] ?? 0; $model = (new \app\common\model\school\activity\order\Order()); - $order = $model->afterSales($classes_order,$num,$reason,0 ,false,'admin',$this->auth->id,true); + $order = $model->afterSales($classes_order,$num,$reason,0 ,true,'user',SHOP_USER_ID,true); }catch (\Exception $e){ $this->error($e->getMessage()); @@ -326,4 +301,6 @@ class Order extends ManystoreBase + + } diff --git a/application/manystore/controller/school/activity/order/OrderCode.php b/application/manystore/controller/school/activity/order/OrderCode.php index 8372ede..88dab64 100644 --- a/application/manystore/controller/school/activity/order/OrderCode.php +++ b/application/manystore/controller/school/activity/order/OrderCode.php @@ -52,9 +52,10 @@ class OrderCode extends ManystoreBase return $this->selectpage(); } list($where, $sort, $order, $offset, $limit) = $this->buildparams(); - + $as = $this->model->getWithAlisaName(); $list = $this->model ->with(['schoolactivityorder','user','schoolactivity']) + ->where("schoolactivity.user_id", SHOP_USER_ID) ->where($where) ->order($sort, $order) ->paginate($limit); @@ -73,4 +74,37 @@ class OrderCode extends ManystoreBase return $this->view->fetch(); } + + + + /** + * 后台核销 + * @return string + * @throws \think\Exception + * @throws \think\db\exception\BindParamException + * @throws \think\exception\DbException + * @throws \think\exception\PDOException + */ + public function verification($ids = ''){ + $param = $this->request->param(); + if($this->request->isPost()){ + try{ + if(isset($param['ids']))$ids = $param['ids']; + $orderCode = \app\common\model\school\activity\order\OrderCode::where("id","=",$ids)->find(); + if(!$orderCode) throw new \Exception("核销码不存在!"); + //设置模拟资格 + $model = (new \app\common\model\school\activity\order\OrderCode); + $model->verification($orderCode["code"],0,true,'user',SHOP_USER_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/controller/school/activity/order/OrderDetail.php b/application/manystore/controller/school/activity/order/OrderDetail.php index fc3b79f..a403214 100644 --- a/application/manystore/controller/school/activity/order/OrderDetail.php +++ b/application/manystore/controller/school/activity/order/OrderDetail.php @@ -29,6 +29,9 @@ class OrderDetail extends ManystoreBase $this->view->assign("feelList", $this->model->getFeelList()); $this->view->assign("refundStatusList", $this->model->getRefundStatusList()); $this->view->assign("platformList", $this->model->getPlatformList()); + + $this->view->assign("cateListJson", json_encode((new \app\admin\model\school\activity\Activity)->getCateList(), JSON_UNESCAPED_UNICODE)); + } public function import() @@ -58,17 +61,18 @@ class OrderDetail extends ManystoreBase return $this->selectpage(); } list($where, $sort, $order, $offset, $limit) = $this->buildparams(); - + $as = $this->model->getWithAlisaName(); $list = $this->model ->with(['user','schoolactivityorder','schoolactivity','schoolactivityrefund']) ->where($where) + ->where("schoolactivity.user_id", SHOP_USER_ID) ->order($sort, $order) ->paginate($limit); foreach ($list as $row) { $row->getRelation('user')->visible(['nickname','mobile','avatar']); - $row->getRelation('schoolactivityorder')->visible(['order_no','pay_no']); + $row->getRelation('schoolactivityorder')->visible(['order_no','pay_no',"totalprice","num"]); $row->getRelation('schoolactivity')->visible(['title','images']); $row->getRelation('schoolactivityrefund')->visible(['title','desc']); } diff --git a/application/manystore/controller/school/activity/order/OrderLog.php b/application/manystore/controller/school/activity/order/OrderLog.php index 5d9997a..c4614ec 100644 --- a/application/manystore/controller/school/activity/order/OrderLog.php +++ b/application/manystore/controller/school/activity/order/OrderLog.php @@ -52,10 +52,11 @@ class OrderLog extends ManystoreBase return $this->selectpage(); } list($where, $sort, $order, $offset, $limit) = $this->buildparams(); - + $as = $this->model->getWithAlisaName(); $list = $this->model ->with(['schoolactivityorder']) ->where($where) +// ->where("schoolactivity.user_id", SHOP_USER_ID) ->order($sort, $order) ->paginate($limit); diff --git a/application/manystore/controller/school/activity/order/SettleLog.php b/application/manystore/controller/school/activity/order/SettleLog.php index 3c6c761..40439d3 100644 --- a/application/manystore/controller/school/activity/order/SettleLog.php +++ b/application/manystore/controller/school/activity/order/SettleLog.php @@ -52,10 +52,11 @@ class SettleLog extends ManystoreBase return $this->selectpage(); } list($where, $sort, $order, $offset, $limit) = $this->buildparams(); - + $as = $this->model->getWithAlisaName(); $list = $this->model - ->with(['schoolactivityorder','userwithdrawallog','user','schoolactivity','schoolactivityorderdetail']) + ->with(['schoolactivityorder','userwithdrawallog','touser','payuser','schoolactivity','schoolactivityorderdetail']) ->where($where) + ->where("schoolactivityorderdetail.user_id", SHOP_USER_ID) ->order($sort, $order) ->paginate($limit); @@ -63,7 +64,8 @@ class SettleLog extends ManystoreBase $row->getRelation('schoolactivityorder')->visible(['order_no','pay_no']); $row->getRelation('userwithdrawallog')->visible(['id']); - $row->getRelation('user')->visible(['nickname','mobile','avatar']); + $row->getRelation('touser')->visible(['nickname','mobile','avatar']); + $row->getRelation('payuser')->visible(['nickname','mobile','avatar']); $row->getRelation('schoolactivity')->visible(['title','images']); $row->getRelation('schoolactivityorderdetail')->visible(['title','images']); } diff --git a/application/manystore/controller/user/withdrawal/UserwithdrawalLog.php b/application/manystore/controller/user/withdrawal/UserwithdrawalLog.php index 1371425..393e018 100644 --- a/application/manystore/controller/user/withdrawal/UserwithdrawalLog.php +++ b/application/manystore/controller/user/withdrawal/UserwithdrawalLog.php @@ -46,6 +46,10 @@ class UserwithdrawalLog extends ManystoreBase { //当前是否为关联查询 $this->relationSearch = true; + + $this->searchFields = ["id","name","bank_name","bank_user_name","id_number","user.nickname","user.realname","user.mobile"]; + + //设置过滤方法 $this->request->filter(['strip_tags', 'trim']); if ($this->request->isAjax()) { @@ -54,16 +58,17 @@ class UserwithdrawalLog extends ManystoreBase return $this->selectpage(); } list($where, $sort, $order, $offset, $limit) = $this->buildparams(); - + $as = $this->model->getWithAlisaName(); $list = $this->model ->with(['user']) + ->where("{$as}.user_id", SHOP_USER_ID) ->where($where) ->order($sort, $order) ->paginate($limit); foreach ($list as $row) { - $row->getRelation('user')->visible(['nickname','mobile','avatar']); + $row->getRelation('user')->visible(['nickname','realname','mobile','avatar']); } $result = array("total" => $list->total(), "rows" => $list->items()); diff --git a/application/manystore/lang/zh-cn/school/activity/order/order_detail.php b/application/manystore/lang/zh-cn/school/activity/order/order_detail.php index 282743f..69f95d5 100644 --- a/application/manystore/lang/zh-cn/school/activity/order/order_detail.php +++ b/application/manystore/lang/zh-cn/school/activity/order/order_detail.php @@ -67,6 +67,8 @@ return [ 'User.avatar' => '头像', 'Schoolactivityorder.order_no' => '订单号', 'Schoolactivityorder.pay_no' => '微信支付单号', + 'Schoolactivityorder.totalprice'=> '订单金额', + 'Schoolactivityorder.num' => '购买人数', 'Schoolactivity.title' => '标题', 'Schoolactivity.images' => '轮播图', 'Schoolactivityrefund.title' => '策略标题', diff --git a/application/manystore/lang/zh-cn/school/activity/order/settle_log.php b/application/manystore/lang/zh-cn/school/activity/order/settle_log.php index 27078a8..4fdfc8d 100644 --- a/application/manystore/lang/zh-cn/school/activity/order/settle_log.php +++ b/application/manystore/lang/zh-cn/school/activity/order/settle_log.php @@ -30,5 +30,15 @@ return [ 'Schoolactivity.title' => '标题', 'Schoolactivity.images' => '轮播图', 'Schoolactivityorderdetail.title' => '标题', - 'Schoolactivityorderdetail.images' => '轮播图' + 'Schoolactivityorderdetail.images' => '轮播图', + 'Payuser.nickname' => '支付用户昵称', + 'Payuser.realname' => '支付用户真实姓名', + 'Payuser.mobile' => '支付用户手机号', + 'Payuser.avatar' => '支付用户头像', + + + 'Touser.nickname' => '结算用户昵称', + 'Touser.realname' => '结算用户真实姓名', + 'Touser.mobile' => '结算用户手机号', + 'Touser.avatar' => '结算用户头像' ]; diff --git a/application/manystore/model/school/activity/order/Order.php b/application/manystore/model/school/activity/order/Order.php index 080f629..ae58a2c 100644 --- a/application/manystore/model/school/activity/order/Order.php +++ b/application/manystore/model/school/activity/order/Order.php @@ -2,11 +2,12 @@ namespace app\manystore\model\school\activity\order; +use app\common\model\BaseModel; use app\manystore\model\school\activity\Activity; use think\Model; use traits\model\SoftDelete; -class Order extends Model +class Order extends BaseModel { use SoftDelete; diff --git a/application/manystore/model/school/activity/order/OrderCode.php b/application/manystore/model/school/activity/order/OrderCode.php index 920035b..5e4a961 100644 --- a/application/manystore/model/school/activity/order/OrderCode.php +++ b/application/manystore/model/school/activity/order/OrderCode.php @@ -2,11 +2,12 @@ namespace app\manystore\model\school\activity\order; +use app\common\model\BaseModel; use app\manystore\model\school\activity\Activity; use think\Model; use traits\model\SoftDelete; -class OrderCode extends Model +class OrderCode extends BaseModel { use SoftDelete; diff --git a/application/manystore/model/school/activity/order/OrderDetail.php b/application/manystore/model/school/activity/order/OrderDetail.php index 9110671..c88114d 100644 --- a/application/manystore/model/school/activity/order/OrderDetail.php +++ b/application/manystore/model/school/activity/order/OrderDetail.php @@ -2,12 +2,13 @@ namespace app\manystore\model\school\activity\order; +use app\common\model\BaseModel; use app\manystore\model\school\activity\Activity; use app\manystore\model\school\activity\Refund; use think\Model; use traits\model\SoftDelete; -class OrderDetail extends Model +class OrderDetail extends BaseModel { use SoftDelete; diff --git a/application/manystore/model/school/activity/order/OrderLog.php b/application/manystore/model/school/activity/order/OrderLog.php index 0206a60..0a5cbbb 100644 --- a/application/manystore/model/school/activity/order/OrderLog.php +++ b/application/manystore/model/school/activity/order/OrderLog.php @@ -2,10 +2,11 @@ namespace app\manystore\model\school\activity\order; +use app\common\model\BaseModel; use think\Model; use traits\model\SoftDelete; -class OrderLog extends Model +class OrderLog extends BaseModel { use SoftDelete; diff --git a/application/manystore/model/school/activity/order/SettleLog.php b/application/manystore/model/school/activity/order/SettleLog.php index de0978b..c34e79d 100644 --- a/application/manystore/model/school/activity/order/SettleLog.php +++ b/application/manystore/model/school/activity/order/SettleLog.php @@ -2,12 +2,13 @@ namespace app\manystore\model\school\activity\order; +use app\common\model\BaseModel; use app\manystore\model\school\activity\Activity; use app\manystore\model\user\withdrawal\UserwithdrawalLog; use think\Model; use traits\model\SoftDelete; -class SettleLog extends Model +class SettleLog extends BaseModel { use SoftDelete; @@ -103,6 +104,18 @@ class SettleLog extends Model } + public function touser() + { + return $this->belongsTo('app\common\model\User', 'to_user_id', 'id', [], 'LEFT')->setEagerlyType(0); + } + + + public function payuser() + { + return $this->belongsTo('app\common\model\User', 'pay_user_id', 'id', [], 'LEFT')->setEagerlyType(0); + } + + public function schoolactivity() { return $this->belongsTo(Activity::class, 'activity_id', 'id', [], 'LEFT')->setEagerlyType(0); diff --git a/application/manystore/model/user/withdrawal/UserwithdrawalLog.php b/application/manystore/model/user/withdrawal/UserwithdrawalLog.php index 61b8377..ef370c4 100644 --- a/application/manystore/model/user/withdrawal/UserwithdrawalLog.php +++ b/application/manystore/model/user/withdrawal/UserwithdrawalLog.php @@ -2,10 +2,11 @@ namespace app\manystore\model\user\withdrawal; +use app\common\model\BaseModel; use think\Model; -class UserwithdrawalLog extends Model +class UserwithdrawalLog extends BaseModel { diff --git a/application/manystore/view/general/profile/index.html b/application/manystore/view/general/profile/index.html index fa683a9..3ae7638 100644 --- a/application/manystore/view/general/profile/index.html +++ b/application/manystore/view/general/profile/index.html @@ -109,11 +109,11 @@ - + -

微信小程序端展示效果

+ -

打开微信扫一扫,扫码即可在手机端查看




+ {$check_full_msg} diff --git a/application/manystore/view/school/activity/order/order/admin_confirmation.html b/application/manystore/view/school/activity/order/order/admin_confirmation.html new file mode 100644 index 0000000..e7deba6 --- /dev/null +++ b/application/manystore/view/school/activity/order/order/admin_confirmation.html @@ -0,0 +1,42 @@ +
+ +
+

平台处理挂起单(如果拒绝退款,则视为订单完成将正常结算给商家,如果同意退款,提交后需等待微信退款回调,回调成功才会更新订单状态!)

+ +
+ +
+ +
+ {foreach name="statusList" item="vo"} + + {/foreach} +
+ +
+
+
+ +
+
+ +
+ + ( 如果未全退,剩余未退金额将正常结算给商家 ) +
+
+
+ + + + + + +
\ No newline at end of file diff --git a/application/manystore/view/school/activity/order/order/after_sales.html b/application/manystore/view/school/activity/order/order/after_sales.html new file mode 100644 index 0000000..a76854c --- /dev/null +++ b/application/manystore/view/school/activity/order/order/after_sales.html @@ -0,0 +1,31 @@ +
+ +
+

帮用户售后需填写原因!

+ +
+ +
+ +
+
+
+ +
+
+ +
+ + ( 当前订单数量为 {$row.num|htmlentities} 当前单人单价为 {$row.schoolactivityorderdetail.price|htmlentities} ) +
+
+
+ + + +
\ No newline at end of file diff --git a/application/manystore/view/school/activity/order/order/edit.html b/application/manystore/view/school/activity/order/order/edit.html index 6ae396c..92bd7ef 100644 --- a/application/manystore/view/school/activity/order/order/edit.html +++ b/application/manystore/view/school/activity/order/order/edit.html @@ -1,60 +1,70 @@
+ {if condition="$row.refund_error"} +
+ +
+ + {$row.refund_error} +
+
+ {/if} +
- +
- +
- -
-
-
- -
- +
+ + + + + +
- +
- +
- +
- +
- - {foreach name="payTypeList" item="vo"} - + {/foreach} @@ -63,244 +73,201 @@
- +
- {foreach name="statusList" item="vo"} - - {/foreach} + {foreach name="statusList" item="vo"} + + {/foreach}
-
- -
- -
- {foreach name="beforeStatusList" item="vo"} - - {/foreach} -
-
-
-
- -
- -
- {foreach name="serverStatusList" item="vo"} - - {/foreach} -
- -
-
-
- -
- -
- {foreach name="suspendStatusList" item="vo"} - - {/foreach} -
- -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
- +
- +
- +
-
- -
- -
-
- {:__('Key')} - {:__('Value')} -
-
{:__('Append')}
- -
+ + + + + + + + + -
-
+ +
- +
- -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- +
- {foreach name="authStatusList" item="vo"} - - {/foreach} + {foreach name="serverStatusList" item="vo"} + + {/foreach}
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
- {:__('Key')} - {:__('Value')} -
-
{:__('Append')}
- -
+ +
+ +
+
- +
- +
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+ + + + + + + + + + + + + + + + + +
+ +
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
- +
+ + +
- +
- -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
- + + + + + + + + + diff --git a/application/manystore/view/school/activity/order/order/index.html b/application/manystore/view/school/activity/order/order/index.html index e323b81..2bc8156 100644 --- a/application/manystore/view/school/activity/order/order/index.html +++ b/application/manystore/view/school/activity/order/order/index.html @@ -2,6 +2,37 @@
{:build_heading(null,FALSE)} + + + + + + + + + + + + + + + +
+ diff --git a/application/manystore/view/school/activity/order/settle_log/index.html b/application/manystore/view/school/activity/order/settle_log/index.html index cc99f63..1e498b4 100644 --- a/application/manystore/view/school/activity/order/settle_log/index.html +++ b/application/manystore/view/school/activity/order/settle_log/index.html @@ -17,23 +17,23 @@ diff --git a/application/manystore/view/user/withdrawal/userwithdrawal_log/index.html b/application/manystore/view/user/withdrawal/userwithdrawal_log/index.html index 60c0992..c493882 100644 --- a/application/manystore/view/user/withdrawal/userwithdrawal_log/index.html +++ b/application/manystore/view/user/withdrawal/userwithdrawal_log/index.html @@ -8,6 +8,16 @@
  • {$vo}
  • {/foreach} + + + + +
    @@ -17,23 +27,23 @@ diff --git a/public/assets/js/backend/school/activity/order/order.js b/public/assets/js/backend/school/activity/order/order.js index 3e89dc1..b495c4d 100644 --- a/public/assets/js/backend/school/activity/order/order.js +++ b/public/assets/js/backend/school/activity/order/order.js @@ -15,6 +15,7 @@ define(['jquery', 'bootstrap', 'backend', 'csmtable', 'form'], function ($, unde import_url: 'school/activity/order/order/import', verification_url: 'school/activity/order/order/verification', refund_url: 'school/activity/order/order/refund', + refund_all_url: 'school/activity/order/order/refund_all', shop_confirmation_url: 'school/activity/order/order/shop_confirmation', after_sales_url: 'school/activity/order/order/after_sales', admin_confirmation_url: 'school/activity/order/order/admin_confirmation', @@ -242,6 +243,31 @@ define(['jquery', 'bootstrap', 'backend', 'csmtable', 'form'], function ($, unde }, + + {name: 'refund_all', + text: '退剩余款项', + icon: 'fa fa-sign-in', + classname: 'btn btn-xs btn-danger btn-magic btn-ajax', + url: $.fn.bootstrapTable.defaults.extend.refund_all_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 == '6' && row.sub_refundprice > 0){ + return true; + } + return false; + } + }, + + { name: 'order_detail', text: __('下单锁定的活动信息'), diff --git a/public/assets/js/manystore/school/activity/order/order.js b/public/assets/js/manystore/school/activity/order/order.js index baca59c..408eb89 100644 --- a/public/assets/js/manystore/school/activity/order/order.js +++ b/public/assets/js/manystore/school/activity/order/order.js @@ -1,4 +1,4 @@ -define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) { +define(['jquery', 'bootstrap', 'backend', 'csmtable', 'form'], function ($, undefined, Backend, Table, Form) { var Controller = { index: function () { @@ -6,11 +6,19 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin Table.api.init({ extend: { index_url: 'school/activity/order/order/index' + location.search, + freecancel_url: 'school/activity/order/order/freecancel',//免费和待支付取消订单 + paidcancel_url: 'school/activity/order/order/paidcancel',//付费取消订单 add_url: 'school/activity/order/order/add', edit_url: 'school/activity/order/order/edit', del_url: 'school/activity/order/order/del', multi_url: 'school/activity/order/order/multi', import_url: 'school/activity/order/order/import', + verification_url: 'school/activity/order/order/verification', + refund_url: 'school/activity/order/order/refund', + shop_confirmation_url: 'school/activity/order/order/shop_confirmation', + after_sales_url: 'school/activity/order/order/after_sales', + admin_confirmation_url: 'school/activity/order/order/admin_confirmation', + table: 'school_activity_order', } }); @@ -22,64 +30,432 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin url: $.fn.bootstrapTable.defaults.extend.index_url, pk: 'id', sortName: 'id', + fixedColumns: true, + fixedRightNumber: 1, + asyndownload: true, columns: [ [ + {checkbox: true}, {field: 'id', title: __('Id')}, - {field: 'order_no', title: __('Order_no'), operate: 'LIKE'}, - {field: 'pay_no', title: __('Pay_no'), operate: 'LIKE'}, - {field: 'user_id', title: __('User_id')}, - {field: 'activity_id', title: __('Activity_id')}, - {field: 'activity_order_detail_id', title: __('Activity_order_detail_id')}, + {field: 'order_no', title: __('Order_no'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, + {field: 'schoolactivity.title', title: __('Schoolactivity.title'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, + {field: 'schoolactivity.images', title: __('Schoolactivity.images'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.images}, + + {field: 'status', title: __('Status'), searchList: {"-3":__('Status -3'),"0":__('Status 0'),"2":__('Status 2'),"3":__('Status 3'),"4":__('Status 4'),"5":__('Status 5'),"6":__('Status 6'),"7":__('Status 7'),"9":__('Status 9')}, formatter: Table.api.formatter.status}, + + + {field: 'user.nickname', 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', title: __('User.avatar'), operate: 'LIKE', events: Table.api.events.image, formatter: Table.api.formatter.image}, + + + + {field: 'pay_no', title: __('Pay_no'),visible:false, operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, + {field: 'user_id',visible:false, title: __('User_id')}, + {field: 'activity_id',visible:false, title: __('Activity_id')}, + {field: 'activity_order_detail_id',visible:false, title: __('Activity_order_detail_id')}, {field: 'beforeprice', title: __('Beforeprice'), operate:'BETWEEN'}, {field: 'totalprice', title: __('Totalprice'), operate:'BETWEEN'}, + {field: 'num', title: __('购买人数'), operate:'BETWEEN'}, + {field: 'schoolactivityorderdetail.price', title: __('购买单价'), operate:'BETWEEN'}, + + + {field: 'desc', title: __('下单备注'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, + + {field: 'payprice', title: __('Payprice'), operate:'BETWEEN'}, {field: 'pay_type', title: __('Pay_type'), searchList: {"yue":__('Pay_type yue'),"wechat":__('Pay_type wechat')}, formatter: Table.api.formatter.normal}, - {field: 'status', title: __('Status'), searchList: {"-3":__('Status -3'),"0":__('Status 0'),"2":__('Status 2'),"3":__('Status 3'),"4":__('Status 4'),"5":__('Status 5'),"6":__('Status 6'),"7":__('Status 7'),"9":__('Status 9')}, formatter: Table.api.formatter.status}, - {field: 'before_status', title: __('Before_status'), searchList: {"-3":__('Before_status -3'),"0":__('Before_status 0'),"2":__('Before_status 2'),"3":__('Before_status 3'),"4":__('Before_status 4'),"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'),"2":__('Before_status 2'),"3":__('Before_status 3'),"4":__('Before_status 4'),"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: 'suspend_status', title: __('Suspend_status'), searchList: {"0":__('Suspend_status 0'),"1":__('Suspend_status 1'),"2":__('Suspend_status 2')}, formatter: Table.api.formatter.status}, - {field: 'canceltime', title: __('Canceltime')}, - {field: 'paytime', title: __('Paytime')}, - {field: 'auth_time', title: __('Auth_time')}, - {field: 'reservation_time', title: __('Reservation_time')}, - {field: 'finishtime', title: __('Finishtime')}, - {field: 'refundtime', title: __('Refundtime')}, - {field: 'first_refundprice', title: __('First_refundprice'), operate:'BETWEEN'}, - {field: 'total_refundprice', title: __('Total_refundprice'), operate:'BETWEEN'}, - {field: 'real_refundprice', title: __('Real_refundprice'), operate:'BETWEEN'}, + + {field: 'canceltime',visible:false, title: __('Canceltime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime}, + {field: 'paytime',visible:false, title: __('Paytime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime}, + {field: 'auth_time',visible:false, title: __('Auth_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime}, + {field: 'reservation_time',visible:false, title: __('Reservation_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime}, + {field: 'finishtime',visible:false, title: __('Finishtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime}, + {field: 'refundtime',visible:false, title: __('Refundtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime}, + {field: 'total_refundprice',visible:false, title: __('Total_refundprice'), operate:'BETWEEN'}, + {field: 'real_refundprice',visible:false, title: __('Real_refundprice'), operate:'BETWEEN'}, {field: 'sub_refundprice', title: __('Sub_refundprice'), operate:'BETWEEN'}, - {field: 'platform', title: __('Platform'), operate: 'LIKE'}, - {field: 'reason', title: __('Reason'), operate: 'LIKE'}, - {field: 'auth_reason', title: __('Auth_reason'), operate: 'LIKE'}, + {field: 'platform', title: __('Platform'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, + {field: 'reason',visible:false, title: __('Reason'), operate: 'LIKE'}, + {field: 'auth_reason',visible:false, title: __('售后申请原因'), operate: 'LIKE'}, {field: 'auth_status', title: __('Auth_status'), searchList: {"0":__('Auth_status 0'),"1":__('Auth_status 1'),"2":__('Auth_status 2')}, formatter: Table.api.formatter.status}, - {field: 'auth_user_id', title: __('Auth_user_id')}, - {field: 'auth_type', title: __('Auth_type'), operate: 'LIKE'}, - {field: 'refund_no', title: __('Refund_no'), operate: 'LIKE'}, - {field: 'refund_error', title: __('Refund_error'), operate: 'LIKE'}, - {field: 'refundsendtime', title: __('Refundsendtime')}, - {field: 'createtime', title: __('Createtime')}, - {field: 'updatetime', title: __('Updatetime')}, - {field: 'num', title: __('Num')}, - {field: 'fee_scale', title: __('Fee_scale'), operate:'BETWEEN'}, - {field: 'settle_log_time', title: __('Settle_log_time')}, - {field: 'fee_price', title: __('Fee_price'), operate:'BETWEEN'}, - {field: 'last_time', title: __('Last_time')}, - {field: 'desc', title: __('Desc'), operate: 'LIKE'}, - {field: 'schoolactivity.title', title: __('Schoolactivity.title'), operate: 'LIKE'}, - {field: 'schoolactivity.images', title: __('Schoolactivity.images'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.images}, - {field: 'schoolactivityorderdetail.title', title: __('Schoolactivityorderdetail.title'), operate: 'LIKE'}, - {field: 'schoolactivityorderdetail.images', title: __('Schoolactivityorderdetail.images'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.images}, - {field: 'user.nickname', title: __('User.nickname'), operate: 'LIKE'}, - {field: 'user.mobile', title: __('User.mobile'), operate: 'LIKE'}, - {field: 'user.avatar', title: __('User.avatar'), operate: 'LIKE', events: Table.api.events.image, formatter: Table.api.formatter.image}, - {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate} + {field: 'auth_user_id',visible:false, title: __('Auth_user_id')}, + {field: 'auth_type',visible:false, title: __('Auth_type'), operate: 'LIKE'}, + {field: 'refund_no',visible:false, title: __('Refund_no'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, + {field: 'refund_error', title: __('Refund_error'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, + {field: 'refundsendtime',visible:false, title: __('Refundsendtime'), 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: 'schoolactivityorderdetail.title' ,visible:false , title: __('Schoolactivityorderdetail.title'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, + // {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate} + + + {field: 'operate', title: __('Operate'), table: table , buttons: [ + + { + 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 == '2' || row.status == '3'|| row.status == '9') && row.schoolactivityorderdetail.feel == '0'; + } + }, + + + { + 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 == '4'; + } + }, + // { + // 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 == '7'; + // } + // }, + + + + {name: 'freecancel', + text: '取消订单', + icon: 'fa fa-user-times', + classname: 'btn btn-xs btn-warning btn-magic btn-ajax', + url: $.fn.bootstrapTable.defaults.extend.freecancel_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 == '0' && row.detail.feel == '0'){ + return true; + } + //免费订单未支付和进行中都可取消 + if((row.status == '0' || row.status == '2'|| row.status == '3' )&& row.schoolactivityorderdetail.feel == '1'){ + return true; + } + return false; + }}, + + + {name: 'paidcancel', + text: '取消订单', + icon: 'fa fa-user-times', + classname: 'btn btn-xs btn-warning btn-magic btn-ajax', + url: $.fn.bootstrapTable.defaults.extend.paidcancel_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.schoolactivityorderdetail.feel == '0'){ + return true; + } + + return false; + }}, + + + // {name: 'verification', + // text: '预约核销', + // icon: 'fa fa-sign-in', + // classname: 'btn btn-xs btn-warning btn-magic btn-ajax', + // url: $.fn.bootstrapTable.defaults.extend.verification_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 == '3'){ + // return true; + // } + // return false; + // }}, + + {name: 'refund', + text: '退款重试(若失败双击本行查看原因)', + icon: 'fa fa-sign-in', + classname: 'btn btn-xs btn-danger btn-magic btn-ajax', + url: $.fn.bootstrapTable.defaults.extend.refund_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 == '5'){ + return true; + } + return false; + } + }, + + + { + name: 'order_detail', + text: __('下单锁定的活动信息'), + title: __('下单锁定的活动信息'), + classname: 'btn btn-dialog', + icon: 'fa fa-calendar', + dropdown : '更多', + url: order_detail_url, + callback: function (data) { + + }, + // visible: function (row) { + // return row.paytime; + // } + }, + { + name: 'order_code', + text: __('核销管理'), + title: __('核销管理'), + icon: 'fa fa-calendar', + classname: 'btn btn-xs btn-warning btn-magic btn-dialog', + // dropdown : '更多', + url: order_code_url, + callback: function (data) { + + }, + visible: function (row) { + return row.paytime || ( row.status > '0'); + } + }, + + + { + name: 'order_log', + text: __('订单日志'), + title: __('订单日志'), + classname: 'btn btn-dialog', + icon: 'fa fa-list', + dropdown : '更多', + url: order_log_url, + callback: function (data) { + + }, + // visible: function (row) { + // return row.status == '2'||row.status == '3'; + // } + }, + + { + name: 'activity', + text: __('线上活动查看'), + title: __('线上活动查看'), + classname: 'btn btn-dialog', + icon: 'fa fa-leanpub', + dropdown : '更多', + url: activity_url, + callback: function (data) { + + }, + // visible: function (row) { + // return row.paytime; + // } + }, + + { + name: 'settle_log', + text: __('资金结算记录'), + title: __('资金结算记录'), + classname: 'btn btn-dialog', + icon: 'fa fa-calendar', + dropdown : '更多', + url: settle_log_url, + callback: function (data) { + + }, + visible: function (row) { + return row.sub_refundprice > 0; + } + }, + + + + ], events: Table.api.events.operate, formatter: Table.api.formatter.operate}, + + + ] ] }); // 为表格绑定事件 Table.api.bindevent(table); + + + + //自定义Tab筛选条件 + $('.panel-heading .nav-custom-condition a[data-toggle="tab"]', table.closest(".panel-intro")).on('shown.bs.tab', function (e) { + var value = $(this).data("value"); + var options = table.bootstrapTable('getOptions'); + var queryParams = options.queryParams; + options.pageNumber = 1; + options.queryParams = function (params) { + //这一行必须要存在,否则在点击下一页时会丢失搜索栏数据 + params = queryParams(params); + + //如果希望追加搜索条件,可使用 + var filter = params.filter ? JSON.parse(params.filter) : {}; + var op = params.op ? JSON.parse(params.op) : {}; + if (value!=="") { + //这里可以自定义多个筛选条件 + filter.server_status = value; + op.server_status = '='; + }else{ + //console.log("111111111111111111"); + //选全部时要移除相应的条件 + delete filter.server_status; + delete op.server_status; + } + + params.filter = JSON.stringify(filter); + params.op = JSON.stringify(op); + + //如果希望忽略搜索栏搜索条件,可使用 + //params.filter = JSON.stringify(value?{admin_id: value}:{}); + //params.op = JSON.stringify(value?{admin_id: '='}:{}); + return params; + }; + + table.trigger("uncheckbox"); + table.bootstrapTable('refresh', {pageNumber: 1}); + return false; + }); + + + //自定义Tab筛选条件 + $('.panel-heading .nav2-custom-condition a[data-toggle="tab"]', table.closest(".panel-intro")).on('shown.bs.tab', function (e) { + var value = $(this).data("value"); + var options = table.bootstrapTable('getOptions'); + var queryParams = options.queryParams; + options.pageNumber = 1; + options.queryParams = function (params) { + //这一行必须要存在,否则在点击下一页时会丢失搜索栏数据 + params = queryParams(params); + + //如果希望追加搜索条件,可使用 + var filter = params.filter ? JSON.parse(params.filter) : {}; + var op = params.op ? JSON.parse(params.op) : {}; + if (value!=="") { + //这里可以自定义多个筛选条件 + filter.auth_status = value; + op.auth_status = '='; + }else{ + //console.log("111111111111111111"); + //选全部时要移除相应的条件 + delete filter.auth_status; + delete op.auth_status; + } + + params.filter = JSON.stringify(filter); + params.op = JSON.stringify(op); + + //如果希望忽略搜索栏搜索条件,可使用 + //params.filter = JSON.stringify(value?{admin_id: value}:{}); + //params.op = JSON.stringify(value?{admin_id: '='}:{}); + return params; + }; + + table.trigger("uncheckbox"); + table.bootstrapTable('refresh', {pageNumber: 1}); + return false; + }); + + + + //自定义Tab筛选条件 + $('.panel-heading .nav3-custom-condition a[data-toggle="tab"]', table.closest(".panel-intro")).on('shown.bs.tab', function (e) { + var value = $(this).data("value"); + var options = table.bootstrapTable('getOptions'); + var queryParams = options.queryParams; + options.pageNumber = 1; + options.queryParams = function (params) { + //这一行必须要存在,否则在点击下一页时会丢失搜索栏数据 + params = queryParams(params); + + //如果希望追加搜索条件,可使用 + var filter = params.filter ? JSON.parse(params.filter) : {}; + var op = params.op ? JSON.parse(params.op) : {}; + if (value!=="") { + //这里可以自定义多个筛选条件 + filter.suspend_status = value; + op.suspend_status = '='; + }else{ + //console.log("111111111111111111"); + //选全部时要移除相应的条件 + delete filter.suspend_status; + delete op.suspend_status; + } + + params.filter = JSON.stringify(filter); + params.op = JSON.stringify(op); + + //如果希望忽略搜索栏搜索条件,可使用 + //params.filter = JSON.stringify(value?{admin_id: value}:{}); + //params.op = JSON.stringify(value?{admin_id: '='}:{}); + return params; + }; + + table.trigger("uncheckbox"); + table.bootstrapTable('refresh', {pageNumber: 1}); + return false; + }); + + }, recyclebin: function () { // 初始化表格参数配置 @@ -139,6 +515,129 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin // 为表格绑定事件 Table.api.bindevent(table); + + + + //自定义Tab筛选条件 + $('.panel-heading .nav-custom-condition a[data-toggle="tab"]', table.closest(".panel-intro")).on('shown.bs.tab', function (e) { + var value = $(this).data("value"); + var options = table.bootstrapTable('getOptions'); + var queryParams = options.queryParams; + options.pageNumber = 1; + options.queryParams = function (params) { + //这一行必须要存在,否则在点击下一页时会丢失搜索栏数据 + params = queryParams(params); + + //如果希望追加搜索条件,可使用 + var filter = params.filter ? JSON.parse(params.filter) : {}; + var op = params.op ? JSON.parse(params.op) : {}; + if (value!=="") { + //这里可以自定义多个筛选条件 + filter.server_status = value; + op.server_status = '='; + }else{ + //console.log("111111111111111111"); + //选全部时要移除相应的条件 + delete filter.server_status; + delete op.server_status; + } + + params.filter = JSON.stringify(filter); + params.op = JSON.stringify(op); + + //如果希望忽略搜索栏搜索条件,可使用 + //params.filter = JSON.stringify(value?{admin_id: value}:{}); + //params.op = JSON.stringify(value?{admin_id: '='}:{}); + return params; + }; + + table.trigger("uncheckbox"); + table.bootstrapTable('refresh', {pageNumber: 1}); + return false; + }); + + + //自定义Tab筛选条件 + $('.panel-heading .nav2-custom-condition a[data-toggle="tab"]', table.closest(".panel-intro")).on('shown.bs.tab', function (e) { + var value = $(this).data("value"); + var options = table.bootstrapTable('getOptions'); + var queryParams = options.queryParams; + options.pageNumber = 1; + options.queryParams = function (params) { + //这一行必须要存在,否则在点击下一页时会丢失搜索栏数据 + params = queryParams(params); + + //如果希望追加搜索条件,可使用 + var filter = params.filter ? JSON.parse(params.filter) : {}; + var op = params.op ? JSON.parse(params.op) : {}; + if (value!=="") { + //这里可以自定义多个筛选条件 + filter.auth_status = value; + op.auth_status = '='; + }else{ + //console.log("111111111111111111"); + //选全部时要移除相应的条件 + delete filter.auth_status; + delete op.auth_status; + } + + params.filter = JSON.stringify(filter); + params.op = JSON.stringify(op); + + //如果希望忽略搜索栏搜索条件,可使用 + //params.filter = JSON.stringify(value?{admin_id: value}:{}); + //params.op = JSON.stringify(value?{admin_id: '='}:{}); + return params; + }; + + table.trigger("uncheckbox"); + table.bootstrapTable('refresh', {pageNumber: 1}); + return false; + }); + + + + //自定义Tab筛选条件 + $('.panel-heading .nav3-custom-condition a[data-toggle="tab"]', table.closest(".panel-intro")).on('shown.bs.tab', function (e) { + var value = $(this).data("value"); + var options = table.bootstrapTable('getOptions'); + var queryParams = options.queryParams; + options.pageNumber = 1; + options.queryParams = function (params) { + //这一行必须要存在,否则在点击下一页时会丢失搜索栏数据 + params = queryParams(params); + + //如果希望追加搜索条件,可使用 + var filter = params.filter ? JSON.parse(params.filter) : {}; + var op = params.op ? JSON.parse(params.op) : {}; + if (value!=="") { + //这里可以自定义多个筛选条件 + filter.suspend_status = value; + op.suspend_status = '='; + }else{ + //console.log("111111111111111111"); + //选全部时要移除相应的条件 + delete filter.suspend_status; + delete op.suspend_status; + } + + params.filter = JSON.stringify(filter); + params.op = JSON.stringify(op); + + //如果希望忽略搜索栏搜索条件,可使用 + //params.filter = JSON.stringify(value?{admin_id: value}:{}); + //params.op = JSON.stringify(value?{admin_id: '='}:{}); + return params; + }; + + table.trigger("uncheckbox"); + table.bootstrapTable('refresh', {pageNumber: 1}); + return false; + }); + + + + }, add: function () { Controller.api.bindevent(); @@ -146,11 +645,92 @@ 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/activity/order/order/admin_confirmation').submit(); + }); + shop_confirmation.listen(); + Controller.api.bindevent(); + }, + shop_confirmation: function(){ + $("#shop_confirmation").on('click', function() { + $("#shop_confirmation-form").attr("action",'school/activity/order/order/shop_confirmation').submit(); + }); + shop_confirmation.listen(); + Controller.api.bindevent(); + }, + + after_sales: function(){ + $("#after_sales").on('click', function() { + $("#after_sales-form").attr("action",'school/activity/order/order/after_sales').submit(); + }); + Controller.api.bindevent(); + }, + api: { bindevent: function () { Form.api.bindevent($("form[role=form]")); } } }; + + + + + + + var activity_url = function (row,dom) { + return 'school/activity/activity/index?id='+row.activity_id; + } + + var order_log_url = function (row,dom) { + return 'school/activity/order/order_log/index?activity_order_id='+row.id; + } + + var order_detail_url = function (row,dom) { + return 'school/activity/order/order_detail/index?activity_order_id='+row.id; + } + var order_code_url = function (row,dom) { + return 'school/activity/order/order_code/index?activity_order_id='+row.id; + } + + var settle_log_url = function (row,dom) { + return 'school/activity/order/settle_log/index?activity_order_id='+row.id; + } + + + + + + var shop_confirmation = { + listen:function () { + this.offlineListen(); + }, + 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_yes').show(); + $('#status_no').hide(); + 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/activity/order/order_code.js b/public/assets/js/manystore/school/activity/order/order_code.js index 539e277..dce711f 100644 --- a/public/assets/js/manystore/school/activity/order/order_code.js +++ b/public/assets/js/manystore/school/activity/order/order_code.js @@ -10,6 +10,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin edit_url: 'school/activity/order/order_code/edit', del_url: 'school/activity/order/order_code/del', multi_url: 'school/activity/order/order_code/multi', + verification_url: 'school/activity/order/order_code/verification', import_url: 'school/activity/order/order_code/import', table: 'school_activity_order_code', } @@ -22,32 +23,63 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin url: $.fn.bootstrapTable.defaults.extend.index_url, pk: 'id', sortName: 'id', + fixedColumns: true, + fixedRightNumber: 1, columns: [ [ {checkbox: true}, {field: 'id', title: __('Id')}, {field: 'activity_order_id', title: __('Activity_order_id')}, - {field: 'code', title: __('Code'), operate: 'LIKE'}, + + {field: 'name', title: __('姓名'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, + + {field: 'idnum', title: __('身份证号'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, + + + + {field: 'code', title: __('Code'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, + + {field: 'miniurl', title: __('核销码内容'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, + {field: 'codeimage', title: __('Codeimage'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image}, + {field: 'codeoneimage', title: __('Codeoneimage'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image}, {field: 'status', title: __('Status'), searchList: {"3":__('Status 3'),"6":__('Status 6')}, formatter: Table.api.formatter.status}, - {field: 'verificationtime', title: __('Verificationtime')}, + {field: 'verificationtime', title: __('Verificationtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime}, {field: 'verification_user_id', title: __('Verification_user_id')}, {field: 'verification_type', title: __('Verification_type'), operate: 'LIKE'}, - {field: 'createtime', title: __('Createtime')}, - {field: 'updatetime', title: __('Updatetime')}, - {field: 'activity_id', title: __('Activity_id')}, - {field: 'miniurl', title: __('Miniurl'), operate: 'LIKE', formatter: Table.api.formatter.url}, - {field: 'name', title: __('Name'), operate: 'LIKE'}, - {field: 'idnum', title: __('Idnum'), operate: 'LIKE'}, - {field: 'schoolactivityorder.order_no', title: __('Schoolactivityorder.order_no'), operate: 'LIKE'}, - {field: 'schoolactivityorder.pay_no', title: __('Schoolactivityorder.pay_no'), operate: 'LIKE'}, - {field: 'user.nickname', title: __('User.nickname'), operate: 'LIKE'}, - {field: 'user.mobile', title: __('User.mobile'), operate: 'LIKE'}, - {field: 'user.avatar', title: __('User.avatar'), operate: 'LIKE', events: Table.api.events.image, formatter: Table.api.formatter.image}, - {field: 'schoolactivity.title', title: __('Schoolactivity.title'), operate: 'LIKE'}, - {field: 'schoolactivity.images', title: __('Schoolactivity.images'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.images}, - {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate} + {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: 'schoolactivityorder.order_no',visible:false, title: __('Schoolactivityorder.order_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: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate} + + {field: 'operate', title: __('Operate'), table: table , buttons: [ + {name: 'verification', + text: '预约核销', + icon: 'fa fa-sign-in', + classname: 'btn btn-xs btn-warning btn-magic btn-ajax', + url: $.fn.bootstrapTable.defaults.extend.verification_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 == '3'){ + return true; + } + return false; + }}, + ], events: Table.api.events.operate, formatter: Table.api.formatter.operate}, ] ] }); diff --git a/public/assets/js/manystore/school/activity/order/order_detail.js b/public/assets/js/manystore/school/activity/order/order_detail.js index 17e39f0..3f26258 100644 --- a/public/assets/js/manystore/school/activity/order/order_detail.js +++ b/public/assets/js/manystore/school/activity/order/order_detail.js @@ -26,56 +26,54 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin [ {checkbox: true}, {field: 'id', title: __('Id')}, - {field: 'user_id', title: __('User_id')}, - {field: 'activity_order_id', title: __('Activity_order_id')}, - {field: 'activity_id', title: __('Activity_id')}, - {field: 'title', title: __('Title'), operate: 'LIKE'}, - {field: 'image', title: __('Image'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image}, + {field: 'user_id', visible:false,title: __('User_id')}, + {field: 'activity_order_id', visible:false,title: __('Activity_order_id')}, + {field: 'activity_id',visible:false, title: __('Activity_id')}, + {field: 'title', title: __('Title'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, {field: 'images', title: __('Images'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.images}, - {field: 'address_city', title: __('Address_city'), operate: 'LIKE'}, - {field: 'cate_ids', title: __('Cate_ids'), operate: 'LIKE'}, - {field: 'province', title: __('Province')}, - {field: 'city', title: __('City')}, - {field: 'district', title: __('District')}, + {field: 'price', title: __('Price'), operate:'BETWEEN'}, + {field: 'schoolactivityorder.totalprice', title: __('Schoolactivityorder.totalprice'), operate:'BETWEEN'}, + {field: 'schoolactivityorder.order_no',visible:false, title: __('Schoolactivityorder.order_no'), operate:'BETWEEN'}, + {field: 'schoolactivityorder.num', title: __('购买人数'), operate:'BETWEEN'}, + + {field: 'user.nickname', 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', title: __('User.avatar'), operate: 'LIKE', events: Table.api.events.image, formatter: Table.api.formatter.image}, + {field: 'schoolactivityorder.order_no',visible:false, title: __('Schoolactivityorder.order_no'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, + // {field: 'activity.title',visible:false, title: __('Activity.title'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, + + + {field: 'address_city',visible:false, title: __('Address_city'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, + {field: 'cate_ids', title: __('Cate_ids'), searchList: cateListJson, formatter: Table.api.formatter.flag}, + {field: 'province',visible:false, title: __('Province')}, + {field: 'city',visible:false, title: __('City')}, + {field: 'district',visible:false, title: __('District')}, {field: 'address', title: __('Address'), operate: 'LIKE'}, {field: 'address_detail', title: __('Address_detail'), operate: 'LIKE'}, - {field: 'longitude', title: __('Longitude'), operate: 'LIKE'}, - {field: 'latitude', title: __('Latitude'), operate: 'LIKE'}, - {field: 'start_time', title: __('Start_time')}, - {field: 'end_time', title: __('End_time')}, - {field: 'sign_start_time', title: __('Sign_start_time')}, - {field: 'sign_end_time', title: __('Sign_end_time')}, - {field: 'price', title: __('Price'), operate:'BETWEEN'}, + {field: 'longitude',visible:false, title: __('Longitude'), operate: 'LIKE'}, + {field: 'latitude',visible:false, title: __('Latitude'), operate: 'LIKE'}, + {field: 'start_time', title: __('Start_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime}, + {field: 'end_time', title: __('End_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime}, + {field: 'sign_start_time', title: __('Sign_start_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime}, + {field: 'sign_end_time', title: __('Sign_end_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime}, + {field: 'stock', title: __('Stock')}, {field: 'weigh', title: __('Weigh'), operate: false}, - {field: 'recommend', title: __('Recommend'), 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: 'new', title: __('New'), searchList: {"0":__('New 0'),"1":__('New 1')}, formatter: Table.api.formatter.normal}, - {field: 'sale', title: __('Sale')}, - {field: 'views', title: __('Views')}, - {field: 'add_type', title: __('Add_type'), searchList: {"1":__('Add_type 1'),"2":__('Add_type 2')}, formatter: Table.api.formatter.normal}, - {field: 'add_id', title: __('Add_id')}, + {field: 'recommend',visible:false, title: __('Recommend'), searchList: {"0":__('Recommend 0'),"1":__('Recommend 1')}, formatter: Table.api.formatter.normal}, + {field: 'hot',visible:false, title: __('Hot'), searchList: {"0":__('Hot 0'),"1":__('Hot 1')}, formatter: Table.api.formatter.normal}, + {field: 'new',visible:false, title: __('New'), searchList: {"0":__('New 0'),"1":__('New 1')}, formatter: Table.api.formatter.normal}, + {field: 'sale',visible:false, title: __('Sale')}, + {field: 'views',visible:false, title: __('Views')}, + {field: 'add_type',visible:false, title: __('Add_type'), searchList: {"1":__('Add_type 1'),"2":__('Add_type 2')}, formatter: Table.api.formatter.normal}, + {field: 'add_id',visible:false, title: __('Add_id')}, {field: 'feel', title: __('Feel'), searchList: {"0":__('Feel 0'),"1":__('Feel 1')}, formatter: Table.api.formatter.normal}, - {field: 'sign_num', title: __('Sign_num')}, - {field: 'verification_num', title: __('Verification_num')}, - {field: 'collect', title: __('Collect')}, - {field: 'createtime', title: __('Createtime')}, - {field: 'updatetime', title: __('Updatetime')}, - {field: 'refund_id', title: __('Refund_id')}, - {field: 'fee_scale', title: __('Fee_scale'), operate:'BETWEEN'}, - {field: 'refund_status', title: __('Refund_status'), searchList: {"1":__('Refund_status 1'),"3":__('Refund_status 3'),"5":__('Refund_status 5'),"7":__('Refund_status 7'),"9":__('Refund_status 9'),"11":__('Refund_status 11')}, formatter: Table.api.formatter.status}, - {field: 'settlement_time', title: __('Settlement_time')}, - {field: 'platform', title: __('Platform'), searchList: {"wechat_miniapp":__('Platform wechat_miniapp'),"tt_miniapp":__('Platform tt_miniapp')}, operate:'FIND_IN_SET', formatter: Table.api.formatter.label}, - {field: 'user.nickname', title: __('User.nickname'), operate: 'LIKE'}, - {field: 'user.mobile', title: __('User.mobile'), operate: 'LIKE'}, - {field: 'user.avatar', title: __('User.avatar'), operate: 'LIKE', events: Table.api.events.image, formatter: Table.api.formatter.image}, - {field: 'schoolactivityorder.order_no', title: __('Schoolactivityorder.order_no'), operate: 'LIKE'}, - {field: 'schoolactivityorder.pay_no', title: __('Schoolactivityorder.pay_no'), operate: 'LIKE'}, - {field: 'schoolactivity.title', title: __('Schoolactivity.title'), operate: 'LIKE'}, - {field: 'schoolactivity.images', title: __('Schoolactivity.images'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.images}, - {field: 'schoolactivityrefund.title', title: __('Schoolactivityrefund.title'), operate: 'LIKE'}, - {field: 'schoolactivityrefund.desc', title: __('Schoolactivityrefund.desc'), operate: 'LIKE'}, - {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate} + {field: 'sign_num',visible:false, title: __('Sign_num')}, + {field: 'verification_num',visible:false, title: __('Verification_num')}, + {field: 'collect',visible:false, title: __('Collect')}, + {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} ] ] }); diff --git a/public/assets/js/manystore/school/activity/order/order_log.js b/public/assets/js/manystore/school/activity/order/order_log.js index ab157fc..d4efb55 100644 --- a/public/assets/js/manystore/school/activity/order/order_log.js +++ b/public/assets/js/manystore/school/activity/order/order_log.js @@ -33,9 +33,9 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin {field: 'oper_id', title: __('Oper_id')}, {field: 'createtime', title: __('Createtime')}, {field: 'updatetime', title: __('Updatetime')}, - {field: 'schoolactivityorder.order_no', title: __('Schoolactivityorder.order_no'), operate: 'LIKE'}, - {field: 'schoolactivityorder.pay_no', title: __('Schoolactivityorder.pay_no'), operate: 'LIKE'}, - {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate} + {field: 'schoolactivityorder.order_no', title: __('Schoolactivityorder.order_no'), operate: 'LIKE' , visible:false}, + {field: 'schoolactivityorder.pay_no', title: __('Schoolactivityorder.pay_no'), operate: 'LIKE' , visible:false}, + // {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate } ] ] }); diff --git a/public/assets/js/manystore/school/activity/order/settle_log.js b/public/assets/js/manystore/school/activity/order/settle_log.js index d8d2d94..31829bf 100644 --- a/public/assets/js/manystore/school/activity/order/settle_log.js +++ b/public/assets/js/manystore/school/activity/order/settle_log.js @@ -1,4 +1,4 @@ -define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) { +define(['jquery', 'bootstrap', 'backend', 'csmtable', 'form'], function ($, undefined, Backend, Table, Form) { var Controller = { index: function () { @@ -22,37 +22,77 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin url: $.fn.bootstrapTable.defaults.extend.index_url, pk: 'id', sortName: 'id', + fixedColumns: true, + fixedRightNumber: 1, + asyndownload: true, columns: [ [ + {checkbox: true}, {field: 'id', title: __('Id')}, - {field: 'activity_order_id', title: __('Activity_order_id')}, - {field: 'withdrawal_log_id', title: __('Withdrawal_log_id')}, + {field: 'activity_order_id', title: __('Activity_order_id') ,visible:false}, + {field: 'activity_id', title: __('活动id') ,visible:false}, + {field: 'activity_order_detail_id', title: __('订单详情id') ,visible:false}, + {field: 'withdrawal_log_id',visible:false, title: __('Withdrawal_log_id') }, {field: 'to_user_id', title: __('To_user_id')}, + {field: 'touser.nickname', title: __('Touser.nickname'), operate: 'LIKE'}, + {field: 'touser.realname',visible:false, title: __('Touser.realname'), operate: 'LIKE'}, + {field: 'touser.mobile', title: __('Touser.mobile'), operate: 'LIKE'}, + {field: 'touser.avatar',visible:false, title: __('Touser.avatar'), operate: 'LIKE', events: Table.api.events.image, formatter: Table.api.formatter.image}, + {field: 'pay_user_id', title: __('Pay_user_id')}, + {field: 'payuser.nickname', title: __('Payuser.nickname'), operate: 'LIKE'}, + {field: 'payuser.realname',visible:false, title: __('Payuser.realname'), operate: 'LIKE'}, + {field: 'payuser.mobile', title: __('Payuser.mobile'), operate: 'LIKE'}, + {field: 'payuser.avatar', visible:false,title: __('Payuser.avatar'), operate: 'LIKE', events: Table.api.events.image, formatter: Table.api.formatter.image}, + + + {field: 'status', title: __('Status'), searchList: {"1":__('Status 1'),"2":__('Status 2'),"3":__('Status 3'),"-1":__('Status -1')}, formatter: Table.api.formatter.status}, - {field: 'settletime', title: __('Settletime'), operate: 'LIKE'}, - {field: 'createtime', title: __('Createtime')}, - {field: 'canceltime', title: __('Canceltime')}, - {field: 'unfreezetime', title: __('Unfreezetime')}, - {field: 'order_price', title: __('Order_price'), operate:'BETWEEN'}, - {field: 'fee_price', title: __('Fee_price'), operate:'BETWEEN'}, + + + {field: 'order_price', title: __('Order_price'), operate:'BETWEEN', showsum: true}, + {field: 'fee_price', title: __('Fee_price'), operate:'BETWEEN', showsum: true}, {field: 'fee_scale', title: __('Fee_scale'), operate:'BETWEEN'}, - {field: 'settle_price', title: __('Settle_price'), operate:'BETWEEN'}, - {field: 'sub_refundprice', title: __('Sub_refundprice'), operate:'BETWEEN'}, - {field: 'activity_id', title: __('Activity_id')}, - {field: 'activity_order_detail_id', title: __('Activity_order_detail_id')}, - {field: 'schoolactivityorder.order_no', title: __('Schoolactivityorder.order_no'), operate: 'LIKE'}, - {field: 'schoolactivityorder.pay_no', title: __('Schoolactivityorder.pay_no'), operate: 'LIKE'}, - {field: 'userwithdrawallog.id', title: __('Userwithdrawallog.id')}, - {field: 'user.nickname', title: __('User.nickname'), operate: 'LIKE'}, - {field: 'user.mobile', title: __('User.mobile'), operate: 'LIKE'}, - {field: 'user.avatar', title: __('User.avatar'), operate: 'LIKE', events: Table.api.events.image, formatter: Table.api.formatter.image}, - {field: 'schoolactivity.title', title: __('Schoolactivity.title'), operate: 'LIKE'}, - {field: 'schoolactivity.images', title: __('Schoolactivity.images'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.images}, - {field: 'schoolactivityorderdetail.title', title: __('Schoolactivityorderdetail.title'), operate: 'LIKE'}, - {field: 'schoolactivityorderdetail.images', title: __('Schoolactivityorderdetail.images'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.images}, - {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate} + {field: 'settle_price', title: __('Settle_price'), operate:'BETWEEN', showsum: true}, + + + {field: 'schoolactivityorder.order_no', title: __('Schoolactivityorder.order_no'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, + {field: 'userwithdrawallog.id',visible:false, title: __('Userwithdrawallog.id')}, + {field: 'userwithdrawallog.price',visible:false, title: __('Userwithdrawallog.price'), operate:'BETWEEN'}, + + + + {field: 'settletime', title: __('Settletime'), 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: 'canceltime', title: __('Canceltime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime}, + {field: 'unfreezetime', title: __('Unfreezetime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime}, + + + {field: 'operate', title: __('Operate'), table: table , buttons: [ + + { + name: 'order', + text: __('源头订单信息'), + title: __('源头订单信息'), + classname: 'btn btn-xs btn-warning btn-magic btn-dialog', + icon: 'fa fa-calendar', + // dropdown : '更多', + url: order_url, + callback: function (data) { + + }, + // visible: function (row) { + // return row.paytime; + // } + }, + + + ], events: Table.api.events.operate, formatter: Table.api.formatter.operate}, + + + + ] ] }); @@ -131,5 +171,12 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin } } }; + + + var order_url = function (row,dom) { + return 'school/activity/order/order/index?id='+row.activity_order_id; + } + + return Controller; }); \ No newline at end of file diff --git a/public/assets/js/manystore/user/withdrawal/userwithdrawal_log.js b/public/assets/js/manystore/user/withdrawal/userwithdrawal_log.js index 4912633..ddbadc0 100644 --- a/public/assets/js/manystore/user/withdrawal/userwithdrawal_log.js +++ b/public/assets/js/manystore/user/withdrawal/userwithdrawal_log.js @@ -1,4 +1,4 @@ -define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) { +define(['jquery', 'bootstrap', 'backend', 'csmtable', 'form'], function ($, undefined, Backend, Table, Form) { var Controller = { index: function () { @@ -22,6 +22,9 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin url: $.fn.bootstrapTable.defaults.extend.index_url, pk: 'id', sortName: 'id', + fixedColumns: true, + fixedRightNumber: 1, + asyndownload: true, columns: [ [ {checkbox: true}, @@ -29,31 +32,103 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin {field: 'price', title: __('Price'), operate:'BETWEEN'}, {field: 'fee_price', title: __('Fee_price'), operate:'BETWEEN'}, {field: 'real_price', title: __('Real_price'), operate:'BETWEEN'}, - {field: 'status', title: __('Status'), searchList: {"1":__('Status 1'),"2":__('Status 2'),"3":__('Status 3')}, formatter: Table.api.formatter.status}, - {field: 'reason', title: __('Reason'), operate: 'LIKE'}, - {field: 'withdrawal_status', title: __('Withdrawal_status'), searchList: {"1":__('Withdrawal_status 1'),"2":__('Withdrawal_status 2'),"3":__('Withdrawal_status 3')}, formatter: Table.api.formatter.status}, - {field: 'user_id', title: __('User_id')}, - {field: 'type', title: __('Type'), searchList: {"bank":__('Type bank'),"wechat":__('Type wechat'),"alipay":__('Type alipay')}, formatter: Table.api.formatter.normal}, - {field: 'name', title: __('Name'), operate: 'LIKE'}, - {field: 'bank_name', title: __('Bank_name'), operate: 'LIKE'}, - {field: 'bank_user_name', title: __('Bank_user_name'), operate: 'LIKE'}, - {field: 'id_number', title: __('Id_number'), operate: 'LIKE'}, - {field: 'paytime', title: __('Paytime')}, - {field: 'createtime', title: __('Createtime')}, - {field: 'examinetime', title: __('Examinetime')}, - {field: 'remark', title: __('Remark'), operate: 'LIKE'}, {field: 'real_have_price', title: __('Real_have_price'), operate:'BETWEEN'}, {field: 'real_fee_price', title: __('Real_fee_price'), operate:'BETWEEN'}, - {field: 'user.nickname', title: __('User.nickname'), operate: 'LIKE'}, - {field: 'user.mobile', title: __('User.mobile'), operate: 'LIKE'}, - {field: 'user.avatar', title: __('User.avatar'), operate: 'LIKE', events: Table.api.events.image, formatter: Table.api.formatter.image}, - {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate} + + + + {field: 'status', title: __('Status'), searchList: {"1":__('Status 1'),"2":__('Status 2'),"3":__('Status 3')}, formatter: Table.api.formatter.status}, + + {field: 'withdrawal_status', title: __('Withdrawal_status'), searchList: {"1":__('Withdrawal_status 1'),"2":__('Withdrawal_status 2'),"3":__('Withdrawal_status 3')}, formatter: Table.api.formatter.status}, + {field: 'remark', title: __('打款备注'), operate: 'LIKE', table: table, class: 'autocontent'}, + + {field: 'reason', title: __('Reason'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, + {field: 'user_id', title: __('User_id')}, + {field: 'type', title: __('Type'), searchList: {"bank":__('Type bank'),"wechat":__('Type wechat'),"alipay":__('Type alipay')}, formatter: Table.api.formatter.normal}, + {field: 'name',visible:false, title: __('Name'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, + {field: 'bank_name',visible:false, title: __('Bank_name'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, + {field: 'bank_user_name',visible:false, title: __('Bank_user_name'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, + {field: 'paytime', title: __('Paytime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime}, + + {field: 'examinetime', title: __('Examinetime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime}, + {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: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime}, + + {field: 'operate', title: __('Operate'), table: table , buttons: [ + + + { + name: 'order_detail', + text: __('提现对应的结算记录'), + title: __('提现对应的结算记录'), + classname: 'btn btn-dialog', + icon: 'fa fa-calendar', + dropdown : '更多', + url: order_detail_url, + callback: function (data) { + + }, + // visible: function (row) { + // return row.paytime; + // } + }, + + + ], events: Table.api.events.operate, formatter: Table.api.formatter.operate}, + + ] ] }); // 为表格绑定事件 Table.api.bindevent(table); + + + //自定义Tab筛选条件 + $('.panel-heading .nav-custom-condition a[data-toggle="tab"]', table.closest(".panel-intro")).on('shown.bs.tab', function (e) { + var value = $(this).data("value"); + var options = table.bootstrapTable('getOptions'); + var queryParams = options.queryParams; + options.pageNumber = 1; + options.queryParams = function (params) { + //这一行必须要存在,否则在点击下一页时会丢失搜索栏数据 + params = queryParams(params); + + //如果希望追加搜索条件,可使用 + var filter = params.filter ? JSON.parse(params.filter) : {}; + var op = params.op ? JSON.parse(params.op) : {}; + if (value!=="") { + //这里可以自定义多个筛选条件 + filter.withdrawal_status = value; + op.withdrawal_status = '='; + }else{ + //console.log("111111111111111111"); + //选全部时要移除相应的条件 + delete filter.withdrawal_status; + delete op.withdrawal_status; + } + + params.filter = JSON.stringify(filter); + params.op = JSON.stringify(op); + + //如果希望忽略搜索栏搜索条件,可使用 + //params.filter = JSON.stringify(value?{admin_id: value}:{}); + //params.op = JSON.stringify(value?{admin_id: '='}:{}); + return params; + }; + + table.trigger("uncheckbox"); + table.bootstrapTable('refresh', {pageNumber: 1}); + return false; + }); + + + }, add: function () { Controller.api.bindevent(); @@ -67,5 +142,11 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin } } }; + + var order_detail_url = function (row,dom) { + return 'school/activity/order/settle_log/index?withdrawal_log_id='+row.id; + } + + return Controller; }); \ No newline at end of file