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, $profits_money, $buy_name, $buy_time, $status_name, $remark ) = $row; if (empty($shop_name)) 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, 'pid' => 2], ['status' => ModelStatusEnum::OK]); } $refund_money = bcsub($refund_order_money, $refund_cost_money, 8); $profits_money = bcsub(bcadd(bcsub(bcsub($order_money, $cost_money, 8), $other_money, 8), $postage_money, 8), $refund_money, 2); $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, 'profits_money' => $profits_money, 'buy_id' => $buy['id'], 'buy_time' => $buy_time, 'status_name' => $status_name, 'remark' => $remark, 'check_status' => CheckStatusEnum::WAIT, 'import_time' => now(), 'entry_admin_id' => Admin::user()->id ?? 0 ]; Pipeline::query()->create($order); return true; } }