Create query for last fulfilled job order for rider status api call #162

This commit is contained in:
Kendrick Chan 2018-08-13 04:13:50 +08:00
parent 0a476f245a
commit 1a44d28290
2 changed files with 10 additions and 3 deletions

View file

@ -1095,8 +1095,15 @@ class APIController extends Controller
]);
if (count($ongoing_jos) <= 0)
{
// TODO: check if the latest jo they have needs rider rating
// $query = $em->createQuery('select
error_log('No pending jo');
// check if the latest fulfilled jo they have needs rider rating
$query = $em->createQuery('select jo from JobOrder where jo.customer = :cust and jo.status = ' . JOStatus::FULFILLED . ' order by jo.date_fulfill desc');
$fulfill_jos = $query->setParameters([
'cust' => $cust
])
->setMaxResults(1)
->getResult();
// no pending
$res->setData([

View file

@ -700,7 +700,7 @@ class JobOrder
return $this;
}
public function HasRiderRating()
public function hasRiderRating()
{
if ($this->flag_rider_rating == null)
return false;