Commit 0e3f98c0 authored by hujun's avatar hujun

获取单个标签

parent 44de8b2e
......@@ -24,11 +24,9 @@ class Label extends Basic
public function index(){
$result['code'] = 200;
$result['msg'] = '';
$labels = new GLabels();
if ($this->request->isPost()) {
if ($this->params['name']) {
$labels = new GLabels();
$data['name'] = $this->params['name'];
$data['operation_id'] = Session::get('userId');
$data['type'] = $this->params['type'];
......@@ -44,8 +42,13 @@ class Label extends Basic
$return = $this->response($result['code'], $result['msg'], $result['data']);
} else {
//标签页面
$return = view('index');
if ($this->params['id']) {
$result['data'] = $labels->where('id',$this->params['id'])->find();
$return = $this->response($result['code'], $result['msg'], $result['data']);
} else {
//标签页面
$return = view('index');
}
}
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