Fix the query for mobile policy in updateInfo. #239
This commit is contained in:
parent
bf0cf17962
commit
580f79b6ef
1 changed files with 8 additions and 5 deletions
|
|
@ -402,14 +402,17 @@ class APIController extends Controller
|
||||||
$cust->setPhoneMobile(substr($this->session->getPhoneNumber(), 2));
|
$cust->setPhoneMobile(substr($this->session->getPhoneNumber(), 2));
|
||||||
|
|
||||||
// get privacy policy for mobile
|
// get privacy policy for mobile
|
||||||
$policy = $em->createQuery('SELECT policy FROM App\Entity\PrivacyPolicy policy WHERE policy.name LIKE :policy_type')
|
$dotenv = new Dotenv();
|
||||||
->setParameter('policy_type', "%" . "mobile" . "%")
|
$dotenv->loadEnv(__DIR__.'/../../.env');
|
||||||
->getOneOrNullResult();
|
|
||||||
|
$policy_mobile_id = $_ENV['POLICY_MOBILE'];
|
||||||
|
|
||||||
|
$mobile_policy = $em->getRepository(PrivacyPolicy::class)->find($policy_mobile_id);
|
||||||
|
|
||||||
// set policy id
|
// set policy id
|
||||||
if ($policy != null)
|
if ($mobile_policy != null)
|
||||||
{
|
{
|
||||||
$cust->setPrivacyPolicyMobile($policy);
|
$cust->setPrivacyPolicyMobile($mobile_policy);
|
||||||
}
|
}
|
||||||
|
|
||||||
$em->flush();
|
$em->flush();
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue