_valid([ "shop.default" => $request->user['agent_id'] ]); $data = (new OrderService)->getTotalToday(['shop' => $param['shop']]); $qrcode = (new SaasOrderQrcode)->whereDay("create_at")->where(["shop_id" => $param['shop'],'status' => 1])->field("sum(money) as money,count(1) as total")->find(); $card = (new SaasUserBuy)->whereDay("create_at")->where(["shop_id" => $param['shop'],'status' => 1])->field("sum(money) as money,count(1) as total")->find(); $total = [ [ "name" => "小程序订单", "type" => "线上支付", "order" => $data['p1'], "money" => $data['p1m'] ], [ "name" => "收款码", "type" => "线上支付", "order" => $qrcode['total'], "money" => $qrcode['money'] ], [ "name" => "会员卡充值", "type" => "线上支付", "order" => $card['total'], "money" => $card['money'] ], [ "name" => "会员卡支付", "type" => "线上支付", "order" => $data['p2'], "money" => $data['p2m'] ] ]; $today = [ "money" => $data['p1m'], "user" => $data['p2m'], "qrcode" => $qrcode['money'], ]; return success("ok",compact("total","today")); } catch (\Throwable $throwable) { return error($throwable->getMessage()); } } }