Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Z
zhupu
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
sugar
zhupu
Commits
a90f67a8
Commit
a90f67a8
authored
Dec 04, 2023
by
LuoTianHao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改
parent
a2d68936
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
216 additions
and
4 deletions
+216
-4
.htaccess
.htaccess
+1
-0
application/api/model/EthnographyArticle.php
application/api/model/EthnographyArticle.php
+42
-0
application/api/model/FamilyTree.php
application/api/model/FamilyTree.php
+113
-0
application/api/model/FastimUser.php
application/api/model/FastimUser.php
+56
-0
application/config.php
application/config.php
+1
-1
application/database.php
application/database.php
+3
-3
nginx.htaccess
nginx.htaccess
+0
-0
No files found.
.htaccess
0 → 100644
View file @
a90f67a8
application/api/model/EthnographyArticle.php
0 → 100644
View file @
a90f67a8
<?php
namespace
app\api\model
;
use
think\Db
;
use
think\Model
;
class
EthnographyArticle
extends
Model
{
// 表名
protected
$name
=
'ethnography_article'
;
// 自动写入时间戳字段
protected
$autoWriteTimestamp
=
'integer'
;
// 定义时间戳字段名
protected
$createTime
=
'createtime'
;
protected
$updateTime
=
'updatetime'
;
protected
$deleteTime
=
false
;
// 追加属性
protected
$append
=
[
'status_text'
];
/**
* 查看我发布的族志
*/
public
static
function
getMySendByFamilyLog
(
$map
=
[],
$rows
=
15
,
$pages
=
[]){
$array
=
self
::
where
(
$map
)
->
orderRaw
(
'rand()'
)
->
paginate
(
empty
(
$rows
)
?
null
:
$rows
,
//每页显示几条记录
empty
(
$pages
[
0
])
?
false
:
$pages
[
0
],
empty
(
$pages
[
1
])
?
[
'query'
=>
input
(
'get.'
)]
:
$pages
[
1
]
);
return
$array
;
}
}
\ No newline at end of file
application/api/model/FamilyTree.php
0 → 100644
View file @
a90f67a8
<?php
namespace
app\api\model
;
use
think\Db
;
use
think\Model
;
class
FamilyTree
extends
Model
{
// 表名
protected
$name
=
'family_tree'
;
// 自动写入时间戳字段
protected
$autoWriteTimestamp
=
'int'
;
// 定义时间戳字段名
protected
$createTime
=
'createtime'
;
protected
$updateTime
=
false
;
protected
$deleteTime
=
false
;
// 追加属性
protected
$append
=
[
'sex_text'
,
'status_text'
];
public
function
getSexList
()
{
return
[
'0'
=>
__
(
'Sex 0'
),
'1'
=>
__
(
'Sex 1'
),
'2'
=>
__
(
'Sex 2'
)];
}
public
function
getSexTextAttr
(
$value
,
$data
)
{
$value
=
$value
?
$value
:
(
isset
(
$data
[
'sex'
])
?
$data
[
'sex'
]
:
''
);
$list
=
$this
->
getSexList
();
return
isset
(
$list
[
$value
])
?
$list
[
$value
]
:
''
;
}
public
function
getStatusList
()
{
return
[
'0'
=>
__
(
'Status 0'
),
'1'
=>
__
(
'Status 1'
)];
}
public
function
getStatusTextAttr
(
$value
,
$data
)
{
$value
=
$value
?
$value
:
(
isset
(
$data
[
'status'
])
?
$data
[
'status'
]
:
''
);
$list
=
$this
->
getStatusList
();
return
isset
(
$list
[
$value
])
?
$list
[
$value
]
:
''
;
}
public
function
users
()
{
return
self
::
hasOne
(
"\app\admin\model\User"
,
'id'
,
"create_user_id"
);
}
public
function
parent
()
{
return
self
::
hasOne
(
"FamilyTree"
,
'id'
,
"parent_id"
);
}
public
function
family
()
{
return
self
::
hasOne
(
"Family"
,
'id'
,
"family_id"
);
}
/**
* 贡献排行榜
* */
public
static
function
getDevoteByList
(
$rows
=
20
,
$pages
=
[])
{
// family_people
// family_tree
// family_tree_mate
$array
=
Db
::
name
(
'family_people'
)
->
alias
(
'p'
)
->
field
(
'p.id,t.family_id,p.user_id ,t.name, u.username ,u.nickname,COUNT(l.id) AS log_count, u.avatar'
)
->
join
(
'family_tree t'
,
'p.id = t.people_id AND p.user_id != ""'
)
->
join
(
'user u'
,
' p.user_id = u.id'
)
->
join
(
'worship_log l'
,
' p.user_id = u.id AND l.type = 2'
,
'left'
)
->
join
(
'fastim_user fu'
,
'p.user_id = fu.user_id '
)
->
group
(
'p.user_id'
)
->
order
(
'log_count DESC'
)
->
paginate
(
empty
(
$rows
)
?
null
:
$rows
,
//每页显示几条记录
empty
(
$pages
[
0
])
?
false
:
$pages
[
0
],
empty
(
$pages
[
1
])
?
[
'query'
=>
input
(
'get.'
)]
:
$pages
[
1
]
);
// $array = Db::name('fastim_user')
// ->alias('u')
// ->field('u.nickname ,u.avatar,u.nickname, COUNT(l.id) AS log_count')
// ->join('worship_log l','u.user_id = l.user_id AND l.type = 2','left')
// ->group('u.user_id')
// ->order('log_count DESC')
// ->paginate(
// empty($rows)?null:$rows, //每页显示几条记录
// empty($pages[0])?false:$pages[0],
// empty($pages[1])?['query'=>input('get.')]:$pages[1]
// );
return
$array
;
}
}
application/api/model/FastimUser.php
0 → 100644
View file @
a90f67a8
<?php
namespace
app\api\model
;
use
think\Db
;
use
think\Model
;
class
FastimUser
extends
Model
{
// 表名
protected
$name
=
'fastim_user'
;
public
static
$base_table
;
// 自动写入时间戳字段
protected
$autoWriteTimestamp
=
'int'
;
// 定义时间戳字段名
protected
$createTime
=
'createtime'
;
protected
$updateTime
=
false
;
protected
$deleteTime
=
false
;
// 追加属性
protected
$append
=
[
'type_text'
,
'gender_text'
,
'status_text'
];
public
function
getTypeList
()
{
return
[
'csr'
=>
__
(
'Type csr'
),
'user'
=>
__
(
'Type user'
),
'tourist'
=>
__
(
'Type tourist'
)];
}
public
function
getGenderList
()
{
return
[
'secrecy'
=>
__
(
'Gender secrecy'
),
'male'
=>
__
(
'Gender male'
),
'female'
=>
__
(
'Gender female'
)];
}
public
function
getStatusList
()
{
return
[
'0'
=>
__
(
'Status 0'
),
'1'
=>
__
(
'Status 1'
),
'2'
=>
__
(
'Status 2'
),
'3'
=>
__
(
'Status 3'
)];
}
protected
function
initialize
()
{
parent
::
initialize
();
self
::
$base_table
=
$this
->
name
;
}
}
\ No newline at end of file
application/config.php
View file @
a90f67a8
...
...
@@ -20,7 +20,7 @@ return [
// 应用调试模式
'app_debug'
=>
Env
::
get
(
'app.debug'
,
false
),
// 应用Trace
'app_trace'
=>
Env
::
get
(
'app.trace'
,
fals
e
),
'app_trace'
=>
Env
::
get
(
'app.trace'
,
tru
e
),
// 应用模式状态
'app_status'
=>
''
,
// 是否支持多模块
...
...
application/database.php
View file @
a90f67a8
...
...
@@ -18,11 +18,11 @@ return [
// 服务器地址
'hostname'
=>
Env
::
get
(
'database.hostname'
,
'127.0.0.1'
),
// 数据库名
'database'
=>
Env
::
get
(
'database.database'
,
'
fastadmin
'
),
'database'
=>
Env
::
get
(
'database.database'
,
'
zhupu
'
),
// 用户名
'username'
=>
Env
::
get
(
'database.username'
,
'root'
),
// 密码
'password'
=>
Env
::
get
(
'database.password'
,
''
),
'password'
=>
Env
::
get
(
'database.password'
,
'
SdFEp@Dt2%cqOi3e
'
),
// 端口
'hostport'
=>
Env
::
get
(
'database.hostport'
,
''
),
// 连接dsn
...
...
@@ -32,7 +32,7 @@ return [
// 数据库编码默认采用 utf8mb4
'charset'
=>
Env
::
get
(
'database.charset'
,
'utf8mb4'
),
// 数据库表前缀
'prefix'
=>
Env
::
get
(
'database.prefix'
,
'
fa
_'
),
'prefix'
=>
Env
::
get
(
'database.prefix'
,
'
zp
_'
),
// 数据库调试模式
'debug'
=>
Env
::
get
(
'database.debug'
,
false
),
// 数据库部署方式:0 集中式(单一服务器),1 分布式(主从服务器)
...
...
nginx.htaccess
0 → 100644
View file @
a90f67a8
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