Resolve "Add comment field to rider rating" #918
2 changed files with 23 additions and 0 deletions
|
|
@ -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();
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue