<?php

namespace App\Models\Users;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\DB;

class BotmsgVariable extends Model
{
    protected $table = 'bot_variables';
    use HasFactory;


    public static function getLumSumInterstRate($text)
    {
        if ($text == "49.1") {
            $botVariableValue = BotmsgVariable::where('name', "CAR_INTEREST")->where('status', 1)->get()->first();
        } else if ($text == "49.2") {
            $botVariableValue = BotmsgVariable::where('name', "EDUCATION_ITEREST")->where('status', 1)->get()->first();
        } else if ($text == "49.3") {
            $botVariableValue = BotmsgVariable::where('name', "FLAT_INTEREST")->where('status', 1)->get()->first();
        } else if ($text == "49.4") {
            $botVariableValue = BotmsgVariable::where('name', "TRIP_INTEREST")->where('status', 1)->get()->first();
        }
        return $botVariableValue->value;
    }
}
