DiverseYouthNightSchool/application/common/hooks.php

107 lines
3.3 KiB
PHP
Raw Permalink Normal View History

<?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' => [ // 订单取消后
'app\\common\\listener\\classesorder\\OrderHook'
],
'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' => [ // 订单取消后
'app\\common\\listener\\classeshourorder\\OrderHook'
],
];
//机构审核事件钩子
$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'
],
];
//课程审核事件钩子
$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'
],
];
//
//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);
$defaultHooks = array_merge_recursive($defaultHooks, $classesHooks);
return $defaultHooks;