@@ -198,7 +198,7 @@ class OrderIssueService
$query->where('created_at', '>=', $condition['settlement_at_start'] . ' 00:00:00')->where('type', '结束');
}
if (isset($condition['settlement_at_end'])) {
- $query->where('created_at', '<=', $condition['settlement_at_start'] . ' 23:59:59')->where('type', '结束');
+ $query->where('created_at', '<=', $condition['settlement_at_end'] . ' 23:59:59')->where('type', '结束');
});
@@ -24,10 +24,7 @@
模型对象的操作
已有对象的,并且直接赋值模型对象的,不建立服务,直接使用 $对象->update(['字段名'=>值,'字段名2'=>值])
##验证
- 实现
- 在app目录Validators新建与控制器同前缀名的,后缀为Validator的class文件
- 需要验证的控制器请求,在该文件建立同名方法,方法中返回Validator::make()对象
- 引入时,在控制器参数定义处定义引赖注入的类型,实例化的验证对象统一命名$validator
+
##服务
注册
@@ -87,3 +84,8 @@
缓存在service层以上使用,模型层内不使用
缓存在CacheService中,getOrExecute调用,第2个匿名函数放没有缓存时运行的实际逻辑
模型中的读取方法如需缓存,应在对应的Service中设置同名方法处理
+##导出Excel表
+ 默认应使用JSON方式,仅在以下两种情况用SQL:
+ > A 在之后发现性能跟不上等障碍
+ > B 在开发时明确发现必须用SQL的需求