2024-11-15 18:26:03 +08:00
|
|
|
<?php
|
|
|
|
//
|
|
|
|
$defaultHooks = [
|
|
|
|
// 订单创建
|
|
|
|
'classes_order_create_before' => [ // 订单创建前
|
|
|
|
'app\\common\\listener\\classesorder\\OrderHook'
|
|
|
|
],
|
|
|
|
'classes_order_create_after' => [ // 订单创建后
|
|
|
|
'app\\common\\listener\\classesorder\\OrderHook'
|
|
|
|
],
|
|
|
|
'classes_order_payed_after' => [ // 订单支付成功
|
|
|
|
'app\\common\\listener\\classesorder\\OrderHook'
|
|
|
|
],
|
|
|
|
'classes_order_cancel_after' => [ // 订单取消后
|
2024-11-20 18:05:45 +08:00
|
|
|
'app\\common\\listener\\classesorder\\OrderHook'
|
2024-11-15 18:26:03 +08:00
|
|
|
],
|
|
|
|
|
|
|
|
'classes_order_finish_after' => [ // 订单完成后
|
|
|
|
'app\\common\\listener\\classesorder\\OrderHook'
|
|
|
|
],
|
|
|
|
|
|
|
|
//
|
|
|
|
// app\common\listener\classesorder
|
|
|
|
|
|
|
|
// 订单取消
|
|
|
|
// 'order_cancel_before' => [ // 订单取消前
|
|
|
|
// ],
|
|
|
|
// 'order_cancel_after' => [ // 订单取消后
|
|
|
|
// 'addons\\shopro\\listener\\order\\Invalid'
|
|
|
|
// ],
|
|
|
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
|
|
//课时订单事件钩子
|
|
|
|
$hourHooks = [
|
|
|
|
// 订单创建
|
|
|
|
'classeshour_order_create_before' => [ // 订单创建前
|
|
|
|
'app\\common\\listener\\classeshourorder\\OrderHook'
|
|
|
|
],
|
|
|
|
'classeshour_order_create_after' => [ // 订单创建后
|
|
|
|
'app\\common\\listener\\classeshourorder\\OrderHook'
|
|
|
|
],
|
|
|
|
'classeshour_order_update_after' => [ // 订单变更课时后
|
|
|
|
'app\\common\\listener\\classeshourorder\\OrderHook'
|
|
|
|
],
|
|
|
|
'classeshour_order_auth_success_after' => [ // 订单审核通过后
|
|
|
|
'app\\common\\listener\\classeshourorder\\OrderHook'
|
|
|
|
],
|
|
|
|
'classeshour_order_auth_fail_after' => [ // 订单审核失败后
|
|
|
|
'app\\common\\listener\\classeshourorder\\OrderHook'
|
|
|
|
],
|
|
|
|
'classeshour_order_finish_after' => [ // 订单核销完成后
|
|
|
|
'app\\common\\listener\\classeshourorder\\OrderHook'
|
|
|
|
],
|
|
|
|
'classeshour_order_cancel_after' => [ // 订单取消后
|
2024-11-20 18:05:45 +08:00
|
|
|
'app\\common\\listener\\classeshourorder\\OrderHook'
|
2024-11-15 18:26:03 +08:00
|
|
|
],
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//机构审核事件钩子
|
|
|
|
$manystoreHooks = [
|
|
|
|
// 订单创建
|
|
|
|
'shop_create_after' => [ // 机构账号创建成功后(审核之前)
|
|
|
|
'app\\common\\listener\\manystore\\ShopHook'
|
|
|
|
],
|
|
|
|
'shop_apply_after' => [ // 机构账号提交审核申请后
|
|
|
|
'app\\common\\listener\\manystore\\ShopHook'
|
|
|
|
],
|
|
|
|
'shop_auth_success_after' => [ // 机构审核通过后
|
|
|
|
'app\\common\\listener\\manystore\\ShopHook'
|
|
|
|
],
|
|
|
|
'shop_auth_fail_after' => [ // 机构审核失败后
|
|
|
|
'app\\common\\listener\\manystore\\ShopHook'
|
|
|
|
],
|
2024-11-27 18:15:32 +08:00
|
|
|
'shop_update_after' => [ // 机构数据变更
|
|
|
|
'app\\common\\listener\\manystore\\ShopHook'
|
|
|
|
],
|
2024-11-15 18:26:03 +08:00
|
|
|
];
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-11-21 18:03:23 +08:00
|
|
|
//课程审核事件钩子
|
|
|
|
$classesHooks = [
|
|
|
|
// 订单创建
|
|
|
|
'classes_auth_need_after' => [ // 课程审核提交
|
|
|
|
'app\\common\\listener\\classes\\ClassesHook'
|
|
|
|
],
|
|
|
|
'classes_auth_success_after' => [ // 课程审核通过后
|
|
|
|
'app\\common\\listener\\classes\\ClassesHook'
|
|
|
|
],
|
|
|
|
'classes_auth_fail_after' => [ // 课程审核失败后
|
|
|
|
'app\\common\\listener\\classes\\ClassesHook'
|
|
|
|
],
|
|
|
|
];
|
|
|
|
|
|
|
|
|
2024-11-15 18:26:03 +08:00
|
|
|
|
2024-11-26 17:59:18 +08:00
|
|
|
//用户事件钩子
|
|
|
|
$userHooks = [
|
|
|
|
'user_auth_need_after' => [ // 发起用户授权
|
|
|
|
'app\\common\\listener\\user\\UserHook'
|
|
|
|
],
|
|
|
|
'user_auth_success_after' => [ // 用户授权机构通过
|
|
|
|
'app\\common\\listener\\user\\UserHook'
|
|
|
|
],
|
|
|
|
'user_auth_fail_after' => [ // 用户授权机构不通过
|
|
|
|
'app\\common\\listener\\user\\UserHook'
|
|
|
|
],
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-11-15 18:26:03 +08:00
|
|
|
//
|
|
|
|
//if (file_exists(ROOT_PATH . 'addons/shopro/listener/commission')) {
|
|
|
|
// $defaultHooks = array_merge_recursive($defaultHooks, $commissionHooks);
|
|
|
|
//}
|
|
|
|
$defaultHooks = array_merge_recursive($defaultHooks, $hourHooks);
|
|
|
|
$defaultHooks = array_merge_recursive($defaultHooks, $manystoreHooks);
|
2024-11-21 18:03:23 +08:00
|
|
|
$defaultHooks = array_merge_recursive($defaultHooks, $classesHooks);
|
2024-11-26 17:59:18 +08:00
|
|
|
$defaultHooks = array_merge_recursive($defaultHooks, $userHooks);
|
2024-11-15 18:26:03 +08:00
|
|
|
|
|
|
|
return $defaultHooks;
|