|
@@ -59,7 +59,8 @@ class CustomerFromThreePlatForm extends Command
|
|
|
$nowStamp = time();
|
|
|
list($main, $main_detail, $fail) = $this->processingData($dataArray, $nowStamp,$basic);
|
|
|
$c_third_platform_id = array_column($main,'c_third_platform_id');
|
|
|
- if (! empty($main)) {
|
|
|
+
|
|
|
+ if (! empty($main) ) {
|
|
|
Customer::insert($main);
|
|
|
|
|
|
$map = Customer::whereIn('c_third_platform_id',$c_third_platform_id)
|
|
@@ -75,16 +76,15 @@ class CustomerFromThreePlatForm extends Command
|
|
|
}
|
|
|
}
|
|
|
if(! empty($insert_detail)) CustomerInfo::insert($insert_detail);
|
|
|
- if(! empty($fail)) {
|
|
|
- foreach ($fail as $update){
|
|
|
- $customer_id = $map[$c_third_platform_id] ?? 0;
|
|
|
- \App\Model\CustomerFromThreePlatForm::where('id', $update['id'])
|
|
|
- ->update(['del_time' => $update['result'] , 'customer_id' => $customer_id]);
|
|
|
- }
|
|
|
- }
|
|
|
echo '更新完成' . PHP_EOL;
|
|
|
- } else {
|
|
|
- echo '暂无数据写入' . PHP_EOL;
|
|
|
+ }
|
|
|
+
|
|
|
+ if(! empty($fail)) {
|
|
|
+ foreach ($fail as $update){
|
|
|
+ $customer_id = $map[$c_third_platform_id] ?? 0;
|
|
|
+ \App\Model\CustomerFromThreePlatForm::where('id', $update['id'])
|
|
|
+ ->update(['del_time' => $update['result'] , 'customer_id' => $customer_id]);
|
|
|
+ }
|
|
|
}
|
|
|
});
|
|
|
});
|