Create query for last fulfilled job order for rider status api call #162
This commit is contained in:
parent
0a476f245a
commit
1a44d28290
2 changed files with 10 additions and 3 deletions
|
|
@ -1095,8 +1095,15 @@ class APIController extends Controller
|
||||||
]);
|
]);
|
||||||
if (count($ongoing_jos) <= 0)
|
if (count($ongoing_jos) <= 0)
|
||||||
{
|
{
|
||||||
// TODO: check if the latest jo they have needs rider rating
|
error_log('No pending jo');
|
||||||
// $query = $em->createQuery('select
|
|
||||||
|
// 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
|
// no pending
|
||||||
$res->setData([
|
$res->setData([
|
||||||
|
|
|
||||||
|
|
@ -700,7 +700,7 @@ class JobOrder
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function HasRiderRating()
|
public function hasRiderRating()
|
||||||
{
|
{
|
||||||
if ($this->flag_rider_rating == null)
|
if ($this->flag_rider_rating == null)
|
||||||
return false;
|
return false;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue