public function actionDisconnect($ip) { if ($model = Charge::find()->where(['ip' => $ip])->one()) { $model->state = 'state_disconnect'; $model->save(); } $telnet = new Telnet(); $telnet->signin(); $telnet->rebind($ip, "eeee-eeee-eeee"); $telnet->close(); return $this->redirect(['index']); }
public function getCharge() { return $this->hasOne(Charge::className(), ['ip' => 'ip']); }