Add rider rating comment feature #120

This commit is contained in:
Kendrick Chan 2018-05-21 01:23:59 +08:00
parent 2dae812922
commit 7e53a4d6de
2 changed files with 23 additions and 0 deletions

View file

@ -1225,6 +1225,11 @@ class APIController extends Controller
->setJobOrder($jo)
->setRating($rating_num);
// rider rating comment
$comment = $req->request->get('comment');
if (!empty($comment))
$rating->setComment($comment);
$em->persist($rating);
$em->flush();

View file

@ -52,10 +52,17 @@ class RiderRating
*/
protected $rating;
// customer's comment that goes along with the rating
/**
* @ORM\Column(type="text")
*/
protected $comment;
public function __construct()
{
$this->date_create = new DateTime();
$this->rating = 0;
$this->comment = '';
}
public function getID()
@ -111,4 +118,15 @@ class RiderRating
{
return $this->rating;
}
public function setComment($comment)
{
$this->comment = $comment;
return $this;
}
public function getComment()
{
return $this->comment;
}
}