diff --git a/app/Models/MapurlModel.php b/app/Models/MapurlModel.php index 210c99c..effb03c 100644 --- a/app/Models/MapurlModel.php +++ b/app/Models/MapurlModel.php @@ -1,6 +1,7 @@ asObject(MapurlEntity::class)->where('uid',$uid)->first(); - if(is_null($entity)){ throw new \Exception(__METHOD__."에서 {$uid} 해당 정보가 없습니다."); } + $entity = $this->asObject(MapurlEntity::class)->where('uid', $uid)->first(); + if (is_null($entity)) { + throw new \Exception(__METHOD__ . "에서 {$uid} 해당 정보가 없습니다."); + } return $entity; } @@ -59,13 +62,13 @@ class MapurlModel extends Model $this->orLike('oldurl', $word, 'both'); //befor , after , both $this->orLike('newurl', $word, 'both'); //befor , after , both } - public function setIndexDateFilter($start,$end) + public function setIndexDateFilter($start, $end) { $this->where('created_at >=', $start); $this->where('created_at <=', $end); } public function setIndexOrderBy($field, $order = 'ASC') { - $this->orderBy("oldurl ASC, {$field} {$order}"); + $this->orderBy("newurl ASC, {$field} {$order}"); } }