cfmgrv3 init...2

This commit is contained in:
최준흠 2023-06-19 18:58:08 +09:00
parent 4d840ecd98
commit bd2791f1ed
5 changed files with 27 additions and 4 deletions

View File

@ -76,6 +76,10 @@ class AccountModel extends Model
$this->where('created_at >=', $start);
$this->where('created_at <=', $end);
}
public function setIndexOrderBy($field, $order = 'ASC')
{
$this->orderBy("title ASC, {$field} {$order}");
}
//존재하는지 체크
public function isUniqueApikey(string $uid): bool

View File

@ -68,6 +68,10 @@ class AuthModel extends Model
$this->where('created_at >=', $start);
$this->where('created_at <=', $end);
}
public function setIndexOrderBy($field, $order = 'ASC')
{
$this->orderBy("id ASC, {$field} {$order}");
}
//도메인이 이미 존재하는지 체크
public function isUniqueApikey(string $uid): bool

View File

@ -65,4 +65,8 @@ class LoggerModel extends Model
$this->where('created_at >=', $start);
$this->where('created_at <=', $end);
}
public function setIndexOrderBy($field, $order = 'ASC')
{
$this->orderBy("title ASC, {$field} {$order}");
}
}

View File

@ -64,4 +64,8 @@ class MapurlModel extends Model
$this->where('created_at >=', $start);
$this->where('created_at <=', $end);
}
public function setIndexOrderBy($field, $order = 'ASC')
{
$this->orderBy("oldurl ASC, {$field} {$order}");
}
}

View File

@ -1,6 +1,7 @@
<?php
namespace App\Models;
use App\Entities\UserEntity;
use CodeIgniter\Model;
@ -53,7 +54,9 @@ class UserModel extends Model
public function getEntity(int $uid): null|UserEntity
{
$entity = $this->asObject(UserEntity::class)->where('uid', $uid)->first();
if(is_null($entity)){ throw new \Exception(__METHOD__."에서 {$uid} 해당 정보가 없습니다."); }
if (is_null($entity)) {
throw new \Exception(__METHOD__ . "에서 {$uid} 해당 정보가 없습니다.");
}
return $entity;;
}
@ -67,4 +70,8 @@ class UserModel extends Model
$this->where('created_at >=', $start);
$this->where('created_at <=', $end);
}
public function setIndexOrderBy($field, $order = 'ASC')
{
$this->orderBy("name ASC, {$field} {$order}");
}
}