Mark JO as rider rated when post rider rating api call is used #162

This commit is contained in:
Kendrick Chan 2018-08-13 05:01:33 +08:00
parent f47e280b37
commit fa659226bc

View file

@ -1101,8 +1101,6 @@ class APIController extends Controller
// return $res->getReturnResponse();
if (count($ongoing_jos) <= 0)
{
error_log('No pending jo');
// check if the latest fulfilled jo they have needs rider rating
$query = $em->createQuery('select jo from App\Entity\JobOrder jo where jo.customer = :cust and jo.status = :status order by jo.date_fulfill desc');
$fulfill_jo = $query->setParameters([
@ -1346,6 +1344,9 @@ class APIController extends Controller
if (!empty($comment))
$rating->setComment($comment);
// mark jo as rider rated already
$jo->setHasRiderRating();
$em->persist($rating);
$em->flush();