切换导航条
此项目
正在载入...
登录
景龙
/
feipin
·
提交
转到一个项目
GitLab
转到仪表盘
项目
活动
文件
提交
管道
0
构建
0
图表
里程碑
问题
0
合并请求
0
成员
标记
维基
派生
网络
创建新的问题
下载为
邮件补丁
差异文件
浏览文件
作者
景龙
6 years ago
提交
9f0784139d190c7f99b460b42ce85f4e59fd7280
1 个父辈
99c54757
1 个管道 的构建
通过
耗费 9 秒
修改分销逻辑
变更
1
构建
1
隐藏空白字符变更
内嵌
并排对比
正在显示
1 个修改的文件
包含
11 行增加
和
12 行删除
application/api/controller/Person.php
application/api/controller/Person.php
查看文件 @
9f07841
...
...
@@ -349,23 +349,22 @@ class Person extends Api
$score
=
$scoreRule
[
'set_score'
];
}
$offlineModel
=
new
Line
();
//此处判断分享用户否已有上线,如果有,则不能成为其他的下线
$each_other
=
$offlineModel
->
where
([
'off_uid'
=>
$share_uid
])
->
select
();
//判断本登录用户是否有上线
//判断本登录用户是否有上线,如果有,则不能成为其他人的下线
$other
=
$offlineModel
->
where
([
'off_uid'
=>
$this
->
user_id
])
->
select
();
//分享人是自己无效
if
(
$share_uid
!=
$this
->
user_id
){
//分享用户有上线
if
(
$each_other
){
$on_uid
=
array_unique
(
array_column
(
$each_other
,
'uid'
))[
0
];
//给上线增加积分
//本登录用户没有上线
if
(
!
$other
){
//给分享用户增加积分
$userModel
=
new
\app\admin\model\User
();
$userModel
->
where
([
'id'
=>
$on_uid
,
'status'
=>
'normal'
])
->
setInc
(
'score'
,
$score
);
//创建上线用户的积分记录
$offlineModel
->
create
([
'uid'
=>
$on_uid
,
's_score'
=>
$score
,
'off_uid'
=>
$share_uid
,
'type'
=>
$class
]);
$userModel
->
where
([
'id'
=>
$share_uid
,
'status'
=>
'normal'
])
->
setInc
(
'score'
,
$score
);
//成为分享用户的下线并创建积分记录
$offlineModel
->
create
([
'uid'
=>
$share_uid
,
's_score'
=>
$score
,
'off_uid'
=>
$this
->
user_id
,
'type'
=>
$class
]);
}
else
{
//本登录用户没有上线
if
(
!
$other
){
//本登陆用户有上线
$is_share
=
array_unique
(
array_column
(
$other
,
'uid'
))[
0
];
//判断上线是不是原有的上线用户
if
(
$is_share
==
$share_uid
){
//给分享用户增加积分
$userModel
=
new
\app\admin\model\User
();
$userModel
->
where
([
'id'
=>
$share_uid
,
'status'
=>
'normal'
])
->
setInc
(
'score'
,
$score
);
...
...
请
注册
或
登录
后发表评论