public function actionSetCompanyService() { $status = 'OK'; $data = Yii::$app->request->post(); $cmid = $data['cmid']; $sbid = $data['sbid']; $state = $data['state']; $cs = new CompanyServices(); $err = $cs->setCompanyService($cmid, $sbid, $state); if (!$err) { $status = 'ERROR'; } Yii::$app->response->format = \yii\web\Response::FORMAT_JSON; $responce = ['status' => $status]; return $responce; }
public function getCompanyServices() { return $this->hasMany(CompanyServices::className(), ['company_id' => 'id']); }