add demo of change order state machine process

This commit is contained in:
Edward Yang 2023-03-17 12:08:23 +08:00
parent cfc922ae46
commit ed10fe3df8
1 changed files with 13 additions and 0 deletions

View File

@ -25,6 +25,7 @@ class Bootstrap
// $this->modifyAdminProductEdit();
// $this->modifySetting();
// $this->handlePaidOrder();
}
/**
@ -131,4 +132,16 @@ class Bootstrap
return view('LatestProducts::admin.setting.tab')->render();
});
}
/**
* 修改订单状态机流程演示
*/
private function handlePaidOrder() {
add_hook_filter('service.state_machine.machines', function ($data) {
$data['machines']['unpaid']['paid'][] = function (){
// 这里写订单由 unpaid 变为 paid 执行的逻辑
};
return $data;
}, 0);
}
}