<?php
/*
 本代码由 口号帮 创建
 创建时间 2019-05-08 16:22:09
 技术支持 口号帮 
 严禁反编译、逆向等任何形式的侵权行为，违者将追究法律责任
*/

namespace App\Http\Controllers\Admin;use App\Http\Controllers\Controller;use App\Models\Apply;use App\Models\Member;use App\Models\Product;use Faker\Provider\Uuid;use Illuminate\Http\Request;class HomeController extends Controller{public function __construct(){$this->middleware('auth');}public function index(Request $request){$order['wait']=Apply::where('status',2)->count();$order['execute']=Apply::where('status',4)->count();$order['finish']=Apply::where('status',5)->count();$order['lost']=Apply::where('status',6)->count();$source['up']=Product::where('status',0)->count();$source['media']=Product::where('created_from','media')->count();$source['cloud']=Product::where('created_from','cloud')->count();$source['platform']=Product::where('created_from','platform')->count();$users=Member::count();$all_week=Member::where('created_at','>',date('Y-m-d',(time()-7*86400)))->count();$money=Apply::where('status','>',1)->sum('money');$money_week=Apply::where('status','>',1)->where('pay_time','>',date('Y-m-d',(time()-7*86400)))->sum('money');return view('admin.home',compact('order','source','users','money','all_week','money_week'));}public function layout(){return view('admin.layouts.admin');}}
?>