post(); if (empty($param)) return errorTrans("empty.data"); $shopId = $request->uuid; $mode = (new SaasPrintClient); $printIn = []; foreach ($param as $key=>$val) { $printId = strToUniqueNumberV4(trim($val['name'])); $printData = $mode->where("code",$printId)->where("shop_id",$shopId)->findOrEmpty(); if ($printData->isEmpty()) { $printIn[$key] = [ "shop_id" => $shopId, "code" => $printId, "name" => $val['name'], "ipaddress" => $val['ipAddress'], "print_status" => $val['status'], ]; } } if (!empty($printIn)) { $mode->insertAll(array_values($printIn)); } return success("ok"); } catch (\Throwable $throwable) { return error($throwable->getMessage()); } } }