作者 wangzhi

222

... ... @@ -103,13 +103,13 @@ class Order extends Backend
$validate = is_bool($this->modelValidate) ? ($this->modelSceneValidate ? $name . '.edit' : $name) : $this->modelValidate;
$row->validateFailException(true)->validate($validate);
}
$result = $row->allowField(true)->save($params);
//处理订单完成后逻辑
if ($params['order_status'] == 2) {
//如果订单状态更改为已完成
//订单发票状态改为待开票
Db::name('order')->where(['order_sn' => $params['order_sn']])->update(['invoice_status' => 1]);
}
$result = $row->allowField(true)->save($params);
Db::commit();
} catch (ValidateException $e) {
Db::rollback();
... ...