123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- <?php
- namespace App\Http\Controllers;
- use App\Models\Activity;
- use App\Models\ActivityLimit;
- use App\Models\BigGiftApply;
- use App\Models\Goodtest;
- use App\Models\Order;
- use App\Models\OrderDetail;
- use App\Models\Ordertest;
- use App\Models\System;
- use Carbon\Carbon;
- use http\Env\Request;
- use Illuminate\Database\Eloquent\Model;
- use Illuminate\Support\Facades\Auth;
- use Illuminate\Support\Facades\Storage;
- class ActiveController extends Controller{
- public function active(){
- $user=Auth::user();
- $data=System::get();
- $now=(Carbon::now()->timestamp)*1000;
- foreach ($data as $k=>$v){
- $re[$v->keys]=$v->values;
- }
- $ups=$this->explode($re['upgrade_standard']);
- $time=$this->explode($re['activity_time']);
- if ($user->level_change==0){
- $data['status']=0;
- }elseif ($user->level_change==1){
- $data['status']=1;
- }
- $data['start']=strtotime($time['first'])*1000;
- $data['end']=strtotime($time['two'])*1000;
- if ($now<$data['start']||$now>$data['end']){
- $data['isActive']=false;
- }else{
- $data['isActive']=true;
- }
- $data['top_money']=$ups['first'];
- $data['crown_money']=$ups['two'];
- return $this->success($data);
- }
- public function explode($data){
- $re=explode('/',$data);
- return ['first'=>$re[0],'two'=>$re[1]];
- }
- }
|