From a98ad465f064cb2e7685e01222e07e5b24907a1c Mon Sep 17 00:00:00 2001 From: xucong <850806214@qq.com> Date: Mon, 19 Aug 2024 14:30:48 +0800 Subject: [PATCH] =?UTF-8?q?1.=E5=88=86=E9=94=80=E6=8E=A8=E5=B9=BF=E9=A1=B5?= =?UTF-8?q?=E6=88=91=E7=9A=84=E5=BA=97=E9=93=BA=E6=95=B0=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/logic/DistributionLogic.php | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/app/api/logic/DistributionLogic.php b/app/api/logic/DistributionLogic.php index e731b560..67f9228e 100755 --- a/app/api/logic/DistributionLogic.php +++ b/app/api/logic/DistributionLogic.php @@ -166,10 +166,29 @@ class DistributionLogic extends Logic ['first_leader', '=', $userId], ['del', '=', 0] ])->count(); - $shop_fans = Shop::where([ - ['reference_user_id', '=', $userId], - ['is_freeze', '=', 0] - ])->count(); +// $shop_fans = Shop::where([ +// ['reference_user_id', '=', $userId], +// ['is_freeze', '=', 0] +// ])->count(); + $shop_fans = Db::name("shop_apply") + ->alias("a") + ->join("user b","a.user_id = b.id","left") + ->where("b.first_leader",$userId) + ->where("a.audit_status",2) + ->where("a.del",0) + ->where("b.disable",0) + ->where("b.del",0) + ->count(); + $shop_fans1 = Db::name("local_store") + ->alias("a") + ->join("user b","a.user_id = b.id","left") + ->where("b.first_leader",$userId) + ->where("a.store_state",1) + ->where("a.is_delete",0) + ->where("b.disable",0) + ->where("b.del",0) + ->count(); + $shop_fans = $shop_fans+$shop_fans1; //今天的预估收益(待返佣) $today_earnings = DistributionOrderGoods::whereDay('create_time') ->where(['status' => 1, 'user_id' => $userId])