Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
tl_estate
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
hujun
tl_estate
Commits
181131f7
Commit
181131f7
authored
Feb 06, 2018
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
标签
parent
d5f7dbbe
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
77 additions
and
0 deletions
+77
-0
Label.php
application/index/controller/Label.php
+66
-0
GLabels.php
application/model/GLabels.php
+9
-0
route.php
application/route.php
+2
-0
No files found.
application/index/controller/Label.php
0 → 100644
View file @
181131f7
<?php
/**
* Created by PhpStorm.
* User: fuju
* Date: 2018/2/6
* Time: 15:03
*/
namespace
app\index\controller
;
use
app\index\extend\Basic
;
use
app\model\GLabels
;
use
think\Session
;
class
Label
extends
Basic
{
/**
* 添加标签
*
* @return \think\Response|\think\response\View
*/
public
function
index
(){
$result
[
'code'
]
=
200
;
$result
[
'msg'
]
=
''
;
if
(
$this
->
request
->
isPost
())
{
if
(
$this
->
params
[
'name'
])
{
$labels
=
new
GLabels
();
$data
[
'name'
]
=
$this
->
params
[
'name'
];
$data
[
'operation_id'
]
=
Session
::
get
(
'userId'
);
$data
[
'create_time'
]
=
date
(
'Y-m-d H:i:s'
);
if
(
$this
->
params
[
'id'
])
{
$result
[
'data'
]
=
$labels
->
save
(
$data
,
[
'id'
=>
$this
->
params
[
'id'
]]);
}
else
{
$result
[
'data'
]
=
$labels
->
save
(
$data
);
}
}
else
{
$result
[
'code'
]
=
101
;
$result
[
'msg'
]
=
'name is null'
;
}
$return
=
$this
->
response
(
$result
[
'code'
],
$result
[
'msg'
],
$result
[
'data'
]);
}
else
{
//商铺添加页面
$return
=
view
(
'index'
);
}
return
$return
;
}
public
function
getLabelsList
()
{
$result
[
'code'
]
=
200
;
$result
[
'msg'
]
=
''
;
$pageNo
=
empty
(
$this
->
params
[
'pageNo'
])
?
1
:
$this
->
params
[
'pageNo'
];
$pageSize
=
empty
(
$this
->
params
[
'pageSize'
])
?
10
:
$this
->
params
[
'pageSize'
];
$labels
=
new
GLabels
();
$field
=
'*'
;
$where
=
''
;
$result
[
'data'
]
=
$labels
->
getList
(
$pageNo
,
$pageSize
,
'id DESC'
,
$field
,
$where
);
return
$this
->
response
(
$result
[
'code'
],
$result
[
'msg'
],
$result
[
'data'
]);
}
}
\ No newline at end of file
application/model/GLabels.php
0 → 100644
View file @
181131f7
<?php
namespace
app\model
;
class
GLabels
extends
BaseModel
{
}
application/route.php
View file @
181131f7
...
...
@@ -132,6 +132,8 @@ Route::group('index', [
'addStore'
=>
[
'index/Store/addStore'
,[
'method'
=>
'get|post'
]],
//添加门店
'getStoreById'
=>
[
'index/Store/getStoreById'
,[
'method'
=>
'get'
]],
//通过id获得门店信息
'getDistrictStoreList'
=>
[
'index/Store/getStoreByDistrictId'
,[
'method'
=>
'get'
]],
//通过部门id获得门店列表
'labelEdit'
=>
[
'index/label/index'
,[
'method'
=>
'get|post'
]],
//编辑标签
'getLabelsList'
=>
[
'index/label/getLabelsList'
,[
'method'
=>
'get'
]],
//标签列表
]);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment