v.2.22
Редактор карты зала Электронные заказы Отчет по удалениям
This commit is contained in:
24
models/Reasons.php
Normal file
24
models/Reasons.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
namespace App\Component\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Reasons extends Model {
|
||||
protected $table = 'reasons';
|
||||
|
||||
public static function getName($data) {
|
||||
$reason_name = Reasons::where('code', intval($data))->where('is_history', 0)->first();
|
||||
if ($reason_name) {
|
||||
$reason_name = $reason_name['name'];
|
||||
} else {
|
||||
$reason_name = Reasons::where('code', intval($data))->where('is_history', 1)->first();
|
||||
if ($reason_name) {
|
||||
$reason_name = $reason_name['name'];
|
||||
} else {
|
||||
$reason_name = 'Связанная причина удаления не найдена';
|
||||
}
|
||||
}
|
||||
return $reason_name;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user