Unrequire batt_id and trade_in for change service rider api call and add or_num #153

This commit is contained in:
Kendrick Chan 2018-07-05 15:49:22 +08:00
parent 052f3dfe62
commit 584652d31d

View file

@ -668,7 +668,7 @@ class RAPIController extends Controller
{
// allow rider to change service, promo, battery and trade-in options
$em = $this->getDoctrine()->getManager();
$required_params = ['jo_id', 'stype_id', 'promo_id', 'batt_id', 'trade_in'];
$required_params = ['jo_id', 'stype_id', 'promo_id'];
$res = $this->checkJO($req, $required_params, $jo);
if ($res->isError())
return $res->getReturnResponse();
@ -698,10 +698,15 @@ class RAPIController extends Controller
}
}
// check or number
$or_num = $req->request->get('or_num');
if ($or_num != null)
$jo->setORNum($or_num);
// check battery id
$batt_id = $req->request->get('batt_id');
// no battery
if ($batt_id == 0)
if ($batt_id == 0 || $batt_id == null)
$battery = null;
else
{