Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
meibuyu-micro
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
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
without authentication
meibuyu-micro
Commits
2e734f1e
Commit
2e734f1e
authored
Feb 21, 2022
by
Liu lu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
兼容前缀
parent
7574a3c7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
BaseModel.php
src/Model/BaseModel.php
+2
-2
No files found.
src/Model/BaseModel.php
View file @
2e734f1e
...
@@ -74,7 +74,7 @@ abstract class BaseModel extends Model
...
@@ -74,7 +74,7 @@ abstract class BaseModel extends Model
$where_str
=
implode
(
','
,
$where_arr
);
$where_str
=
implode
(
','
,
$where_arr
);
$sql
=
""
;
$sql
=
""
;
if
(
$keys_str
&&
$datas_str
&&
$where_str
)
{
if
(
$keys_str
&&
$datas_str
&&
$where_str
)
{
$table
=
$this
->
getTable
();
$table
=
env
(
'DB_PREFIX'
,
''
)
.
$this
->
getTable
();
$sql
=
" INSERT INTO
$table
(
$keys_str
) VALUES
$datas_str
ON DUPLICATE KEY UPDATE
$where_str
"
;
$sql
=
" INSERT INTO
$table
(
$keys_str
) VALUES
$datas_str
ON DUPLICATE KEY UPDATE
$where_str
"
;
}
}
unset
(
$keys_str
,
$where_str
);
unset
(
$keys_str
,
$where_str
);
...
@@ -125,7 +125,7 @@ abstract class BaseModel extends Model
...
@@ -125,7 +125,7 @@ abstract class BaseModel extends Model
$sql
=
sprintf
(
$sql
=
sprintf
(
"UPDATE `%s` SET %s WHERE `%s` IN (%s) "
,
"UPDATE `%s` SET %s WHERE `%s` IN (%s) "
,
$this
->
getTable
(),
$updates
,
$field
,
$fields
env
(
'DB_PREFIX'
,
''
)
.
$this
->
getTable
(),
$updates
,
$field
,
$fields
);
);
return
$this
->
getConnection
()
->
update
(
$sql
);
return
$this
->
getConnection
()
->
update
(
$sql
);
...
...
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