getIndex() <= 1) return false; list( $shop_name, $order_time, $order_no, $out_order_no, // $nums, $order_money, $cost_money, // $refund_order_money, // $refund_cost_money, // $postage_money, // $other_money, // $refund_postage_money, // $return_money, // $compensate, $buy_name, $buy_time, // $status_name, $remark ) = $row; if (empty($shop_name)) return false; if (!Shop::query()->where('name', $shop_name)->exists()) { return false; } $shop = Shop::query()->firstOrCreate(['name' => $shop_name], ['status' => ModelStatusEnum::OK]); if (empty($buy_name)) { $buy['id'] = 0; } else { $buy = Category::query()->firstOrCreate(['name' => $buy_name, 'parent_id' => 2], ['status' => ModelStatusEnum::OK]); } $order = [ 'shop_id' => $shop->id, 'platform' => $shop->platform, 'order_no' => $order_no, 'order_time' => $order_time, 'out_order_no' => $out_order_no, // 'nums' => (int)$nums, 'order_money' => $order_money ?? 0.00, 'cost_money' => $cost_money ?? 0.00, // 'refund_order_money' => $refund_order_money ?? 0.00, // 'refund_cost_money' => $refund_cost_money ?? 0.00, // 'postage_money' => $postage_money ?? 0.00, // 'other_money' => $other_money ?? 0.00, // 'refund_postage_money' => $refund_postage_money ?? 0.00, // 'return_money' => $return_money ?? 0.00, // 'compensate' => $compensate ?? 0.00, 'buy_id' => $buy['id'], 'buy_time' => $buy_time, // 'status_name' => $status_name, 'remark' => $remark, 'check_status' => CheckStatusEnum::WAIT, 'import_time' => now(), 'entry_admin_id' => login_admin_id() ?? 0 ]; Log::error(arr2str($order)); Order::query()->create($order); return true; } }