Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
J
jwhx
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
jwhx
Commits
f1995e5d
Commit
f1995e5d
authored
Dec 31, 2024
by
董先生
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev' of
http://rungit.jxdsy.cn:10000/sugar/jwhx
into dev
parents
40b72715
46183d5f
Changes
12
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
444 additions
and
19 deletions
+444
-19
modules/Goods/app/Models/GoodsSku.php
modules/Goods/app/Models/GoodsSku.php
+1
-1
modules/Goods/app/Services/GoodsService.php
modules/Goods/app/Services/GoodsService.php
+3
-1
modules/Member/app/Services/AccountService.php
modules/Member/app/Services/AccountService.php
+1
-0
modules/Wechat/app/Controllers/Api/Notify.php
modules/Wechat/app/Controllers/Api/Notify.php
+10
-0
modules/Wechat/app/Services/NotifyService.php
modules/Wechat/app/Services/NotifyService.php
+34
-0
modules/Wechat/app/Services/TransferService.php
modules/Wechat/app/Services/TransferService.php
+8
-11
modules/Wechat/routes/api.php
modules/Wechat/routes/api.php
+2
-1
resources/admin/src/pages/cashierhome/cashierhome.scss
resources/admin/src/pages/cashierhome/cashierhome.scss
+90
-0
resources/admin/src/pages/cashierhome/cashierhome.vue
resources/admin/src/pages/cashierhome/cashierhome.vue
+272
-0
resources/admin/src/pages/member/account/index.vue
resources/admin/src/pages/member/account/index.vue
+11
-2
resources/admin/src/pages/ucenter/account/index.vue
resources/admin/src/pages/ucenter/account/index.vue
+11
-2
resources/admin/vite.config.js
resources/admin/vite.config.js
+1
-1
No files found.
modules/Goods/app/Models/GoodsSku.php
View file @
f1995e5d
...
...
@@ -13,7 +13,7 @@ use App\Models\BaseModel;
class
GoodsSku
extends
BaseModel
{
protected
$table
=
'goods_sku'
;
protected
$fillable
=
[
'goods_id'
,
'sku_value'
,
'sku'
,
'price'
,
'integral'
,
'stock'
,
'sales'
,
'cover'
,
'created_at'
,
'updated_at'
];
protected
$fillable
=
[
'goods_id'
,
'sku_value'
,
'sku'
,
'price'
,
'integral'
,
'stock'
,
'sales'
,
'cover'
,
'created_at'
,
'updated_at'
,
'goods_sn'
];
// protected $hidden = ['deleted_at'];
protected
function
casts
()
:
array
{
...
...
modules/Goods/app/Services/GoodsService.php
View file @
f1995e5d
...
...
@@ -119,7 +119,7 @@ class GoodsService {
foreach
(
$goods
->
setFilterFields
(
$request
->
all
())
as
$key
=>
$value
)
{
$goods
->
$key
=
$value
;
}
$goods
->
goods_sn
=
date
(
'YmdHis'
)
;
$goods
->
goods_sn
=
"G"
.
date
(
'YmdHis'
)
;
$goods
->
save
();
//更新栏目
...
...
@@ -131,6 +131,7 @@ class GoodsService {
foreach
(
$sku
as
$key
=>
$value
)
{
$sku
[
$key
][
'sku_value'
]
=
isset
(
$value
[
'sku_value'
])
?
$value
[
'sku_value'
]
:
Arr
::
except
(
$value
,
[
'price'
,
'stock'
,
'cover'
,
'original_price'
,
'sales'
]);
$sku
[
$key
][
'sku'
]
=
implode
(
';'
,
$value
[
'sku_value'
]);
$sku
[
$key
][
'goods_sn'
]
=
"S"
.
date
(
'YmdHis'
)
;
}
$goods
->
sku
()
->
createMany
(
$sku
);
}
...
...
@@ -176,6 +177,7 @@ class GoodsService {
foreach
(
$sku
as
$key
=>
$value
)
{
$value
[
'sku_value'
]
=
isset
(
$value
[
'sku_value'
])
?
$value
[
'sku_value'
]
:
Arr
::
except
(
$value
,
[
'price'
,
'stock'
,
'cover'
,
'original_price'
,
'sales'
]);
$value
[
'sku'
]
=
implode
(
';'
,
$value
[
'sku_value'
]);
$value
[
'goods_sn'
]
=
empty
(
$value
[
'goods_sn'
])
?
"S"
.
date
(
'YmdHi'
)
.
rand
(
1000
,
9999
)
:
$value
[
'goods_sn'
];
$goods
->
sku
()
->
updateOrCreate
([
'id'
=>
$value
[
'id'
]
??
0
],
$value
);
}
}
else
{
...
...
modules/Member/app/Services/AccountService.php
View file @
f1995e5d
...
...
@@ -289,6 +289,7 @@ class AccountService {
if
(
isset
(
$result
[
'code'
])){
throw
new
\Exception
(
'异常:'
.
$result
[
'code'
]
.
' '
.
$result
[
'message'
],
0
);
}
MemberAccount
::
where
([
'id'
=>
$account
->
id
])
->
update
([
'status'
=>
1
,
'out_batch_no'
=>
$result
]);
}
else
if
(
$account
->
pay_type
==
"bank"
){
throw
new
\Exception
(
"银行卡在开发中!"
,
0
);
}
else
{
...
...
modules/Wechat/app/Controllers/Api/Notify.php
View file @
f1995e5d
...
...
@@ -44,4 +44,14 @@ class Notify extends BaseController {
}
return
'success'
;
}
public
function
transfer
(
Request
$request
,
NotifyService
$service
){
try
{
return
$service
->
transferNotify
(
$request
);
}
catch
(
\Throwable
$th
)
{
$this
->
data
[
'message'
]
=
$th
->
getMessage
();
$this
->
data
[
'code'
]
=
0
;
}
return
'success'
;
}
}
\ No newline at end of file
modules/Wechat/app/Services/NotifyService.php
View file @
f1995e5d
...
...
@@ -9,8 +9,12 @@
namespace
Modules\Wechat\Services
;
use
Illuminate\Support\Facades\Config
;
use
Illuminate\Support\Facades\DB
;
use
Illuminate\Support\Facades\Log
;
use
Illuminate\Support\Str
;
use
EasyWeChat\Pay\Application
;
use
Modules\Member\Models\Member
;
use
Modules\Member\Models\MemberAccount
;
use
Modules\Order\Services\OrderService
;
use
Modules\Store\Services\PaymentService
;
use
Modules\Order\Services\RefundService
;
...
...
@@ -55,6 +59,36 @@ class NotifyService {
app
(
RefundService
::
class
)
->
refundSuccess
(
$message
);
});
return
$server
->
serve
();
}
public
function
transferNotify
(
$request
){
$config
=
Config
::
get
(
'wechat.miniapp'
);
$app
=
new
Application
(
$config
);
$server
=
$app
->
getServer
();
Log
::
info
(
"转账到零钱异步返回通知:"
);
// 处理退款结果事件
//DB::connection()->enableQueryLog();
$data
=
MemberAccount
::
where
([
'status'
=>
1
,
'detail_status'
=>
null
])
->
whereNotNull
(
"out_batch_no"
)
->
select
()
->
get
();
//print_r(DB::getQueryLog());
foreach
(
$data
as
$key
=>
$val
){
$result
=
TransferService
::
transferQuery
(
$val
[
'out_batch_no'
],
$val
[
'request_no'
]);
if
(
isset
(
$result
[
'code'
])
&&
!
empty
(
$result
[
'code'
])){
MemberAccount
::
where
([
'id'
=>
$val
[
'id'
]])
->
update
([
'status'
=>-
2
,
'reason'
=>
$result
[
'message'
],
'detail_status'
=>
$result
[
'fail_reason'
]]);
//提现失败金额退回
/*$user = Member::find($val['member_id']);
$user->money = bcadd($user->money, $val['amount'], 2);
$user->save();*/
}
else
{
MemberAccount
::
where
([
'id'
=>
$val
[
'id'
]])
->
update
([
'detail_status'
=>
'SUCCESS'
]);
}
}
return
$server
->
serve
();
}
}
\ No newline at end of file
modules/Wechat/app/Services/TransferService.php
View file @
f1995e5d
...
...
@@ -59,8 +59,7 @@ class TransferService
return
[
'code'
=>
$response
[
'code'
],
'message'
=>
$response
[
'message'
]];
}
return
$response
;
$out_batch_no
=
$response
->
toArray
()[
'out_batch_no'
];
return
$response
[
'out_batch_no'
];
}
//获取微信支付平台证书序列号与生成公钥文件
...
...
@@ -87,15 +86,13 @@ class TransferService
}
/**
* 查询商家转账到零钱订单状态
* @param $batch_name
* @param $out_trade_no
* @param $money
* @param $openid
* @throws BaseException
/**查询商家转账到零钱订单状态
* @param $out_batch_no
* @param $out_detail_no
* @param string $http_method
* @return array|mixed
*/
public
function
transferQuery
(
$out_batch_no
,
$out_detail_no
,
$http_method
=
"GET"
)
public
static
function
transferQuery
(
$out_batch_no
,
$out_detail_no
,
$http_method
=
"GET"
)
{
$url
=
'https://api.mch.weixin.qq.com/v3/transfer/batches/out-batch-no/'
.
$out_batch_no
.
'/details/out-detail-no/'
.
$out_detail_no
;
...
...
@@ -150,7 +147,7 @@ class TransferService
}
}
return
$result_arr
;
return
true
;
}
}
\ No newline at end of file
modules/Wechat/routes/api.php
View file @
f1995e5d
...
...
@@ -26,4 +26,5 @@ Route::name('wechat.')->prefix('wechat')->middleware(['auth.check:api'])->group(
Route
::
post
(
'/wechat/notify/order'
,
[
Modules\Wechat\Controllers\Api\Notify
::
class
,
'order'
]);
Route
::
post
(
'/wechat/notify/payment'
,
[
Modules\Wechat\Controllers\Api\Notify
::
class
,
'payment'
]);
Route
::
post
(
'/wechat/notify/refund'
,
[
Modules\Wechat\Controllers\Api\Notify
::
class
,
'refund'
]);
\ No newline at end of file
Route
::
post
(
'/wechat/notify/refund'
,
[
Modules\Wechat\Controllers\Api\Notify
::
class
,
'refund'
]);
Route
::
get
(
'/wechat/notify/transfer'
,
[
Modules\Wechat\Controllers\Api\Notify
::
class
,
'transfer'
]);
\ No newline at end of file
resources/admin/src/pages/cashierhome/cashierhome.scss
0 → 100644
View file @
f1995e5d
.input
{
position
:
fixed
;
left
:
0
;
transform
:
translateX
(
-200%
);
}
.pos_order
{
background-color
:
#f9fafc
;
border-right
:
1px
solid
#c0ccda
;
}
.pos_btn
{
margin-top
:
20px
;
}
.often_title
{
border-bottom
:
1px
solid
#d3dce6
;
background-color
:
#f9fafc
;
padding
:
10px
;
text-align
:
left
;
cursor
:
pointer
;
}
.often_goodsList
ul
li
{
list-style
:
none
;
float
:
left
;
border
:
1px
solid
#d3dce6
;
padding
:
10px
;
margin
:
10px
;
background-color
:
#ffffff
;
cursor
:
pointer
;
}
.often_price
{
color
:
#63b8ff
;
}
.goodsType
{
clear
:
both
;
height
:
auto
;
overflow
:
hidden
;
border-top
:
1px
solid
#d3dce6
;
}
.cookList
li
{
list-style
:
none
;
width
:
23%
;
border
:
1px
solid
#e5e9f2
;
height
:
auot
;
overflow
:
hidden
;
background-color
:
#fff
;
padding
:
2px
;
float
:
left
;
margin
:
2px
;
cursor
:
pointer
;
}
.cookList_div
{
width
:
60%
;
display
:
inline-block
;
float
:
left
;
}
.cookList
li
span
{
display
:
block
;
float
:
left
;
}
.foodImg
{
width
:
40%
;
height
:
120px
;
}
.foodImg
img
{
/* width: 100%; */
width
:
100%
;
height
:
auto
;
}
.foodName
{
font-size
:
16px
;
padding-left
:
10px
;
color
:
brown
;
}
.foodPrice
{
font-size
:
16px
;
padding-left
:
10px
;
padding-top
:
10px
;
color
:
#F64F15
;
}
.total
{
background
:
#ffffff
;
padding
:
10px
;
border-bottom
:
1px
solid
#d3dce6
;
color
:
red
;
font-size
:
18px
;
}
.total
small
{
padding
:
0
10px
;
text-align
:
center
;
}
\ No newline at end of file
resources/admin/src/pages/cashierhome/cashierhome.vue
0 → 100644
View file @
f1995e5d
This diff is collapsed.
Click to expand it.
resources/admin/src/pages/member/account/index.vue
View file @
f1995e5d
<
template
>
<el-container>
<!-- 大使账单 -->
<el-header>
<div
class=
"left-panel"
>
<el-select
v-model=
"search.type"
placeholder=
"请选择类型"
style=
"width: 180px; margin-right: 10px;"
clearable
>
...
...
@@ -8,7 +9,7 @@
<el-input
v-model=
"search.store_title"
placeholder=
"请输入店铺名称"
style=
"width: 180px; margin-right: 10px;"
clearable
/>
<el-input
v-model=
"search.username"
placeholder=
"请输入用户名"
style=
"width: 180px; margin-right: 10px;"
clearable
/>
<el-select
v-model=
"search.status"
placeholder=
"请选择状态"
style=
"width: 180px;"
clearable
v-if=
"search.type == 'withdraw'"
>
<el-option
:label=
"item.label"
:value=
"item.value"
v-for=
"(item, index) in [
{label: '已提现', value: 1}, {label: '待提现', value: 0}, {label: '已拒绝', value: 2}]" :key="index">
</el-option>
<el-option
:label=
"item.label"
:value=
"item.value"
v-for=
"(item, index) in [
{label: '已提现', value: 1}, {label: '待提现', value: 0}, {label: '已拒绝', value: 2}
,{label: '提现失败', value: -2}
]" :key="index">
</el-option>
</el-select>
<el-select
v-model=
"search.status"
placeholder=
"请选择状态"
style=
"width: 180px;"
clearable
v-if=
"search.type == 'income'"
>
<el-option
:label=
"item.label"
:value=
"item.value"
v-for=
"(item, index) in [
{label: '已到账', value: 1}, {label: '未入账', value: 0}]" :key="index">
</el-option>
...
...
@@ -43,7 +44,13 @@
</
template
>
<
template
#status
="
scope
"
>
<el-tag
v-if=
"scope.row.type == 'income'"
:type=
"scope.row.status == 1 ? 'success' : 'danger'"
>
{{
scope
.
row
.
status
==
1
?
'
已到账
'
:
'
未入账
'
}}
</el-tag>
<el-tag
v-else
:type=
"scope.row.status == 1 ? 'success' : 'danger'"
>
{{
scope
.
row
.
status
==
1
?
'
已提现
'
:
'
待确认
'
}}
</el-tag>
<el-tag
v-else
:type=
"scope.row.status == 1 ? 'success' : 'danger'"
>
<span
v-show=
"scope.row.status == 0"
>
待提现
</span>
<span
v-show=
"scope.row.status == 1"
>
已提现
</span>
<span
v-show=
"scope.row.status == 2"
>
已拒绝
</span>
<span
v-show=
"scope.row.status == -2"
>
提现失败
</span>
</el-tag>
</
template
>
<el-table-column
label=
"操作"
fixed=
"right"
align=
"center"
width=
"100"
>
<
template
#default
="
scope
"
>
...
...
@@ -76,10 +83,12 @@ export default{
column
:
[
{
prop
:
'
member
'
,
label
:
'
头像
'
},
{
prop
:
'
mobile
'
,
label
:
'
手机号码
'
,
width
:
120
},
{
prop
:
'
bank_realname
'
,
label
:
'
真实姓名
'
,
width
:
50
},
{
prop
:
'
type
'
,
label
:
'
类型
'
,
width
:
120
,
align
:
'
center
'
},
{
prop
:
'
amount
'
,
label
:
'
额度
'
,
width
:
120
},
{
prop
:
'
af_amount
'
,
label
:
'
余额
'
,
width
:
120
},
{
prop
:
'
remark
'
,
label
:
'
备注
'
,
width
:
120
},
{
prop
:
'
reason
'
,
label
:
'
失败理由
'
,
width
:
60
},
{
prop
:
'
status
'
,
label
:
'
状态
'
,
width
:
120
},
{
prop
:
'
created_at
'
,
label
:
'
添加时间
'
,
width
:
140
},
{
prop
:
'
updated_at
'
,
label
:
'
更新时间
'
,
width
:
140
},
...
...
resources/admin/src/pages/ucenter/account/index.vue
View file @
f1995e5d
<
template
>
<el-container>
<!-- 我的收益 -->
<el-header>
<div
class=
"left-panel"
>
<el-select
v-model=
"search.type"
placeholder=
"请选择类型"
style=
"width: 180px; margin-right: 10px;"
clearable
>
...
...
@@ -8,7 +9,7 @@
<el-input
v-model=
"search.store_title"
placeholder=
"请输入店铺名称"
style=
"width: 180px; margin-right: 10px;"
clearable
/>
<el-input
v-model=
"search.username"
placeholder=
"请输入用户名"
style=
"width: 180px; margin-right: 10px;"
clearable
/>
<el-select
v-model=
"search.status"
placeholder=
"请选择状态"
style=
"width: 180px;"
clearable
v-if=
"search.type == 'withdraw'"
>
<el-option
:label=
"item.label"
:value=
"item.value"
v-for=
"(item, index) in [
{label: '已提现', value: 1}, {label: '待提现', value: 0}, {label: '已拒绝', value: 2}]" :key="index">
</el-option>
<el-option
:label=
"item.label"
:value=
"item.value"
v-for=
"(item, index) in [
{label: '已提现', value: 1}, {label: '待提现', value: 0}, {label: '已拒绝', value: 2}
,{label: '提现失败', value: -2}
]" :key="index">
</el-option>
</el-select>
<el-select
v-model=
"search.status"
placeholder=
"请选择状态"
style=
"width: 180px;"
clearable
v-if=
"search.type == 'income'"
>
<el-option
:label=
"item.label"
:value=
"item.value"
v-for=
"(item, index) in [
{label: '已到账', value: 1}, {label: '未入账', value: 0}]" :key="index">
</el-option>
...
...
@@ -37,7 +38,14 @@
</
template
>
<
template
#status
="
scope
"
>
<el-tag
v-if=
"scope.row.type == 'service_income'"
:type=
"scope.row.status == 1 ? 'success' : 'danger'"
>
{{
scope
.
row
.
status
==
1
?
'
已到账
'
:
'
未入账
'
}}
</el-tag>
<el-tag
v-else
:type=
"scope.row.status == 1 ? 'success' : 'danger'"
>
{{
scope
.
row
.
status
==
1
?
'
已提现
'
:
'
待确认
'
}}
</el-tag>
<!--
<el-tag
v-else
:type=
"scope.row.status == 1 ? 'success' : 'danger'"
>
{{
scope
.
row
.
status
==
1
?
'
已提现
'
:
'
待确认
'
}}
</el-tag>
-->
<el-tag
v-else
:type=
"scope.row.status == 1 ? 'success' : 'danger'"
>
<span
v-show=
"scope.row.status == 0"
>
待提现
</span>
<span
v-show=
"scope.row.status == 1"
>
已提现
</span>
<span
v-show=
"scope.row.status == 2"
>
已拒绝
</span>
<span
v-show=
"scope.row.status == -2"
>
提现失败
</span>
</el-tag>
</
template
>
<el-table-column
label=
"操作"
fixed=
"right"
align=
"center"
width=
"100"
>
<
template
#default
="
scope
"
>
...
...
@@ -71,6 +79,7 @@ export default{
{
prop
:
'
af_amount
'
,
label
:
'
余额
'
,
width
:
120
},
{
prop
:
'
remark
'
,
label
:
'
备注
'
,
width
:
120
},
{
prop
:
'
status
'
,
label
:
'
状态
'
,
width
:
120
},
{
prop
:
'
reason
'
,
label
:
'
提败理由
'
,
width
:
120
},
{
prop
:
'
created_at
'
,
label
:
'
添加时间
'
,
width
:
140
},
{
prop
:
'
updated_at
'
,
label
:
'
更新时间
'
,
width
:
140
},
],
...
...
resources/admin/vite.config.js
View file @
f1995e5d
...
...
@@ -20,7 +20,7 @@ export default defineConfig({
__INTLIFY_PROD_DEVTOOLS__
:
false
},
server
:
{
port
:
808
0
,
port
:
808
1
,
host
:
true
,
open
:
false
,
proxy
:
{
...
...
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