一. 接口開發的設置:
~~~
// 是否強制使用路由
'url_route_must' => true,
// 路由是否完全匹配
'route_complete_match' => true,
// 異常處理handle類 留空使用 \think\exception\Handle 自定義的一場處理類路徑
'exception_handle' => '\app\lib\exception\ExceptionHandler',
// 數據集返回類型
'resultset_type' => 'collection',
// 默認輸出類型
'default_return_type' => 'json',
~~~
日志設置: 關閉日志自動寫入
二. 數據關聯復雜應用
~~~
self::with(['items','items.img'])->find($data);
items.img指 items方法關聯的模型下的img關聯
~~~
雜項知識:
~~~
數據轉換: collection($array);
數據集->hidden()方法
數據集判空方法: $coll->isEmpty
~~~