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
a69e5d0d
Commit
a69e5d0d
authored
Apr 19, 2019
by
clone
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
de8f7732
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
6 deletions
+12
-6
FindShop.php
application/api/controller/FindShop.php
+9
-3
UFindShop.php
application/model/UFindShop.php
+3
-3
No files found.
application/api/controller/FindShop.php
View file @
a69e5d0d
...
...
@@ -72,13 +72,19 @@ class FindShop extends Basic
"update_time"
=>
date
(
"Y-m-d H:i:s"
,
time
()),
);
//修改数据
$findShopModel
=
new
UFindShop
();
if
(
!
empty
(
$params
[
"id"
])
&&
$params
[
"id"
]
>
0
)
{
$updateParams
[
"id"
]
=
$params
[
"id"
];
$where_
[
"id"
]
=
$params
[
"id"
];
$id
=
$findShopModel
->
updateFindShop
(
$where_
,
$updateParams
);
}
else
{
//新增数据
$updateParams
[
"create_time"
]
=
date
(
"Y-m-d H:i:s"
,
time
());
}
$findShopModel
=
new
UFindShop
();
$id
=
$findShopModel
->
addFindShop
(
$updateParams
);
}
if
(
$params
[
"id"
])
{
}
if
(
$id
>
0
)
{
return
$this
->
response
(
"200"
,
"数据保存成功"
,
[
"id"
=>
$id
]);
}
else
{
...
...
application/model/UFindShop.php
View file @
a69e5d0d
...
...
@@ -56,9 +56,9 @@ class UFindShop extends Model{
{
Db
::
startTrans
();
try
{
$
this
->
db_
->
insert
(
$params
);
$
id
=
$this
->
db_
->
insertGetId
(
$params
);
Db
::
commit
();
return
1
;
return
$id
;
}
catch
(
\Exception
$e
)
{
Db
::
rollback
();
return
0
;
...
...
@@ -76,7 +76,7 @@ class UFindShop extends Model{
try
{
$this
->
db_
->
where
(
$where
)
->
update
(
$params
);
Db
::
commit
();
return
1
;
return
$where
[
"id"
]
;
}
catch
(
\Exception
$e
)
{
Db
::
rollback
();
return
0
;
...
...
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