diff --git a/frontend/controllers/CompanyController.php b/frontend/controllers/CompanyController.php index 6f33380..0e2e63d 100755 --- a/frontend/controllers/CompanyController.php +++ b/frontend/controllers/CompanyController.php @@ -39,6 +39,19 @@ $company_id = $action->controller->actionParams[ 'company_id' ]; $user = User::findOne($company_id); if(!empty( $user->userInfo )) { + if($user->userInfo->is_freelancer xor $user->userInfo->is_customer) { + $type = $action->controller->actionParams['type']; + $get = \Yii::$app->request->get(); + if(!empty($type)) { + if($user->userInfo->is_freelancer && $type == 'customer') { + $get['type'] = 'implementer'; + $this->redirect(array_merge([$action->id], $get)); + } elseif($user->userInfo->is_customer && $type == 'implementer') { + $get['type'] = 'customer'; + $this->redirect(array_merge([$action->id], $get)); + } + } + } $user->userInfo->updateCounters([ 'view_count' => 1 ]); } } diff --git a/frontend/controllers/PerformerController.php b/frontend/controllers/PerformerController.php index b19016c..b514097 100755 --- a/frontend/controllers/PerformerController.php +++ b/frontend/controllers/PerformerController.php @@ -37,6 +37,19 @@ $performer_id = $action->controller->actionParams[ 'performer_id' ]; $user = User::findOne($performer_id); if(!empty( $user->userInfo )) { + if($user->userInfo->is_freelancer xor $user->userInfo->is_customer) { + $type = $action->controller->actionParams['type']; + $get = \Yii::$app->request->get(); + if(!empty($type)) { + if($user->userInfo->is_freelancer && $type == 'customer') { + $get['type'] = 'implementer'; + $this->redirect(array_merge([$action->id], $get)); + } elseif($user->userInfo->is_customer && $type == 'implementer') { + $get['type'] = 'customer'; + $this->redirect(array_merge([$action->id], $get)); + } + } + } $user->userInfo->updateCounters([ 'view_count' => 1 ]); } } diff --git a/frontend/views/layouts/performer.php b/frontend/views/layouts/performer.php index 3975b94..61e70f2 100755 --- a/frontend/views/layouts/performer.php +++ b/frontend/views/layouts/performer.php @@ -139,39 +139,49 @@