/var/www/vhosts/nabawater/backend/controllers
Edit: /var/www/vhosts/nabawater/backend/controllers/BranchReviewController.php (2209B)
render('index', [
'searchModel' => $searchModel,
'dataProvider' => $searchModel->search(Yii::$app->request->queryParams),
'customer_name' => $customer_name,
]);
}
/**
* @return Json
* @throws \yii\base\InvalidParamException
*
* @Title("Review Status")
*/
public function actionGetReviewStatus()
{
$params = ['id', 'key'];
$post = Yii::$app->getRequest()->post();
$result = ['status' => STATUS_FAIL, 'msg' => ''];
foreach ($params as $param) {
if (!array_key_exists($param, $post)) {
$result['msg'] = 'Required param missing';
goto skip;
}
}
$model = BranchReview::findOne(['branch_review_key' => $post['key']]);
if ($model === null) {
$result['msg'] = 'Unable to find the Review and Rating Details ';
goto skip;
} else {
$model->status = $post['id'];
}
$model->save(false);
$result['msg'] = 'Review Status Changed Successfully';
$result['status'] = STATUS_SUCCESS;
skip:
return $this->asJson($result);
}
/**
* @return Json
* @throws \yii\base\InvalidParamException
*
* @Title("view")
*/
public function actionView($id)
{
$model = BranchReview::findOne(['branch_review_key' => $id]);
return $this->render('view', [
'model' => $model
]);
}
}