uid = $uid; $this->amount = $amount; $this->time = $time; } /** * Execute the job. * * @return void */ public function handle() { $client = new Client(); if(empty($this->time)){ \Log::info('origin_params:'.$this->time); $this->time = date('Y-m-d H:i:s'); } $params = [ 'uid' => $this->uid, 'amount' => $this->amount, 'time' => $this->time, 'source' => 'wdy' ]; \Log::info('TikTokUserCharge:'.json_encode($params)); // if( date('Y-m-d',strtotime( $this->time )) != date('Y-m-d')){ // return ; // } $user = User::find($this->uid); $order = Order::where('uid', $this->uid)->where('status', 'PAID')->orderBy('id', 'desc')->first(); $current_day_register = date('Y-m-d', strtotime($order->created_at)) == date('Y-m-d', strtotime($user->created_at)); if ($order && $current_day_register && $order->price >= 30) { $count = Order::where('uid', $this->uid)->where('status', 'PAID')->where('price', '>=', '30')->count(); if ($count == 1) { } else { return; } } else { return; } $params['sign'] = _sign($params, SysConsts::TIKTOK_KEY); $url = 'https://newtrackapi.zhuishuyun.com/api/user/tiktokUserChargePush'; $response = $client->request('post', $url, ['form_params' => $params])->getBody()->getContents(); myLog('tiktok_push_charge')->info($response); $result = json_decode($response); if ($result) { if ($result->code != 0) { myLog('tiktok_push_charge')->info($response); } } } }