|
@@ -81,9 +81,23 @@ class Vplatform extends Backend
|
|
|
$this->view->assign("platform_id", $platform_id);
|
|
$this->view->assign("platform_id", $platform_id);
|
|
|
return parent::edit($ids);
|
|
return parent::edit($ids);
|
|
|
}
|
|
}
|
|
|
- public function add()
|
|
|
|
|
|
|
+ public function add($vid=0,$platform_id=0)
|
|
|
{
|
|
{
|
|
|
- return parent::add();
|
|
|
|
|
|
|
+ if ($this->request->isPost()) {
|
|
|
|
|
+ $params = $this->request->post("row/a");
|
|
|
|
|
+ if ($params) {
|
|
|
|
|
+ $params['vname'] = model('videolist')->where('id', $params['vid'])->value('name');
|
|
|
|
|
+ $params['pname'] = model('platform')->where('id', $params['platform_id'])->value('name');
|
|
|
|
|
+ $result = $this->model->save($params);
|
|
|
|
|
+ if ($result === false) {
|
|
|
|
|
+ $this->error($this->model->getError());
|
|
|
|
|
+ }
|
|
|
|
|
+ $this->success();
|
|
|
|
|
+ }else{
|
|
|
|
|
+ $this->error();
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ return $this->view->fetch();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
}
|
|
}
|