|
@@ -33,6 +33,25 @@ class UserLogic extends BaseLogic
|
|
|
->where("user_id",$userId)
|
|
|
->where("commission_status",0)
|
|
|
->sum("order_commission");//带结算佣金
|
|
|
+ $last_start_time = date("Y-m-d",strtotime("-1 month"))." 00:00:00";
|
|
|
+ $last_end_time = date("Y-m")."-01 00:00:00";
|
|
|
+
|
|
|
+ $start_time = date("Y-m")."-01 00:00:00";
|
|
|
+ $end_time = date("Y-m-d H:i:s");
|
|
|
+
|
|
|
+ $user["last_month_money"] = UserOrderCommissionModel::query()
|
|
|
+ ->where("user_id",$userId)
|
|
|
+ ->whereIn("commission_status",[0,1])
|
|
|
+ ->where("created_at",">=",$last_start_time)
|
|
|
+ ->where("created_at","<=",$last_end_time)
|
|
|
+ ->sum("order_commission");
|
|
|
+
|
|
|
+ $user["month_money"] = UserOrderCommissionModel::query()
|
|
|
+ ->where("user_id",$userId)
|
|
|
+ ->whereIn("commission_status",[0,1])
|
|
|
+ ->where("created_at",">=",$start_time)
|
|
|
+ ->where("created_at","<=",$end_time)
|
|
|
+ ->sum("order_commission");
|
|
|
return $user;
|
|
|
}
|
|
|
|