orderBy($inputs['sort'], $inputs['sort_type']); } if ($inputs['isExport']){ $list = $list->get(); }else{ $list = $list->paginate(\App\Utils::item_per_page); // Utilsクラスの定数を使用 } return $list; } public static function getByPk($pk) { return self::find($pk); } public static function deleteByPk($arr) { return self::whereIn('contract_id', $arr)->delete(); } //TODO 定期契約ID not found in database specs //TODO 解約/契約不可フラグ not found in database specs public function userName() { return $this->belongsTo(\App\Models\User::class,'user_id','user_seq')->first(); } public function getUserType() { return $this->belongsTo(\App\Models\Usertype::class,'user_categoryid','user_categoryid')->first(); } public function getPark() { return $this->belongsTo(\App\Models\Park::class,'park_id','park_id')->first(); } public function getPrice() { return $this->belongsTo(\App\Models\Price::class,'price_parkplaceid','price_parkplaceid')->first(); } // public function getSettlement() // { // return $this->belongsTo(SettlementTransaction::class,'settlement_transaction_id','settlement_transaction_id')->first(); // } public function getOpe() { return $this->belongsTo(\App\Models\Ope::class,'ope_id','ope_id')->first(); } }