allocatr/application/admin/behavior/OrderLog.php
2025-03-03 17:38:12 +08:00

24 lines
629 B
PHP

<?php
namespace app\admin\behavior;
class OrderLog
{
//记录订单日志
public function run(&$response)
{
$Model = new \app\admin\model\OrderLog();
$statusList = $Model->getOrderStatusList();
$order = $response['order'];
$auth = $response['auth']??null;
$data = [
'order_id' => $order->id,
'order_status' => $order->status,
'remark' => $statusList[$order->status],
'admin_id' => $auth->id ?? 0,
'admin_user' => $auth->nickname ??'system'
];
$Model->save($data);
}
}