diff --git a/application/admin/controller/school/activity/order/Order.php b/application/admin/controller/school/activity/order/Order.php
index 94f167b..c8ce152 100644
--- a/application/admin/controller/school/activity/order/Order.php
+++ b/application/admin/controller/school/activity/order/Order.php
@@ -205,4 +205,119 @@ class Order extends Backend
+
+
+
+
+ /**发布者售后确认
+ * @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_reason = $params["reject_reason"];
+ $price = $params["price"];
+ $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);
+ }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"];
+ $status = $params["status"];
+ $price = $params["price"];
+ $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());
+ }
+
+ $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 after_sales($ids = ""){
+
+ if($this->request->isPost())
+ {
+ try{
+ $params = $this->request->post("row/a");
+ $classes_order = $params["id"];
+ $reason = $params["reason"];
+ $num = $params["num"];
+
+ $model = (new \app\common\model\school\activity\order\Order());
+ $order = $model->afterSales($classes_order,$num,$reason,0 ,false,'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'));
+ }
+ $order_info = \app\common\model\school\activity\order\Order::getDetail($row["id"]);
+// $row = $this->model->get($param['ids']);
+ $this->view->assign('row',$order_info);
+ return $this->view->fetch();
+ }
+
+
+
+
}
diff --git a/application/admin/controller/user/User.php b/application/admin/controller/user/User.php
index 12db2f0..2a206d2 100644
--- a/application/admin/controller/user/User.php
+++ b/application/admin/controller/user/User.php
@@ -4,6 +4,7 @@ namespace app\admin\controller\user;
use app\common\controller\Backend;
use app\common\library\Auth;
+use app\common\model\school\activity\order\SettleLog;
use fast\Tree;
use think\Model;
@@ -53,6 +54,10 @@ class User extends Backend
->paginate($limit);
foreach ($list as $k => $v) {
$v->avatar = $v->avatar ? cdnurl($v->avatar, true) : letter_avatar($v->nickname);
+
+ //结算钱包信息
+ $v["settle_info"] = SettleLog::getUserSettleInfo($v->id);
+
$v->hidden(['password', 'salt']);
}
$result = array("total" => $list->total(), "rows" => $list->items());
diff --git a/application/admin/controller/user/withdrawal/Userwithdrawal.php b/application/admin/controller/user/withdrawal/Userwithdrawal.php
index ab20bbd..f80eb69 100644
--- a/application/admin/controller/user/withdrawal/Userwithdrawal.php
+++ b/application/admin/controller/user/withdrawal/Userwithdrawal.php
@@ -18,10 +18,14 @@ class Userwithdrawal extends Backend
*/
protected $model = null;
+ protected $qSwitch = true;
+ protected $qFields = ["user_id"];
+
public function _initialize()
{
- parent::_initialize();
+
$this->model = new \app\admin\model\user\withdrawal\Userwithdrawal;
+ parent::_initialize();
}
diff --git a/application/admin/view/school/activity/activity/add.html b/application/admin/view/school/activity/activity/add.html
index 5471656..926b152 100644
--- a/application/admin/view/school/activity/activity/add.html
+++ b/application/admin/view/school/activity/activity/add.html
@@ -30,6 +30,7 @@
diff --git a/application/admin/view/school/activity/activity/copy.html b/application/admin/view/school/activity/activity/copy.html
index 191712a..6f14a3b 100644
--- a/application/admin/view/school/activity/activity/copy.html
+++ b/application/admin/view/school/activity/activity/copy.html
@@ -33,6 +33,8 @@
-
+
(没找到用户则点击按钮创建用户后重新下拉框选用户)
diff --git a/application/common/hooks.php b/application/common/hooks.php
index 56d4157..df705d0 100644
--- a/application/common/hooks.php
+++ b/application/common/hooks.php
@@ -323,6 +323,9 @@ $newactivityOrderHooks = [
'activity_order_shop_reject_after' => [ // 订单售后拒绝
'app\\common\\listener\\activity\\OrderHook'
],
+ 'activity_order_timeout_reject_after'=> [ // 订单售后拒绝
+ 'app\\common\\listener\\activity\\OrderHook'
+ ],
];
diff --git a/application/common/listener/activity/OrderHook.php b/application/common/listener/activity/OrderHook.php
index 704ce36..d09429e 100644
--- a/application/common/listener/activity/OrderHook.php
+++ b/application/common/listener/activity/OrderHook.php
@@ -586,7 +586,7 @@ class OrderHook
$to_id = $order["user_id"];
$status ="activity";
$params=[
- "event"=>"activity_order_after_sales_after",
+ "event"=>"activity_order_shop_confirm_after",
"order_id"=>$order["id"],
"order_no"=>$order["order_no"],
"activity_id"=>$order["activity_id"],
@@ -644,7 +644,7 @@ class OrderHook
$to_id = $order["user_id"];
$status ="activity";
$params=[
- "event"=>"activity_order_after_sales_after",
+ "event"=>"activity_order_shop_reject_after",
"order_id"=>$order["id"],
"order_no"=>$order["order_no"],
"activity_id"=>$order["activity_id"],
@@ -688,6 +688,62 @@ class OrderHook
+ // 订单售后超时自动拒绝
+ public function activityOrderTimeoutRejectAfter(&$params)
+ {
+ ["order"=>$order] = $params;
+
+ $order = Order::where("id" , $order["id"])->find();
+
+ $detail = $order->detail;
+ $user = $order->user;
+ //记录订单日志
+ $mini_type = "activity_order";
+ $to_id = $order["user_id"];
+ $status ="activity";
+ $params=[
+ "event"=>"activity_order_timeout_reject_after",
+ "order_id"=>$order["id"],
+ "order_no"=>$order["order_no"],
+ "activity_id"=>$order["activity_id"],
+ "title"=>$detail["title"],
+ "images"=>$detail["images"],
+ ];
+ $param = [
+ "title"=>$detail["title"],
+ "order_no" => $order["order_no"],
+ "nickname" => $user["nickname"],
+ "realname" => $user["realname"],
+ "mobile" => $user["mobile"],
+ "price" => $order["totalprice"],
+ "payprice" => $order["payprice"],
+ "real_refundprice" => $order["real_refundprice"],
+ "sub_refundprice" => $order["sub_refundprice"],
+ "total_refundprice" => $order["total_refundprice"],
+ "reason" => $order["reason"],
+ "auth_reason" => $order["auth_reason"],
+ "address"=>$detail["address"]."(".$detail["address_detail"].")",
+ "start_time" => date("Y-m-d H:i",$detail["start_time"]), //格式化日期格式 $order["start_time"], //格式化日期格式
+ "end_time" => date("Y-m-d H:i",$detail["end_time"]),
+ "sign_start_time" => date("Y-m-d H:i",$detail["sign_start_time"]), //格式化日期格式 $order["start_time"], //格式化日期格式
+ "sign_end_time" => date("Y-m-d H:i",$detail["sign_end_time"]),
+ ];
+
+ //发用户
+ (new MessageConfig)
+ ->setTemplate($params["event"])
+ ->setTemplateData($param)
+ ->setToUid($to_id)
+ ->setMessageStatus($status)
+ ->setMessageMiniType($mini_type)
+ ->setMessageParams($params)
+ ->sendMessage();
+
+ }
+
+
+
+
}
\ 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 b7f5688..9c874cb 100644
--- a/application/common/model/school/activity/Activity.php
+++ b/application/common/model/school/activity/Activity.php
@@ -1238,7 +1238,7 @@ class Activity extends BaseModel
if($trans){
self::rollbackTrans();
}
- throw new \Exception($e->getMessage());
+ throw new \Exception($e->getMessage().$e->getFile().$e->getLine());
}
return $row;
}
diff --git a/application/common/model/school/activity/order/Order.php b/application/common/model/school/activity/order/Order.php
index b7206fe..4f57ff1 100644
--- a/application/common/model/school/activity/order/Order.php
+++ b/application/common/model/school/activity/order/Order.php
@@ -734,7 +734,7 @@ class Order extends BaseModel
self::paySetData($order,$notify);
//释放结算订单
-// (new SettleLog)->generatorLog($order['id']);
+ (new SettleLog)->timeoutSettleActivityCheck($order["activity_id"]);
// //如果需要快捷预约
// $classes_lib_spec_id = $order['classes_lib_spec_id'];
@@ -1239,7 +1239,7 @@ class Order extends BaseModel
//释放结算订单
-// (new SettleLog)->generatorLog($order['id']);
+ (new SettleLog)->timeoutSettleActivityCheck($order["activity_id"]);
//调用支付成功事件
$data = ['order' => $order];
@@ -1825,19 +1825,23 @@ class Order extends BaseModel
$order->refundtime = time();
$order->refund_json = json_encode($pay_json);
$order->save();
-
+ //报废旧的结算单
+ SettleLog::where("activity_order_id",$order['id'])
+ ->where("status" ,"in",["1","2"])
+ ->update([
+ "status"=>"-1",
+ "canceltime" => time()
+ ]);
//若存在剩余金额,结算给发布者
if($order->sub_refundprice > $order->fee_scale){
- //报废旧的结算单
- SettleLog::where("activity_order_id",$order['id'])
- ->where("status" ,"in",["1","2"])
- ->update([
- "status"=>"-1",
- "canceltime" => time()
- ]);
+
//插入新结算单
- (new SettleLog)->generatorLog($order['id']);
+// (new SettleLog)->generatorLog($order['id']);
+ //对活动订单进行结算记录插入
+ (new SettleLog)->timeoutSettleActivityCheck($order["activity_id"]);
+
+
}
@@ -2062,8 +2066,9 @@ class Order extends BaseModel
public static function updateShopConfirmationOrder($order,$price){
if(is_string($order))$order = self::getHaveShopConfirmationOrder($order);
$order->status = "5";//refund_status
- $order->service_stauts = "6";
+ $order->server_status = "6";
$order->auth_status = 1;
+ $order['suspend_status'] = '1';
$order->total_refundprice = $price;
$order->refundtime = time();
$order->save();
@@ -2081,11 +2086,11 @@ class Order extends BaseModel
*/
public static function updateShopConfirmationFailOrder($order,$reason){
if(is_string($order))$order = self::getHaveShopConfirmationOrder($order);
- $order->status = "7";//refund_status
- $order->service_stauts = "6";
- $order->auth_status = 2;
- $order->reason = $reason;
- $order->suspend_status = '1';
+ $order["status"] = "7";//refund_status
+ $order["server_status"] = "6";
+ $order["auth_status"] = 2;
+ $order["reason"] = $reason;
+ $order['suspend_status'] = '1';
$order->save();
return $order;
}
@@ -2106,6 +2111,10 @@ class Order extends BaseModel
*/
public function shopConfirmation($order_no,$status,$price,$reject_reason,$user_id=0,$check=false,$oper_type='user',$oper_id=0,$trans=false){
+
+ //得到机构售后提交确认订单
+ $order = self::getHaveShopConfirmationOrder($order_no);
+ $this->timeoutSuspension($order['id'],$trans);
//得到机构售后提交确认订单
$order = self::getHaveShopConfirmationOrder($order_no);
if($check){
@@ -2156,6 +2165,8 @@ class Order extends BaseModel
}
$res = true;
try{
+
+
//事务逻辑
//更新售后为取消状态
switch ($status){
@@ -2195,9 +2206,9 @@ class Order extends BaseModel
//插入订单日志
if(!$user_id ||$order["user_id"] !=$user_id ){
- $order::log($order['id'],"[系统操作]活动订单售后驳回,订单挂起,等待官方处理",$oper_type ?: 'user', $oper_id ?: $order['user_id']);
+ OrderLog::log($order['id'],"[系统操作]活动订单售后驳回,订单挂起,等待官方处理",$oper_type ?: 'user', $oper_id ?: $order['user_id']);
}else{
- $order::log($order['id'],"活动订单售后驳回,订单挂起,等待官方处理",$oper_type ?: 'user', $oper_id ?: $order['user_id']);
+ OrderLog::log($order['id'],"活动订单售后驳回,订单挂起,等待官方处理",$oper_type ?: 'user', $oper_id ?: $order['user_id']);
}
//调用订单取消事件
@@ -2210,7 +2221,200 @@ class Order extends BaseModel
throw new \Exception("参数错误!");
}
//执行课时数更新
- $res1 = order::statisticsAndUpdateClassesNumber($order['classes_order_id']);
+ $res1 = order::statisticsAndUpdateClassesNumber($order);
+
+
+ if($trans){
+ self::commitTrans();
+ }
+ }catch (\Exception $e){
+ if($trans){
+ self::rollbackTrans();
+ }
+ throw new \Exception($e->getMessage());
+ }
+ return $res1;
+ }
+
+
+ /** 检测售后订单超时未处理自动挂起定时任务
+ * @param $id 售后订单id非必填,不填则检测所有超时未处理的
+ * @param $trans
+ * @return true
+ * @throws \Exception
+ */
+ public function timeoutSuspension($id=0,$trans=false){
+ //去超时时间戳配置
+ $timeout = config('site.activity_end_sales');
+ //当前时间
+ $time = time();
+ //延期时间过了当前时间的时间点(用时间戳相减特性)
+ $delay_time = $time - $timeout;
+ //初始查询model
+ $as = $this->getWithAlisaName();
+ $model = self::with(["detail"])
+ ->where("{$as}.server_status",'3')
+ ->where("{$as}.suspend_status",'0')
+ ->where("{$as}.status",'4');
+ if($id){
+ $model = $model->where("{$as}.id",$id);
+ }
+ //查询条件2:过了活动结束时间加延期时间的订单
+ $model = $model->where("detail.end_time","<",$delay_time);
+ $list = $model->select();
+
+ if($trans){
+ self::beginTrans();
+ }
+ $res = true;
+ try{
+ //遍历订单,执行挂起操作
+ foreach ($list as $row){
+ //执行挂起操作
+ $row["status"] = "7";
+ $row["server_status"] = "6";
+ $row["suspend_status"] = "2";
+ $row["auth_status"] = 2;
+ $row["auth_time"] = time();
+ $row->save();
+
+ //写订单日志
+ OrderLog::log($row['id'],"活动订单售后超时自动驳回,订单挂起,等待官方处理",'admin', 0);
+ //调用挂起事件
+ $data = ['order' => self::where("id",$row['id'])->find(),"user_id"=>0,"oper_type"=>"admin","oper_id"=>0];
+ \think\Hook::listen('activity_order_timeout_reject_after', $data);
+
+
+
+ }
+ if($trans){
+ self::commitTrans();
+ }
+ }catch (\Exception $e){
+ if($trans){
+ self::rollbackTrans();
+ }
+ throw new \Exception($e->getMessage().$e->getFile().$e->getLine());
+ }
+ return $res;
+ }
+
+
+
+
+
+
+ /**总后台最后处理售后挂起的订单
+ * @param $order_no
+ * @param int $user_id
+ * @param string $status yes同意 no拒绝(即订单按完成算)
+ * @param string $price 商定价格
+ * @param bool $check
+ * @param bool $trans
+ * @return bool
+ * @throws \Exception
+ */
+ public function adminConfirmation($order_no,$status,$price,$user_id=0,$check=false,$oper_type='user',$oper_id=0,$trans=false){
+ //得到机构售后提交确认订单
+ $order = self::getHaveShopConfirmationOrder($order_no);
+
+ if($check){
+ //用户操作权限检测
+ Order::checkOptionAuth($order['id'],$user_id ?: $oper_id,$oper_type,false,false,true);
+ }
+ $classesorder = $order;
+ if(!$classesorder)throw new \Exception("订单不存在!");
+
+ switch ($status){
+ case 'yes':
+ //同意
+ //验证价格正确性
+ //金额必须小于等于剩余未退全额
+ $price = floatval($price);
+ if($price > $classesorder['sub_refundprice']){
+ throw new \Exception("价格必须小于等于剩余应退全额!");
+ }
+ //数据修正大于剩余未退全额 则等于剩余未退
+ $price = $price > $classesorder['sub_refundprice'] ? $classesorder['sub_refundprice'] : $price;
+ if($price<=0)throw new \Exception("同意退款必须大于0!");
+
+ //如果非全额退款,剩余金额必须大于订单支付时的手续费
+ if($price < $classesorder['sub_refundprice']){
+ $sub_price = bcsub($classesorder['sub_refundprice'] , $price,2);
+ if($sub_price <= $classesorder['fee_price']){
+ throw new \Exception("如果未退全款,剩余未退金额必须大于订单支付时的手续费{$classesorder['fee_price']}!");
+ }
+ }
+
+ break;
+ case 'no':
+ //拒绝
+
+ break;
+ default:
+ throw new \Exception("参数错误!");
+ }
+
+
+ //判断逻辑
+ if($trans){
+ self::beginTrans();
+ }
+ $res = true;
+ try{
+
+
+ //事务逻辑
+ //更新售后为取消状态
+ switch ($status){
+ case 'yes':
+ //同意
+
+ //更新订单状态为同意
+ $order = self::updateShopConfirmationOrder($order,$price);
+
+ //插入订单日志
+ if(!$user_id ||$order["user_id"] !=$user_id ){
+ OrderLog::log($order['id'],"[系统操作]活动订单售后最终处理结果:用户发起金额为{$order['first_refundprice']},确认退款金额为{$price}元,等待退款到账",$oper_type ?: 'user', $oper_id ?: $order['user_id']);
+ }else{
+ OrderLog::log($order['id'],"活动订单售后最终处理结果:用户发起金额为{$order['first_refundprice']},确认退款金额为{$price}元,等待退款到账",$oper_type ?: 'user', $oper_id ?: $order['user_id']);
+ }
+
+ //调用订单事件
+ $data = ['order' => self::where("id",$order['id'])->find(),"user_id"=>$user_id,"oper_type"=>$oper_type,"oper_id"=>$oper_id];
+ \think\Hook::listen('activity_order_shop_confirm_after', $data);
+
+
+ //执行退款
+ //执行退款
+ self::orderRefund($order['order_no'],$price,$oper_type,$oper_id);
+
+
+
+
+
+ break;
+ case 'no':
+ //拒绝
+
+ //插入订单日志
+ if(!$user_id ||$order["user_id"] !=$user_id ){
+ OrderLog::log($order['id'],"[系统操作]活动订单售后最终判定为不进行售后,将不退款,按订单完成处理",$oper_type ?: 'user', $oper_id ?: $order['user_id']);
+ }else{
+ OrderLog::log($order['id'],"活动订单售后最终判定为不进行售后,将不退款,按订单完成处理",$oper_type ?: 'user', $oper_id ?: $order['user_id']);
+ }
+
+ //调用订单完成
+ //执行订单完成的更新逻辑
+ self::updateFinish($order);
+
+
+ break;
+ default:
+ throw new \Exception("参数错误!");
+ }
+ //执行课时数更新
+ $res1 = order::statisticsAndUpdateClassesNumber($order);
if($trans){
@@ -2230,5 +2434,4 @@ class Order extends BaseModel
-
}
diff --git a/application/common/model/school/activity/order/SettleLog.php b/application/common/model/school/activity/order/SettleLog.php
index 7e684b4..f97002b 100644
--- a/application/common/model/school/activity/order/SettleLog.php
+++ b/application/common/model/school/activity/order/SettleLog.php
@@ -180,6 +180,10 @@ class SettleLog extends BaseModel
try {
//查询更新所有活动状态
Activity::timeoutCheck();
+
+ //执行售后单挂起操作
+ (new order)->timeoutSuspension();
+
//延后时间(秒)
$delay = config("site.activity_end_settle") ?: 0;
$time = time();
diff --git a/public/assets/js/backend/school/activity/activity.js b/public/assets/js/backend/school/activity/activity.js
index 473eb6a..712afeb 100644
--- a/public/assets/js/backend/school/activity/activity.js
+++ b/public/assets/js/backend/school/activity/activity.js
@@ -129,6 +129,55 @@ define(['jquery', 'bootstrap', 'backend', 'csmtable', 'form'], function ($, unde
// }
},
+ {
+ name: 'activity_order',
+ text: __('参与的活动订单'),
+ title: __('参与的活动订单'),
+ classname: 'btn btn-dialog',
+ icon: 'fa fa-cart-arrow-down',
+ dropdown : '更多',
+ url: activity_order_url,
+ callback: function (data) {
+
+ },
+ // visible: function (row) {
+ // return row.status == '2'||row.status == '3';
+ // }
+ },
+
+ {
+ name: 'user',
+ text: __('发布用户查看'),
+ title: __('发布用户查看'),
+ classname: 'btn btn-dialog',
+ icon: 'fa fa-cart-arrow-down',
+ dropdown : '更多',
+ url: user_url,
+ callback: function (data) {
+
+ },
+ // visible: function (row) {
+ // return row.status == '2'||row.status == '3';
+ // }
+ },
+
+
+ {
+ name: 'settle_log',
+ text: __('活动生成的结算日志'),
+ title: __('活动生成的结算日志'),
+ classname: 'btn btn-dialog',
+ icon: 'fa fa-cart-arrow-down',
+ dropdown : '更多',
+ url: settle_log_url,
+ callback: function (data) {
+
+ },
+ // visible: function (row) {
+ // return row.status == '2'||row.status == '3';
+ // }
+ },
+
], events: Table.api.events.operate, formatter: Table.api.formatter.operate},
@@ -299,5 +348,22 @@ define(['jquery', 'bootstrap', 'backend', 'csmtable', 'form'], function ($, unde
}
}
};
+
+
+
+ var activity_order_url = function (row,dom) {
+ return 'school/activity/order/order/index?activity_id='+row.id;
+ }
+
+ var user_url = function (row,dom) {
+ return 'user/user/index?id='+row.user_id;
+ }
+
+
+ var settle_log_url = function (row,dom) {
+ return 'school/activity/order/settle_log/index?activity_id='+row.id;
+ }
+
+
return Controller;
});
diff --git a/public/assets/js/backend/school/activity/order/order.js b/public/assets/js/backend/school/activity/order/order.js
index c919bba..995e751 100644
--- a/public/assets/js/backend/school/activity/order/order.js
+++ b/public/assets/js/backend/school/activity/order/order.js
@@ -15,6 +15,10 @@ 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',
+ 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',
}
});
@@ -87,6 +91,54 @@ define(['jquery', 'bootstrap', 'backend', 'csmtable', 'form'], function ($, unde
{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.detail.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',
@@ -462,6 +514,27 @@ define(['jquery', 'bootstrap', 'backend', 'csmtable', 'form'], function ($, unde
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();
+ });
+ Controller.api.bindevent();
+ },
+ shop_confirmation: function(){
+ $("#shop_confirmation").on('click', function() {
+ $("#shop_confirmation-form").attr("action",'school/activity/order/order/shop_confirmation').submit();
+ });
+ 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]"));
diff --git a/public/assets/js/backend/school/activity/order/settle_log.js b/public/assets/js/backend/school/activity/order/settle_log.js
index d8409bf..2d1ef3c 100644
--- a/public/assets/js/backend/school/activity/order/settle_log.js
+++ b/public/assets/js/backend/school/activity/order/settle_log.js
@@ -30,6 +30,8 @@ define(['jquery', 'bootstrap', 'backend', 'csmtable', 'form'], function ($, unde
{checkbox: true},
{field: 'id', title: __('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'},
diff --git a/public/assets/js/backend/user/user.js b/public/assets/js/backend/user/user.js
index 68a4984..f980b22 100644
--- a/public/assets/js/backend/user/user.js
+++ b/public/assets/js/backend/user/user.js
@@ -34,6 +34,13 @@ define(['jquery', 'bootstrap', 'backend', 'csmtable', 'form'], function ($, unde
{field: 'username', title: __('Username'), operate: 'LIKE'},
{field: 'nickname', title: __('Nickname'), operate: 'LIKE'},
{field: 'realname', title: __('真实姓名'), operate: 'LIKE'},
+
+ {field: 'settle_info.settled_amount', title: __('可提现金额'), operate: false},
+ {field: 'settle_info.expected_incoming_amount', title: __('预期收益'), operate: false},
+ {field: 'settle_info.accumulated_incoming_amount', title: __('累计收入'), operate: false},
+
+
+
{field: 'work', title: __('职业'), operate: 'LIKE'},
{field: 'email', title: __('Email'), operate: 'LIKE'},
{field: 'mobile', title: __('Mobile'), operate: 'LIKE'},
@@ -135,6 +142,22 @@ define(['jquery', 'bootstrap', 'backend', 'csmtable', 'form'], function ($, unde
// }
},
+ {
+ name: 'activity',
+ text: __('发布的活动'),
+ title: __('发布的活动'),
+ classname: 'btn btn-dialog',
+ icon: 'fa fa-calendar',
+ dropdown : '更多',
+ url: activity_url,
+ callback: function (data) {
+
+ },
+ // visible: function (row) {
+ // return row.status == '2'||row.status == '3';
+ // }
+ },
+
// {
// name: 'classes_order',
@@ -152,25 +175,76 @@ define(['jquery', 'bootstrap', 'backend', 'csmtable', 'form'], function ($, unde
// // }
// },
//
- // {
- // name: 'classes_hourorder',
- // text: __('课时预约单'),
- // title: __('课时预约单'),
- // classname: 'btn btn-dialog',
- // icon: 'fa fa-calendar',
- // dropdown : '更多',
- // url: classes_hourorder_url,
- // callback: function (data) {
- //
- // },
- // // visible: function (row) {
- // // return row.status == '2'||row.status == '3';
- // // }
- // },
+ {
+ name: 'userwithdrawal',
+ text: __('用户提现银行卡'),
+ title: __('用户提现银行卡'),
+ classname: 'btn btn-dialog',
+ icon: 'fa fa-calendar',
+ dropdown : '更多',
+ url: userwithdrawal_url,
+ callback: function (data) {
+
+ },
+ // visible: function (row) {
+ // return row.status == '2'||row.status == '3';
+ // }
+ },
+ {
+ name: 'userwithdrawal_log',
+ text: __('用户提现记录'),
+ title: __('用户提现记录'),
+ classname: 'btn btn-dialog',
+ icon: 'fa fa-calendar',
+ dropdown : '更多',
+ url: userwithdrawal_log_url,
+ callback: function (data) {
+
+ },
+ // visible: function (row) {
+ // return row.status == '2'||row.status == '3';
+ // }
+ },
+
+
+ {
+ name: 'pay_user',
+ text: __('贡献资金结算'),
+ title: __('贡献资金结算'),
+ classname: 'btn btn-dialog',
+ icon: 'fa fa-calendar',
+ dropdown : '更多',
+ url: settle_log_pay_user_url,
+ callback: function (data) {
+
+ },
+ // visible: function (row) {
+ // return row.status == '2'||row.status == '3';
+ // }
+ },
+ {
+ name: 'to_user',
+ text: __('获取的资金结算'),
+ title: __('获取的资金结算'),
+ classname: 'btn btn-dialog',
+ icon: 'fa fa-calendar',
+ dropdown : '更多',
+ url: settle_log_to_user_url,
+ callback: function (data) {
+
+ },
+ // visible: function (row) {
+ // return row.status == '2'||row.status == '3';
+ // }
+ },
+
+
+
+
{
name: 'activity_order',
- text: __('活动订单'),
- title: __('活动订单'),
+ text: __('参与的活动订单'),
+ title: __('参与的活动订单'),
classname: 'btn btn-dialog',
icon: 'fa fa-cart-arrow-down',
dropdown : '更多',
@@ -182,6 +256,7 @@ define(['jquery', 'bootstrap', 'backend', 'csmtable', 'form'], function ($, unde
// return row.status == '2'||row.status == '3';
// }
},
+
// {
// name: 'evaluate',
// text: __('查看用户评价'),
@@ -310,5 +385,26 @@ define(['jquery', 'bootstrap', 'backend', 'csmtable', 'form'], function ($, unde
}
+ var userwithdrawal_url = function (row,dom) {
+ return 'user/withdrawal/userwithdrawal/index?user_id='+row.id;
+ }
+
+ var userwithdrawal_log_url = function (row,dom) {
+ return 'user/withdrawal/userwithdrawal_log/index?user_id='+row.id;
+ }
+
+ var settle_log_to_user_url = function (row,dom) {
+ return 'school/activity/order/settle_log/index?to_user_id='+row.id;
+ }
+
+ var settle_log_pay_user_url = function (row,dom) {
+ return 'school/activity/order/settle_log/index?pay_user_id='+row.id;
+ }
+
+ var activity_url = function (row,dom) {
+ return 'school/activity/activity/index?user_id='+row.id;
+ }
+
+
return Controller;
});
\ No newline at end of file
diff --git a/public/assets/js/backend/user/withdrawal/userwithdrawal.js b/public/assets/js/backend/user/withdrawal/userwithdrawal.js
index 19562e4..c130bf8 100644
--- a/public/assets/js/backend/user/withdrawal/userwithdrawal.js
+++ b/public/assets/js/backend/user/withdrawal/userwithdrawal.js
@@ -6,8 +6,8 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
Table.api.init({
extend: {
index_url: 'user/withdrawal/userwithdrawal/index' + location.search,
- add_url: 'user/withdrawal/userwithdrawal/add',
- edit_url: 'user/withdrawal/userwithdrawal/edit',
+ add_url: 'user/withdrawal/userwithdrawal/add'+ location.search,
+ edit_url: 'user/withdrawal/userwithdrawal/edit'+ location.search,
del_url: 'user/withdrawal/userwithdrawal/del',
multi_url: 'user/withdrawal/userwithdrawal/multi',
import_url: 'user/withdrawal/userwithdrawal/import',