|
@@ -9,6 +9,8 @@ use Illuminate\Queue\SerializesModels;
|
|
|
use Illuminate\Queue\InteractsWithQueue;
|
|
|
use Illuminate\Contracts\Queue\ShouldQueue;
|
|
|
use Illuminate\Foundation\Bus\Dispatchable;
|
|
|
+use App\Modules\Trade\Models\Order;
|
|
|
+use App\Modules\User\Models\User;
|
|
|
|
|
|
/**
|
|
|
* 抖音用户推送数据
|
|
@@ -52,6 +54,20 @@ class TikTokUserCharge implements ShouldQueue
|
|
|
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();
|