Commit 45b1e240 by 朱继来

调整导入记录

parent 3949c428
Showing with 13 additions and 6 deletions
...@@ -142,26 +142,33 @@ class SpecialController extends Controller ...@@ -142,26 +142,33 @@ class SpecialController extends Controller
$OrderModel = new OrderModel(); $OrderModel = new OrderModel();
// 记录到日志
$monolog = Log::getMonolog();
$monolog->popHandler();
Log::useDailyFiles(storage_path('logs/updateOrder.log'));
foreach ($excel as $k=>$v) { foreach ($excel as $k=>$v) {
if (!$v[0] || !$v[1]) continue; if (!$v[0] || !$v[1]) continue;
// 1. 根据手机或邮箱查找客户最近的订单 // 1. 根据手机或邮箱查找客户最近的订单
$order_id = $this->getLastOrderId(trim($v[0])); $order_id = $this->getLastOrderId(trim($v[0]));
if ($order_id === false) continue; if ($order_id === false) {
Log::info('客户账号:'.$v[0].',客服邮箱:'.$v[1].',客户无订单');
continue;
}
// 2. 根据企业邮箱查找sale_id // 2. 根据企业邮箱查找sale_id
$sale_id = $this->getSaleId(trim(strtolower($v[1]))); $sale_id = $this->getSaleId(trim(strtolower($v[1])));
if ($sale_id === false) continue; if ($sale_id === false) {
Log::info('客户账号:'.$v[0].',客服邮箱:'.$v[1].',没有找到跟进人邮箱');
continue;
}
// 3. 替换第一步的订单sale_id // 3. 替换第一步的订单sale_id
$OrderModel->where('order_id', $order_id)->update(['sale_id' => $sale_id]); $OrderModel->where('order_id', $order_id)->update(['sale_id' => $sale_id]);
// 记录到日志
$monolog = Log::getMonolog();
$monolog->popHandler();
Log::useDailyFiles(storage_path('logs/updateOrder.log'));
Log::info('客户账号:'.$v[0].',客服邮箱:'.$v[1].',替换已离职人员的订单,订单ID:'.$order_id.',之前的SALE ID:'.$sale_id); Log::info('客户账号:'.$v[0].',客服邮箱:'.$v[1].',替换已离职人员的订单,订单ID:'.$order_id.',之前的SALE ID:'.$sale_id);
} }
......
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