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
21dd5358
Commit
21dd5358
authored
Jul 07, 2026
by
刘小敏
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev'
parents
b1104a58
6da1f63c
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
85 additions
and
32 deletions
+85
-32
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
Order.php
application/admin/controller/shopro/order/Order.php
+11
-3
User.php
application/admin/controller/shopro/user/User.php
+18
-0
OrderItem.php
application/admin/model/shopro/order/OrderItem.php
+6
-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
add.html
application/admin/view/shopro/goods/goods/add.html
+5
-1
detail.html
application/admin/view/shopro/order/order/detail.html
+10
-0
No files found.
addons/shopro/controller/Share.php
View file @
21dd5358
...
...
@@ -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 @
21dd5358
...
...
@@ -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 @
21dd5358
...
...
@@ -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 @
21dd5358
...
...
@@ -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 @
21dd5358
...
...
@@ -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/order/Order.php
View file @
21dd5358
...
...
@@ -151,7 +151,9 @@ class Order extends Common
// 更新包裹信息(5分钟缓存)
(
new
ExpressLib
)
->
updateOrderExpress
(
$id
);
$order
=
$this
->
model
->
withTrashed
()
->
with
([
'user'
,
'items'
,
'address'
,
'activity_orders'
,
'pays'
,
'invoice'
])
->
where
(
'id'
,
$id
)
->
find
();
$order
=
$this
->
model
->
withTrashed
()
->
with
([
'user'
,
'items'
=>
function
(
$query
)
{
$query
->
with
([
'skuPrice'
]);
},
'address'
,
'activity_orders'
,
'pays'
,
'invoice'
])
->
where
(
'id'
,
$id
)
->
find
();
if
(
!
$order
)
{
$this
->
error
(
__
(
'No Results were found'
));
}
...
...
@@ -726,8 +728,11 @@ class Order extends Common
// 订单商品表字段
'activity_type_text'
=>
'活动'
,
'promo_types'
=>
'促销'
,
'promo_types'
=>
'促销'
,
'goods_id'
=>
'商品ID'
,
'goods_title'
=>
'商品名称'
,
'goods_sn'
=>
'商品规格编号'
,
'goods_sku_price_id'
=>
'商品规格ID'
,
'goods_sku_text'
=>
'商品规格'
,
'goods_num'
=>
'购买数量'
,
'goods_original_price'
=>
'商品原价'
,
...
...
@@ -768,7 +773,7 @@ class Order extends Common
$total_score_amount
=
0
;
$result
=
$export
->
export
(
$params
,
function
(
$pages
)
use
(
&
$total_order_amount
,
&
$total_pay_fee
,
&
$total_real_pay_fee
,
&
$total_discount_fee
,
&
$total_score_amount
,
$total
)
{
$datas
=
$this
->
model
->
withTrashed
()
->
sheepFilter
()
->
with
([
'user'
,
'items'
=>
function
(
$query
)
{
$query
->
with
([
'express'
]);
$query
->
with
([
'express'
,
'skuPrice'
]);
},
'address'
])
->
limit
(((
$pages
[
'page'
]
-
1
)
*
$pages
[
'list_rows'
]),
$pages
[
'list_rows'
])
->
select
();
...
...
@@ -820,7 +825,10 @@ class Order extends Common
$items
[]
=
[
'activity_type_text'
=>
$item
[
'activity_type_text'
],
'promo_types_text'
=>
is_array
(
$item
[
'promo_types_text'
])
?
join
(
','
,
$item
[
'promo_types_text'
])
:
(
$item
[
'promo_types_text'
]
?:
'-'
),
'goods_id'
=>
$item
[
'sku_price'
]
?
$item
[
'sku_price'
][
'goods_id'
]
:
'-'
,
'goods_title'
=>
$item
[
'goods_title'
],
'goods_sn'
=>
$item
[
'sku_price'
]
?
$item
[
'sku_price'
][
'sn'
]
:
'-'
,
'goods_sku_price_id'
=>
$item
[
'goods_sku_price_id'
]
?:
'-'
,
'goods_sku_text'
=>
$item
[
'goods_sku_text'
],
'goods_num'
=>
$item
[
'goods_num'
],
'goods_original_price'
=>
$item
[
'goods_original_price'
],
...
...
application/admin/controller/shopro/user/User.php
View file @
21dd5358
...
...
@@ -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/model/shopro/order/OrderItem.php
View file @
21dd5358
...
...
@@ -6,6 +6,7 @@ use app\admin\model\shopro\Common;
use
app\admin\model\shopro\order\traits\OrderItemStatus
;
use
app\admin\model\shopro\activity\Activity
;
use
app\admin\model\shopro\user\User
;
use
app\admin\model\shopro\goods\SkuPrice
;
class
OrderItem
extends
Common
{
...
...
@@ -224,4 +225,9 @@ class OrderItem extends Common
{
return
$this
->
belongsTo
(
User
::
class
,
'user_id'
);
}
public
function
skuPrice
()
{
return
$this
->
belongsTo
(
SkuPrice
::
class
,
'goods_sku_price_id'
);
}
}
application/admin/view/shopro/agent/agent/index.html
View file @
21dd5358
...
...
@@ -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 @
21dd5358
...
...
@@ -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"
>
...
...
application/admin/view/shopro/goods/goods/add.html
View file @
21dd5358
...
...
@@ -480,6 +480,7 @@
<table
class=
"sku-table"
rules=
"all"
>
<thead>
<tr>
<th>
商品规格ID
</th>
<template
v-for=
"(sku, skuIndex) in form.model.skus"
:key=
"skuIndex"
>
<th
v-if=
"sku.children.length"
>
{{ sku.name }}
</th>
</template>
...
...
@@ -634,11 +635,14 @@
</el-popover>
</div>
</th>
<th>
状态
</th>
<th>
状态
</th>
</tr>
</thead>
<tbody>
<tr
v-for=
"(skuPrice,i) in form.model.sku_prices"
:key=
"skuPrice.sku_key"
>
<td
class=
"sku-id"
>
<span>
{{ skuPrice.id ? skuPrice.id : '-' }}
</span>
</td>
<template
v-for=
"skuName in skuPrice.goods_sku_text"
:key=
"skuName"
>
<td>
<span
class=
"th-center"
>
{{ skuName }}
</span>
...
...
application/admin/view/shopro/order/order/detail.html
View file @
21dd5358
...
...
@@ -839,6 +839,16 @@
</div>
</template>
</el-table-column>
<el-table-column
label=
"商品规格编号"
min-width=
"120"
>
<template
#
default=
"scope"
>
{{ scope.row.sku_price ? scope.row.sku_price.sn : '-' }}
</template>
</el-table-column>
<el-table-column
label=
"商品规格ID"
min-width=
"100"
>
<template
#
default=
"scope"
>
{{ scope.row.sku_price ? scope.row.sku_price.id : '-' }}
</template>
</el-table-column>
<el-table-column
prop=
"goods_price"
label=
"单价(元)"
min-width=
"100"
>
</el-table-column>
<el-table-column
prop=
"goods_num"
label=
"数量(件)"
min-width=
"80"
></el-table-column>
...
...
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