WIN-2308041133\Administrator 7 months ago
parent
commit
19c542b8a3
1 changed files with 16 additions and 2 deletions
  1. 16 2
      application/admin/controller/platform/Vplatform.php

+ 16 - 2
application/admin/controller/platform/Vplatform.php

@@ -81,9 +81,23 @@ class Vplatform extends Backend
         $this->view->assign("platform_id", $platform_id);
         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();
     }
 
 }