mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
message chat section
This commit is contained in:
@ -10,7 +10,7 @@ class ChatDeparmentModel extends Model
|
||||
protected $table = 'chat_departments';
|
||||
protected $primaryKey = 'id';
|
||||
protected $useAutoIncrement = true;
|
||||
protected $returnType = 'array';
|
||||
protected $returnType = 'object';
|
||||
protected $useSoftDeletes = false;
|
||||
protected $protectFields = true;
|
||||
protected $allowedFields = [
|
||||
@ -126,4 +126,21 @@ class ChatDeparmentModel extends Model
|
||||
->get()->getResultObject();
|
||||
return $result;
|
||||
}
|
||||
public function getDisplay(int $chat_deparment_id) : string
|
||||
{
|
||||
return $this->find($chat_deparment_id)->display;
|
||||
}
|
||||
public function getChatDepartmentSelect(string $query = null)
|
||||
{
|
||||
$q = $this->builder()->select([
|
||||
"id",
|
||||
"display as name",
|
||||
"description"
|
||||
]);
|
||||
if($query){
|
||||
$q->orLike("display",$query)
|
||||
->orLike("name",$query);
|
||||
}
|
||||
return $q;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user