Commit bf4dfb3a by 朱继来

调整编辑erp单号

parent 9064e465
Showing with 11 additions and 3 deletions
......@@ -380,15 +380,23 @@ class ApiController extends Controller
$OrderExtendModel = new OrderExtendModel;
$OrderActionLogModel = new OrderActionLogModel;
$old_erp_sn = $OrderExtendModel->where('order_id', $order_id)->value('erp_sn');
$order_extend = $OrderExtendModel->where('order_id', $order_id)->first();
$res = $OrderExtendModel->where('order_id', $order_id)->update(['erp_sn' => $erp_sn]);
if (!$order_extend) {
$res = $OrderExtendModel->insert(['order_id' => $order_id, 'erp_sn' => $erp_sn]);
$OrderActionLogModel->addLog($order_id, $request->user->userId, 2, '编辑ERP单号,添加订单扩展表');
} else {
$res = $OrderExtendModel->where('order_id', $order_id)->update(['erp_sn' => $erp_sn]);
$OrderActionLogModel->addLog($order_id, $request->user->userId, 2, '编辑ERP单号,修改前:'.$order_extend->erp_sn);
}
if ($res === false) {
$this->Export(-1, '编辑ERP单号失败');
}
$OrderActionLogModel->addLog($order_id, $request->user->userId, 2, '编辑ERP单号,修改前:'.$old_erp_sn);
$this->Export(0, '编辑ERP单号成功');
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment