Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
service
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
aimeiyue
service
Commits
c08df54b
Commit
c08df54b
authored
Sep 29, 2024
by
lizhilin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更新
parent
6b3ef861
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
23 additions
and
4 deletions
+23
-4
app/Admin/Controllers/MerchantController.php
+3
-0
app/Admin/Forms/BuyCodeForm.php
+1
-1
app/Http/Controllers/Api/ArticleController.php
+1
-1
app/Http/Controllers/Api/CommentController.php
+1
-1
app/Http/Controllers/Api/GoodController.php
+1
-1
app/Http/Controllers/Api/StoreAdminUsersController.php
+1
-0
app/Http/Controllers/Api/UserController.php
+3
-0
app/Models/Pay.php
+12
-0
No files found.
app/Admin/Controllers/MerchantController.php
View file @
c08df54b
...
...
@@ -48,6 +48,9 @@ protected function grid()
// 更改为 panel 布局
$filter
->
panel
();
$filter
->
like
(
'name'
)
->
width
(
3
);
$filter
->
equal
(
'province_id'
,
'省份'
)
->
select
(
City
::
where
(
'parent_id'
,
0
)
->
get
()
->
pluck
(
'name'
,
'city_id'
))
->
load
(
'city_id'
,
'/city'
)
->
width
(
3
);
// 城市
$filter
->
equal
(
'city_id'
,
'城市'
)
->
select
()
->
width
(
3
);
$filter
->
like
(
'contacts'
,
'联系人'
)
->
width
(
3
);
$filter
->
like
(
'phone'
)
->
width
(
3
);
$filter
->
like
(
'buycode'
)
->
width
(
3
);
...
...
app/Admin/Forms/BuyCodeForm.php
View file @
c08df54b
...
...
@@ -62,7 +62,7 @@ public function handle(array $input)
public
function
form
()
{
$this
->
display
(
'current'
,
'当前直购码'
);
$this
->
text
(
'buycode'
,
'修改直购码'
);
$this
->
text
(
'buycode'
,
'修改直购码'
)
->
help
(
'输入4位随机数字'
)
;
$this
->
hidden
(
'userid'
);
}
...
...
app/Http/Controllers/Api/ArticleController.php
View file @
c08df54b
...
...
@@ -33,7 +33,7 @@ public function getList()
'brief'
=>
$item
->
brief
,
'cover'
=>
$item
->
cover
?
env
(
'IMAGE_URL'
)
.
$item
->
cover
:
''
,
'content'
=>
$item
->
content
,
'created_at'
=>
$item
->
created_at
,
'created_at'
=>
$item
->
created_at
?
date
(
"Y-m-d H:i:s"
,
strtotime
(
$item
->
created_at
))
:
''
,
];
}
}
...
...
app/Http/Controllers/Api/CommentController.php
View file @
c08df54b
...
...
@@ -49,7 +49,7 @@ public function add(Request $request)
$count
=
OrderGoods
::
where
(
'order_id'
,
$oid
)
->
where
(
'is_comment'
,
0
)
->
count
();
//Log::add('订单商品评论' . $og_id, ['num' => $count]);
if
(
$count
==
0
)
{
//
$this->dispatch(new AutoCompleteOrder($orderObj, 120));
$this
->
dispatch
(
new
AutoCompleteOrder
(
$orderObj
,
120
));
}
return
$this
->
JsonResponse
(
''
);
}
catch
(
\Exception
$exception
)
{
...
...
app/Http/Controllers/Api/GoodController.php
View file @
c08df54b
...
...
@@ -307,7 +307,7 @@ public function getAttrKey(Request $request)
return
$this
->
JsonResponse
(
''
,
'参数错误'
,
201
);
}
$attrObj
=
GoodSku
::
where
(
"attr_sn"
,
$attr_sn
)
->
first
();
$attrObj
=
GoodSku
::
where
(
'goods_id'
,
$goods_id
)
->
where
(
"attr_sn"
,
$attr_sn
)
->
first
();
if
(
!
$attrObj
)
{
return
$this
->
JsonResponse
(
''
,
'参数错误'
,
201
);
}
...
...
app/Http/Controllers/Api/StoreAdminUsersController.php
View file @
c08df54b
...
...
@@ -80,6 +80,7 @@ public function info(Request $request)
'user_id'
=>
$muser
->
id
,
'username'
=>
$muser
->
username
,
'merchant_name'
=>
$muser
->
name
,
'phone'
=>
$muser
->
phone
,
'avatar'
=>
$muser
->
avatar
?
env
(
'IMAGE_URL'
)
.
$muser
->
avatar
:
env
(
'NO_AVATAR_IMAGE_URL'
),
'merchant_id'
=>
$muser
->
merchant_id
,
'buycode'
=>
$buycode
,
...
...
app/Http/Controllers/Api/UserController.php
View file @
c08df54b
...
...
@@ -236,6 +236,9 @@ public function editUser(Request $request)
if
(
$name
)
{
$user
->
name
=
$name
;
}
if
(
stripos
(
$avatar
,
'wximg'
)
!==
false
)
{
$avatar
=
''
;
}
if
(
$avatar
)
{
if
(
is_file
(
public_path
()
.
'/uploads'
.
$user
->
avatar
))
{
unlink
(
public_path
()
.
'/uploads'
.
$user
->
avatar
);
...
...
app/Models/Pay.php
View file @
c08df54b
...
...
@@ -83,11 +83,23 @@ public static function payNotify($fields = [])
$mer_id
=
$item
->
merchant_id
;
$goods_number
=
$item
->
goods_number
;
$goodsObj
=
Good
::
find
(
$gid
);
//更新商品规格库存
$attrObj
=
GoodSku
::
find
(
$attr_id
);
$attr_stock
=
(
$attrObj
->
stock
-
$goods_number
)
>
0
?
$attrObj
->
stock
-
$goods_number
:
0
;
$attrObj
->
stock
=
$attr_stock
;
$attrObj
->
save
();
//更新商品sku
$skuArr
=
json_decode
(
$goodsObj
->
sku
,
true
);
if
(
$skuArr
[
'sku'
])
{
foreach
(
$skuArr
[
'sku'
]
as
$kk
=>
$vv
)
{
if
(
isset
(
$vv
[
'attr_sn'
])
&&
$vv
[
'attr_sn'
]
==
$attrObj
->
attr_sn
)
{
$skuArr
[
'sku'
][
$kk
][
'stock'
]
=
$attr_stock
;
}
}
$goodsObj
->
sku
=
json_encode
(
$skuArr
,
JSON_UNESCAPED_UNICODE
);
$goodsObj
->
save
();
}
//商户规格库存
$mgsObj
=
MerchantGoodSku
::
where
([
'goods_id'
=>
$gid
,
'attr_id'
=>
$attr_id
,
'merchant_id'
=>
$mer_id
])
->
first
();
if
(
$mer_id
&&
$mgsObj
)
{
...
...
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