Commit 0e3f98c0 authored by hujun's avatar hujun

获取单个标签

parent 44de8b2e
...@@ -24,11 +24,9 @@ class Label extends Basic ...@@ -24,11 +24,9 @@ class Label extends Basic
public function index(){ public function index(){
$result['code'] = 200; $result['code'] = 200;
$result['msg'] = ''; $result['msg'] = '';
$labels = new GLabels();
if ($this->request->isPost()) { if ($this->request->isPost()) {
if ($this->params['name']) { if ($this->params['name']) {
$labels = new GLabels();
$data['name'] = $this->params['name']; $data['name'] = $this->params['name'];
$data['operation_id'] = Session::get('userId'); $data['operation_id'] = Session::get('userId');
$data['type'] = $this->params['type']; $data['type'] = $this->params['type'];
...@@ -44,8 +42,13 @@ class Label extends Basic ...@@ -44,8 +42,13 @@ class Label extends Basic
$return = $this->response($result['code'], $result['msg'], $result['data']); $return = $this->response($result['code'], $result['msg'], $result['data']);
} else { } else {
//标签页面 if ($this->params['id']) {
$return = view('index'); $result['data'] = $labels->where('id',$this->params['id'])->find();
$return = $this->response($result['code'], $result['msg'], $result['data']);
} else {
//标签页面
$return = view('index');
}
} }
return $return; return $return;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment