Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
doc_phone
Project
Project
Details
Activity
Releases
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
jiangyipeng
doc_phone
Commits
48e78d4b
Commit
48e78d4b
authored
May 25, 2020
by
huanle
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
0525 2:12
parent
1c7f4818
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
21 deletions
+22
-21
Doclist.php
application/api/model/Doclist.php
+22
-21
No files found.
application/api/model/Doclist.php
View file @
48e78d4b
...
...
@@ -9,26 +9,26 @@ class Doclist extends Model
{
public
function
index
()
{
$user
=
Db
::
name
(
'folder'
)
->
where
(
'state'
,
'='
,
-
1
)
->
find
();
return
$user
;
//
$user = Db::name('folder')->where('state', '=', -1)->find();
//
return $user;
// $sql = Db::name('folder')->getLastSql();
//// var_dump($sql);
}
//获取文件夹名称
public
function
articleList
(
$folderid
,
$origin
,
$pagenum
)
public
function
articleList
(
$folderid
,
$origin
,
$pagenum
)
{
if
(
$folderid
)
{
$where
[
'folderid'
]
=
array
(
'='
,
$folderid
);
$where
[
'state'
]
=
array
(
'='
,
0
);
$articlelist
=
Db
::
name
(
'doclist'
)
->
field
(
'docid,title,type,updatetime'
)
->
where
(
$where
)
->
order
(
'createtime'
)
->
limit
(
$origin
,
$pagenum
)
->
select
();
$sql
=
Db
::
name
(
'doclist'
)
->
getLastSql
();
var_dump
(
$sql
);
if
(
$folderid
)
{
$where
[
'folderid'
]
=
array
(
'='
,
$folderid
);
$where
[
'state'
]
=
array
(
'='
,
0
);
$articlelist
=
Db
::
name
(
'doclist'
)
->
field
(
'docid,title,type,updatetime'
)
->
where
(
$where
)
->
order
(
'createtime'
)
->
limit
(
$origin
,
$pagenum
)
->
select
();
//
$sql = Db::name('doclist')->getLastSql();
//
var_dump($sql);
}
else
{
$articlelist
=
[];
}
else
{
$articlelist
=
[];
}
return
$articlelist
;
...
...
@@ -37,13 +37,14 @@ class Doclist extends Model
public
function
articleDetail
(
$docid
)
{
if
(
$docid
)
{
if
(
$docid
)
{
$where
=
[
'docid'
=>
$docid
];
$articldetail
=
Db
::
name
(
'doclist'
)
->
field
(
'docid,title,type,updatetime,doc'
)
->
where
(
$where
)
->
find
();
return
$articldetail
;
}
}
public
function
addArticle
(
$title
,
$folderid
,
$type
,
$doc
)
public
function
addArticle
(
$title
,
$folderid
,
$type
,
$doc
)
{
$docid
=
randomkeys
(
18
);
...
...
@@ -54,8 +55,8 @@ class Doclist extends Model
$rs
=
new
Doclist
();
if
(
$docname
==
0
)
{
$data
=
[
'docid'
=>
$docid
,
'title'
=>
$title
,
'docid'
=>
$docid
,
'title'
=>
$title
,
'type'
=>
$type
,
'doc'
=>
$doc
,
'folderid'
=>
$folderid
,
...
...
@@ -70,7 +71,8 @@ class Doclist extends Model
}
public
function
editArticle
(
$title
,
$folderid
,
$doc
,
$docid
)
public
function
editArticle
(
$title
,
$folderid
,
$doc
,
$docid
)
{
$rs
=
new
Doclist
();
...
...
@@ -78,14 +80,14 @@ class Doclist extends Model
$where
=
[];
$data
=
[
'title'
=>
$title
,
'doc'
=>
$doc
,
'doc'
=>
$doc
,
'updatetime'
=>
date
(
"Y-m-d H:i:s"
,
time
()),
];
if
(
$docid
)
{
$where
[
'docid'
]
=
array
(
'='
,
$docid
);
$where
[
'folderid'
]
=
array
(
'='
,
$folderid
);
$where
[
'docid'
]
=
array
(
'='
,
$docid
);
$where
[
'folderid'
]
=
array
(
'='
,
$folderid
);
}
$rs
=
$this
->
where
(
$where
)
->
update
(
$data
);
...
...
@@ -96,7 +98,6 @@ class Doclist extends Model
}
// var_dump($rs);die();
// $sql = Db::name('folder')->getLastSql();
// var_dump($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