|
@@ -110,6 +110,8 @@ class CouponDetailController extends Curd
|
|
|
if ($field) {
|
|
|
$model = $model->orderBy($field, $order);
|
|
|
}
|
|
|
+ $model = $model->orderBy('coupon_detail_gain_datetime', 'ASC');
|
|
|
+
|
|
|
return $model;
|
|
|
}
|
|
|
|
|
@@ -347,7 +349,10 @@ class CouponDetailController extends Curd
|
|
|
$couponIds = Coupon::where('coupon_name', 'like', '%' . $couponName . '%')->pluck('coupon_id')->toArray();
|
|
|
$model = $model->whereIn('join_detail_coupon_id', $couponIds);
|
|
|
}
|
|
|
- $details = $model->get()->toArray();
|
|
|
+ $details = $model->orderBy('coupon_detail_addtimes', 'DESC')
|
|
|
+ ->orderBy('coupon_detail_gain_datetime', 'ASC')
|
|
|
+ ->get()
|
|
|
+ ->toArray();
|
|
|
|
|
|
// 查出所有门店
|
|
|
$depts = SysDept::where('dept_category', '营业场所')->pluck('dept_name', 'dept_id')->toArray();
|