Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
loveisland
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
刘小敏
loveisland
Commits
6da1f63c
Commit
6da1f63c
authored
Jul 07, 2026
by
刘小敏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
注销的账号手机号可以重新绑定新账号;精简shareadd日志;注销禁用启用用户关联代理商分销商;所有商品默认参与分销;分销商代理商状态改为只能看不能改,口子统一收到用户禁用那里;
parent
6dc0d7c7
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
53 additions
and
28 deletions
+53
-28
Share.php
addons/shopro/controller/Share.php
+0
-4
Wechat.php
addons/shopro/controller/third/Wechat.php
+10
-0
UserAuth.php
addons/shopro/service/user/UserAuth.php
+8
-0
Wechat.php
addons/shopro/validate/third/Wechat.php
+2
-2
Goods.php
application/admin/controller/shopro/goods/Goods.php
+8
-0
User.php
application/admin/controller/shopro/user/User.php
+18
-0
index.html
application/admin/view/shopro/agent/agent/index.html
+2
-2
detail.html
application/admin/view/shopro/commission/agent/detail.html
+5
-20
No files found.
addons/shopro/controller/Share.php
View file @
6da1f63c
...
...
@@ -13,13 +13,10 @@ class Share extends Common
public
function
add
()
{
custom_log
(
'[share.add] 收到分享记录请求, method='
.
$this
->
request
->
method
(),
0
,
'share'
);
if
(
!
$this
->
request
->
isPost
())
{
custom_log
(
'[share.add] 请求方法错误,非POST请求'
,
0
,
'share'
,
'error'
);
$this
->
error
(
''
);
}
custom_log
(
'[share.add] 请求方法校验通过 (POST)'
,
0
,
'share'
);
$params
=
$this
->
request
->
only
([
'shareId'
,
'spm'
,
'page'
,
'query'
,
'from'
,
'platform'
]);
custom_log
(
'[share.add] 解析请求参数: '
.
json_encode
(
$params
,
JSON_UNESCAPED_UNICODE
),
0
,
'share'
);
...
...
@@ -36,7 +33,6 @@ class Share extends Common
custom_log
(
'[share.add] 分享记录写入失败(返回false/空,可能原因: spm为空/shareId无效/自己点自己/5分钟内重复/sharing不存在)'
,
$userId
,
'share'
,
'warning'
);
}
custom_log
(
'[share.add] 返回成功响应'
,
$userId
,
'share'
);
$this
->
success
(
""
);
}
...
...
addons/shopro/controller/third/Wechat.php
View file @
6da1f63c
...
...
@@ -84,6 +84,16 @@ class Wechat extends Common
$this
->
svalidate
([
'mobile'
=>
$mobile
],
'.bindWechatMiniProgramMobile'
);
// 检查手机号是否已被未删除的账号绑定(deletetime IS NULL 表示有效账号)
$existUser
=
Db
::
table
(
'fa_user'
)
->
where
(
'mobile'
,
$mobile
)
->
where
(
'id'
,
'<>'
,
$user
->
id
)
->
whereNull
(
'deletetime'
)
->
find
();
if
(
$existUser
)
{
error_stop
(
'手机号已被占用'
);
}
$user
->
mobile
=
$mobile
;
$verification
=
$user
->
verification
;
$verification
->
mobile
=
1
;
...
...
addons/shopro/service/user/UserAuth.php
View file @
6da1f63c
...
...
@@ -3,6 +3,7 @@
namespace
addons\shopro\service\user
;
use
fast\Random
;
use
think\Db
;
use
app\common\library\Auth
;
use
app\admin\model\shopro\user\User
as
UserModel
;
...
...
@@ -215,8 +216,15 @@ class UserAuth
{
$user
=
auth_user
();
$user
=
UserModel
::
get
(
$user
->
id
);
$oldStatus
=
$user
->
status
;
$user
->
isUpdate
(
true
,[
'user_id'
=>
$user
->
id
])
->
save
([
'status'
=>
'disabled'
]);
custom_log
(
"用户自行注销: user_id=
{
$user
->
id
}
,
{
$oldStatus
}
-> disabled"
,
$user
->
id
,
'user_status_change'
,
'info'
);
// 注销用户时,代理和分销商状态设置为禁用
Db
::
table
(
'fa_shopro_agent'
)
->
where
(
'user_id'
,
$user
->
id
)
->
update
([
'status'
=>
'forbidden'
]);
Db
::
table
(
'fa_shopro_commission_agent'
)
->
where
(
'user_id'
,
$user
->
id
)
->
update
([
'status'
=>
'forbidden'
]);
$this
->
logout
();
}
...
...
addons/shopro/validate/third/Wechat.php
View file @
6da1f63c
...
...
@@ -12,13 +12,13 @@ class Wechat extends Validate
];
protected
$rule
=
[
'mobile'
=>
'require|regex:mobile
|unique:user
'
'mobile'
=>
'require|regex:mobile'
];
protected
$message
=
[
'mobile.require'
=>
'手机号必须填写'
,
'mobile.regex'
=>
'手机号格式不正确'
,
'mobile.unique'
=>
'手机号已被占用'
,
//
'mobile.unique' => '手机号已被占用',
];
...
...
application/admin/controller/shopro/goods/Goods.php
View file @
6da1f63c
...
...
@@ -8,6 +8,7 @@ use app\admin\model\shopro\goods\Sku as SkuModel;
use
app\admin\model\shopro\goods\SkuPrice
as
SkuPriceModel
;
use
app\admin\model\shopro\goods\StockWarning
as
StockWarningModel
;
use
app\admin\model\shopro\activity\Activity
as
ActivityModel
;
use
app\admin\model\shopro\commission\CommissionGoods
as
CommissionGoodsModel
;
use
app\admin\controller\shopro\traits\SkuPrice
as
SkuPriceTrait
;
use
addons\shopro\traits\StockWarning
as
StockWarningTrait
;
use
addons\shopro\service\goods\GoodsService
;
...
...
@@ -131,6 +132,13 @@ class Goods extends Common
$data
=
Db
::
transaction
(
function
()
use
(
$params
)
{
$this
->
model
->
save
(
$params
);
// 新增商品默认设置为分销商品,参与分销
$commissionGoods
=
new
CommissionGoodsModel
();
$commissionGoods
->
save
([
'goods_id'
=>
$this
->
model
->
id
,
'status'
=>
1
,
]);
$this
->
editSku
(
$this
->
model
,
'add'
);
});
$this
->
success
(
'保存成功'
,
null
,
$data
);
...
...
application/admin/controller/shopro/user/User.php
View file @
6da1f63c
...
...
@@ -78,13 +78,27 @@ class User extends Common
unset
(
$params
[
'id'
]);
$user
=
$this
->
model
->
where
(
'id'
,
$id
)
->
find
();
$oldStatus
=
$user
->
status
;
$user
->
save
(
$params
);
// 用户状态变更时同步更新代理商和分销商状态,并记录日志
if
(
isset
(
$params
[
'status'
])
&&
$params
[
'status'
]
!==
$oldStatus
)
{
custom_log
(
"用户状态变更: user_id=
{
$id
}
,
{
$oldStatus
}
->
{
$params
[
'status'
]
}
"
,
$id
,
'user_status_change'
,
'info'
);
$agentStatus
=
$params
[
'status'
]
===
'disabled'
?
'freeze'
:
(
$params
[
'status'
]
===
'normal'
?
'normal'
:
null
);
if
(
$agentStatus
)
{
Db
::
table
(
'fa_shopro_agent'
)
->
where
(
'user_id'
,
$id
)
->
where
(
'status'
,
'<>'
,
$agentStatus
)
->
update
([
'status'
=>
$agentStatus
]);
Db
::
table
(
'fa_shopro_commission_agent'
)
->
where
(
'user_id'
,
$id
)
->
where
(
'status'
,
'<>'
,
$agentStatus
)
->
update
([
'status'
=>
$agentStatus
]);
}
}
$this
->
success
(
'更新成功'
,
null
,
$user
);
}
/**
* 删除用户(支持批量)
* 管理后台-会员管理-删除
* 删除功能已经被隐藏,此方法应该用不到了 - 2026.07.06
*
* @param $id
* @return \think\Response
...
...
@@ -104,6 +118,10 @@ class User extends Common
foreach
(
$list
as
$item
)
{
// $count += $item->delete(); // 物理删除,UserModel添加了软删除
$count
+=
$item
->
save
([
'status'
=>
'disabled'
]);
// 改成逻辑删除,状态改为"禁用"
// 批量禁用时同步更新代理商和分销商状态为冻结
Db
::
table
(
'fa_shopro_agent'
)
->
where
(
'user_id'
,
$item
->
id
)
->
where
(
'status'
,
'<>'
,
'freeze'
)
->
update
([
'status'
=>
'freeze'
]);
Db
::
table
(
'fa_shopro_commission_agent'
)
->
where
(
'user_id'
,
$item
->
id
)
->
where
(
'status'
,
'<>'
,
'freeze'
)
->
update
([
'status'
=>
'freeze'
]);
}
return
$count
;
...
...
application/admin/view/shopro/agent/agent/index.html
View file @
6da1f63c
...
...
@@ -25,9 +25,9 @@
<div
class=
"dropdown btn-group {:$auth->check('shopro/agent/agent/multi')?'':'hide'}"
>
<a
class=
"btn btn-primary btn-more dropdown-toggle btn-disabled disabled"
data-toggle=
"dropdown"
><i
class=
"fa fa-cog"
></i>
{:__('More')}
</a>
<ul
class=
"dropdown-menu text-left"
role=
"menu"
>
{foreach name="statusList" item="vo"}
<!--
{foreach name="statusList" item="vo"}
<li><a class="btn btn-link btn-multi btn-disabled disabled" href="javascript:" data-params="status={$key}">{:__('Set status to ' . $key)}</a></li>
{/foreach}
{/foreach}
-->
<li
role=
"separator"
class=
"divider"
></li>
<li><a
class=
"btn btn-link btn-commission-rate btn-disabled disabled"
href=
"javascript:"
><i
class=
"fa fa-percent"
></i>
{:__('Batch_commission_rate')}
</a></li>
</ul>
...
...
application/admin/view/shopro/commission/agent/detail.html
View file @
6da1f63c
...
...
@@ -161,26 +161,11 @@
</div>
<el-form
size=
"small"
label-position=
"right"
label-width=
"76px"
>
<el-form-item
label=
"分销商状态:"
>
<el-dropdown
popper-class=
"agent-popover"
trigger=
"click"
@
command=
"onChangeStatus"
>
<span
class=
"status"
:style=
"{
color: statusStyle[state.data.status]?.color,
}"
>
{{ state.data.status_text }}
<el-icon>
<arrow-down
/>
</el-icon>
</span>
<template
#
dropdown
>
{if $auth->check('shopro/commission/agent/edit')}
<el-dropdown-menu>
<el-dropdown-item
class=
"status"
:style=
"{
color: value.color,
}"
v-for=
"(value, key) in statusStyle"
:key=
"key"
:command=
"key"
>
{{ value.label }}
</el-dropdown-item>
</el-dropdown-menu>
{/if}
</template>
</el-dropdown>
<span
class=
"status"
:style=
"{
color: statusStyle[state.data.status]?.color,
}"
>
{{ state.data.status_text }}
</span>
</el-form-item>
<el-form-item
label=
"分销等级:"
>
<template
v-if=
"state.data.level_info"
>
...
...
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