Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
backend
Overview
Overview
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
亲子游项目
backend
Commits
c4ff573e
Commit
c4ff573e
authored
Dec 10, 2018
by
LiuJunYi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
地区分类
parent
e879c80f
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
4 deletions
+22
-4
application/admin/controller/Project.php
+11
-4
application/admin/controller/Region.php
+11
-0
application/admin/view/project/save.html
+0
-0
No files found.
application/admin/controller/Project.php
View file @
c4ff573e
...
...
@@ -8,13 +8,11 @@
namespace
app\admin\controller
;
use
app\admin\controller\AuthBase
;
use
app\common\model\Admin
as
AdminModel
;
use
app\admin\controller\Upload
;
use
app\common\model\Catalogs
;
use
app\common\model\Citys
;
use
app\common\model\Project
as
ProjectModel
;
use
app\common\model\Tags
;
use
app\common\model\Region
as
RegionModel
;
class
Project
extends
AuthBase
{
...
...
@@ -552,13 +550,22 @@ class Project extends AuthBase
halt
(
$project
->
getLastSql
());
}
//商家保存
public
function
save
()
{
$level_1
=
RegionModel
::
where
(
'level'
,
1
)
->
select
();
$level_1
=
collection
(
$level_1
)
->
visible
([
'id'
,
'title'
]);
if
(
input
(
'id'
))
{
$info
=
ProjectModel
::
get
(
input
(
'id'
));
$info
[
'tags_arr'
]
=
explode
(
'|'
,
trim
(
$info
->
getData
(
'tags'
),
'|'
));
$this
->
assign
(
'info'
,
$info
);
//地域选择
$level_1_arr
=
$level_1
;
$level_2_arr
=
RegionModel
::
where
(
'level'
,
2
)
->
where
(
'pid'
,
$info
[
'level_1'
])
->
select
();
$level_3_arr
=
RegionModel
::
where
(
'level'
,
3
)
->
where
(
'pid'
,
$info
[
'level_2'
])
->
select
();
$this
->
assign
(
compact
(
'level_1_arr'
,
'level_2_arr'
,
'level_3_arr'
));
}
//分类
$catalogs
=
Catalogs
::
all
();
...
...
@@ -584,7 +591,7 @@ class Project extends AuthBase
$this
->
error
(
'操作失败'
);
}
}
return
$this
->
fetch
(
''
,
compact
(
'catalogs'
,
'city'
,
'tags'
));
return
$this
->
fetch
(
''
,
compact
(
'catalogs'
,
'city'
,
'tags'
,
'level_1'
));
}
//上传图片
...
...
application/admin/controller/Region.php
View file @
c4ff573e
...
...
@@ -61,6 +61,10 @@ class Region extends AuthBase
return
json
([
'code'
=>
1
,
'msg'
=>
'删除失败'
]);
}
/**
* 修改
* @return \think\response\Json
*/
public
function
edit
()
{
if
(
request
()
->
isAjax
())
{
...
...
@@ -74,6 +78,13 @@ class Region extends AuthBase
return
json
([
'code'
=>
1
,
'msg'
=>
'访问失败'
]);
}
/**
* 查询
* @return array|\think\response\Json
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
select
()
{
if
(
input
(
'id'
)
==
0
){
...
...
application/admin/view/project/save.html
View file @
c4ff573e
This diff is collapsed.
Click to expand it.
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