public function actionSetCompanyBrand() { $status = 'OK'; $data = Yii::$app->request->post(); $cmid = $data['cmid']; $sbid = $data['sbid']; $state = $data['state']; $cb = new CompanyBrands(); $ok = $cb->setCompanyBrand($cmid, $sbid, $state); if (!$ok) { $status = 'ERROR'; } Yii::$app->response->format = \yii\web\Response::FORMAT_JSON; $responce = ['status' => $status]; return $responce; }
public function getCompanyBrands() { return $this->hasMany(CompanyBrands::className(), ['company_id' => 'id']); }