add demo of change order state machine process
This commit is contained in:
parent
cfc922ae46
commit
ed10fe3df8
|
|
@ -25,6 +25,7 @@ class Bootstrap
|
||||||
|
|
||||||
// $this->modifyAdminProductEdit();
|
// $this->modifyAdminProductEdit();
|
||||||
// $this->modifySetting();
|
// $this->modifySetting();
|
||||||
|
// $this->handlePaidOrder();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -131,4 +132,16 @@ class Bootstrap
|
||||||
return view('LatestProducts::admin.setting.tab')->render();
|
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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue