Please solve this error.

Posted 1 month ago by apkking9

public function getAdvertise(Request $request) { $id = $request->user_add; $advertise = $request->advertise; $user = User::findOrFail(Auth::user()->id); $prem = $user['paid_status']; $pranto_add = UserAdvertise::find($id); if ($pranto_add->status == 1) { UserAdvertise::where('add_id', $advertise)->update(['status' => 0 ]); $add = Advertise::whereId($advertise)->first(); Advertise::whereId($advertise) ->update([ 'remain' => $add->remain + 1, ]); $user = User::findOrFail(Auth::user()->id); $new_balance = $user['taskt'] = $user['taskt'] + $add->price; $user->save();

    Transaction::create([
        'user_id' => Auth::user()->id,
        'trans_id' => 'AD'.rand(),
        'time' => Carbon::now(),
        'description' => 'VIEWADD'. '#ID'.'-'.'CA'.rand(),
        'amount' => $add->price ,
        'new_balance' => $new_balance,
        'type' => 1,
    ]);
    
    $user = User::findOrFail(Auth::id());
    $ref_id = $user->referrer_id;
    $ref_user = User::find($ref_id);

if ($ref_user->paid_status ==1){ $new_balance2 = $ref_user['refb'] = $ref_user['refb'] + 0.5; $ref_user->save(); Transactionr::create([ 'user_id' => $ref_user->id, 'trans_id' => 'RE'.rand(), 'time' => Carbon::now(), 'description' => 'REFAD'. '#ID'.'-'.$user->username, 'amount' => 0.5 , 'new_balance' => $new_balance2, 'type' => 1, ]); }esle{ } $user = User::findOrFail(Auth::id()); $ref_id1 = $user->referrer_id2; $ref_user1 = User::find($ref_id1); if ($ref_user1->paid_status ==1){ $new_balance3 = $ref_user1['refb'] = $ref_user1['refb'] + 0.25; $ref_user1->save(); Transactionr::create([ 'user_id' => $ref_user1->id, 'trans_id' => 'RE'.rand(), 'time' => Carbon::now(), 'description' => 'REFAD'. '#ID'.'-'.$user->username, 'amount' => 0.25 , 'new_balance' => $new_balance3, 'type' => 1, ]); }esle{ } $user = User::findOrFail(Auth::id()); $ref_id2 = $user->referrer_id3; $ref_user2 = User::find($ref_id2); if ($ref_user2->paid_status ==1){ $new_balance4 = $ref_user2['refb'] = $ref_user2['refb'] + 0.1; $ref_user2->save(); Transactionr::create([ 'user_id' => $ref_user2->id, 'trans_id' => 'RE'.rand(), 'time' => Carbon::now(), 'description' => 'REFAD'. '#ID'.'-'.$user->username, 'amount' => 0.1 , 'new_balance' => $new_balance4, 'type' => 1, ]); }esle{ } }else{ return Session::flash('wrong', 'Fruad Detected: Multiple Click Not Support!!'); }

}

Please sign in or create an account to participate in this conversation.

Reply to

Use Markdown with GitHub-flavored code blocks.