> Controllers 에서 사용 use Illuminate\Support\Str; // 추가 $truncated = Str::limit(‘가나다라마바사 아 자 차 카 ABcdef 12345566’, 20); // […]
PHP Laravel 6 – 서브쿼리 ( Query builder )
use Illuminate\Support\Facades\DB; $test = DB::table(“test1_table”) -> select(“test1_table.*”, DB::raw(” (select test2_table.name from test2_table […]
PHP Laravel 6 – 특정 테이블만 생성 및 변경시 path 지정하여 시행
1. 모델 만들며 -m 옵션을 아래와 같이 준다. php artisan make:model TestTABLE -m 2. DB 테이블 생성 파일 편집 후 […]
PHP Laravel 6 – debug log
www/config/logging.php 파일의 ‘default’ => env(‘LOG_CHANNEL’, ‘daily’), 변경 ‘channels’ => [ ‘stack’ => [ […]
JAVA Spring – POI Excel download sample on Controller.java
import org.apache.poi.hssf.usermodel.HSSFCellStyle; import org.apache.poi.hssf.util.HSSFColor; import org.apache.poi.ss.usermodel.CellStyle; import org.apache.poi.xssf.streaming.SXSSFCell; import org.apache.poi.xssf.streaming.SXSSFRow; import org.apache.poi.xssf.streaming.SXSSFSheet; import org.apache.poi.xssf.streaming.SXSSFWorkbook; import java.io.OutputStream; import java.text.SimpleDateFormat; @RequestMapping(value […]
JAVASCRIP 해당월의 일 수 구하기
<script> function day_cnt(year, month) { var cnt = 32 – new Date(year, month-1, 32).getDate(); console.log(“day count:”+cnt); } </script> <button type=”button” […]
ORACLE 해당월 첫날 기준으로 월의 마지막날 , 이전달의 첫날 마지막날 구하기
해당월의 첫날 : 2019-07-01 select biz_cdts , count(*) from member_base where TRUNC(join_dtm, ‘MM’) = ‘2019-07-01’ group by biz_cdts select biz_cdts […]
PHP Laravel 6 – CRUD 기본 : 목록 , 수정 , 삭제 (4)
> 편집 TestCRUDController publicfunctionedit($id) { $test = TestCRUD::findOrFail($id); returnview(‘test_view.modifyform’, compact(‘test’)); } > view 파일 생성 modifyform.blade.php @extends(‘layout’) @section(‘content’) <style> .uper { margin-top: 40px; } </style> <divclass=”card uper”> […]
PHP Laravel 6 – CRUD 기본 : 목록 , 확인 (3)
– 목록 화면 ( 편집 파일 : TestCRUDController ) publicfunctionindex() { $test = TestCRUD::all(); return view(‘test_view.index’, compact(‘test’)); } – View 파일 생성 ( /resources/views/test_view ) index.blade.php @extends(‘layout’) […]