@@ 506-513 (lines=8) @@ | ||
503 | $pb->points = $point; |
|
504 | $tmp = R::store($pb); |
|
505 | ||
506 | if($point === $this->POINT_FOR_USING_A_BADGE){ //SE SEI IN CAMMINO MA NON LI HAI ANCORA RAGGIUNTI |
|
507 | $ubc = R::dispense("userbadgeclove"); |
|
508 | $ubc->user = $user_id; |
|
509 | $ubc->badge = $b->id; |
|
510 | $ubc->part = $part_id; |
|
511 | $ubc->inserttime = date($this->DATE_FORMAT); |
|
512 | $tmp = R::store($ubc); |
|
513 | } |
|
514 | } |
|
515 | } |
|
516 | ||
@@ 517-524 (lines=8) @@ | ||
514 | } |
|
515 | } |
|
516 | ||
517 | if($point_earned <= 0){ //SE NON CI SONO BADGE O SE TU NON SEI IN CAMMINO PER NESSUNO DI LORO |
|
518 | $pb = R::dispense("cero"); |
|
519 | $pb->user = $user_id; |
|
520 | $pb->part = $part_id; |
|
521 | $pb->inserttime = date($this->DATE_FORMAT); |
|
522 | $pb->points = $this->POINT_DEFAULT; |
|
523 | $tmp = R::store($pb); |
|
524 | } |
|
525 | $res = ["points"=>$point_earned]; |
|
526 | $headers = []; |
|
527 | return JsonResponse::create($res, 201, $headers)->setSharedMaxAge(300); |