@@ -219,7 +219,7 @@ class SortingController extends Controller
"owner_id"=>$owner->id,
];
$batch = Batch::query()->where("code",$code)->first();
- if (!$wave){
+ if (!$batch){
$obj["code"] = $code;
$batch = Batch::query()->create($obj);
}else{