beginTransaction(); // 店舗作成 $shop = new Shop(); $shop->name = "方式3疎通確認用店舗"; $shop->under_amount_when_auth = 0; $shop->qr_service_expire_min = 0; $shop->save(); // デポジット作成 $deposit = new Deposit(); $deposit->shop_id = $shop->id; $deposit->deposit = 10000; $deposit->save(); // QRサービス券駐車場グループ作成 $group = new ServiceParkingGroup(); $group->name = "方式3疎通確認用QRサービス券駐車場グループ"; $group->save(); // QRサービス券駐車場グループ紐づけ作成 $groupRelation = new ServiceParkingGroupRelation(); $groupRelation->qr_service_parking_group_id = $group->id; $groupRelation->parking_management_code = "90002"; $groupRelation->save(); $groupRelation = new ServiceParkingGroupRelation(); $groupRelation->qr_service_parking_group_id = $group->id; $groupRelation->parking_management_code = "90005"; $groupRelation->save(); // 設定作成 $setting = new AcquisitionAvailableSetting(); $setting->shop_id = $shop->id; $setting->shop_no = 30; $setting->qr_service_parking_group_id = $group->id; $setting->discount_ticket_code = 31; $setting->save(); // サービス券取得用トークン作成 $token = CreateLogic::getToken($shop->id); $this->info(sprintf("トークン %s", $token->token)); $this->info(sprintf("%s/qr-service/acquitision/%s", config('app.url'), $token->token)); $db->commit(); } catch (Exception $e) { $db->rollBack(); throw $e; } return self::RESULTCODE_SUCCESS; } }