From f04fa2166fd14e062b053d20702ece88d0c943d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E5=8D=8E=E6=B8=85?= <18691022700@163.com> Date: Thu, 27 Nov 2025 16:40:43 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BA=A6=E5=AE=9A=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/api/controller/Family.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/application/api/controller/Family.php b/application/api/controller/Family.php index 5e28794..cb8e607 100644 --- a/application/api/controller/Family.php +++ b/application/api/controller/Family.php @@ -32,11 +32,21 @@ class Family extends BaseCom public function familyEarnings() { $user_id = input('user_id',0);//族长 id + $where = ['a.user_id' => $user_id]; + if(input('start_time')){ + $where['a.createtime'][] = ['>', strtotime(input('start_time'))]; + } + if(input('end_time')){ + $where['a.createtime'][] = ['<', strtotime(input('end_time'))]; + } + $reslut = db::name('vs_user_sign_earnings')->alias('a') ->join('user b','a.sign_user_id = b.id') ->join('vs_gift g','a.gift_id = g.gid') ->field('b.nickname,b.avatar,b.user_code,a.earnings,a.createtime,g.gift_name,g.gift_price') - ->where(['a.user_id' => $user_id]) + ->where($where) + ->order('a.createtime desc') + ->page(input('page',1),30) ->select(); return V(1, '成功', $reslut); }