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
8009ebed
Commit
8009ebed
authored
Nov 02, 2024
by
wuxiaoli
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
上传图片到本地
parent
60edcf1a
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
6 deletions
+24
-6
modules/Order/app/Services/OrderService.php
modules/Order/app/Services/OrderService.php
+20
-6
modules/System/app/Controllers/Api/File.php
modules/System/app/Controllers/Api/File.php
+4
-0
No files found.
modules/Order/app/Services/OrderService.php
View file @
8009ebed
...
@@ -704,18 +704,32 @@ class OrderService {
...
@@ -704,18 +704,32 @@ class OrderService {
if
(
!
$order
){
if
(
!
$order
){
throw
new
\Exception
(
"订单不存在!"
,
0
);
throw
new
\Exception
(
"订单不存在!"
,
0
);
}
}
$item
=
$order
->
detail
()
->
where
(
'id'
,
$request
->
input
(
'detail_id'
))
->
first
();
if
(
!
$item
){
throw
new
\Exception
(
"订单详情不存在!"
,
0
);
}
if
(
$request
->
is
(
'api/*'
)
&&
auth
(
'api'
)
->
user
()){
//判断是否为店主
//判断是否为店主
$level
=
auth
(
'api'
)
->
user
()
->
level
()
->
where
(
'store_id'
,
'='
,
$order
[
'store_id'
])
->
first
();
$store
=
\Modules\Store\Models\Store
::
where
(
'id'
,
$item
[
'store_id'
])
->
where
(
'status'
,
1
)
->
select
([
'id'
,
'member_id'
,
'status'
])
->
first
();
if
(
!
$level
||
$level
[
'name'
]
!=
'master'
){
if
(
$store
->
member_id
!=
auth
(
'api'
)
->
user
()
->
uid
){
throw
new
\Exception
(
"您不是店主,无权核销!"
,
0
);
throw
new
\Exception
(
"您不是店主,无权发货!"
,
0
);
}
}
else
{
throw
new
\Exception
(
"请先登录!"
,
0
);
}
}
$order
->
status
=
3
;
$order
->
status
=
3
;
$order
->
confirm_time
=
date
(
'Y-m-d H:i:s'
);
$order
->
confirm_time
=
date
(
'Y-m-d H:i:s'
);
$order
->
delivery_time
=
date
(
'Y-m-d H:i:s'
);
$order
->
save
();
$order
->
save
();
\Modules\Goods\Events\OrderTake
::
dispatch
(
$order
);
$item
->
status
=
3
;
$item
->
delivery_time
=
date
(
'Y-m-d H:i:s'
);
$item
->
delivery_type
=
$request
->
input
(
'delivery_type'
,
'pickup'
);
$item
->
save
();
\Modules\Order\Events\OrderTake
::
dispatch
(
$order
,
$item
);
return
$order
;
return
$order
;
}
}
...
...
modules/System/app/Controllers/Api/File.php
View file @
8009ebed
...
@@ -10,6 +10,7 @@ namespace Modules\System\Controllers\Api;
...
@@ -10,6 +10,7 @@ namespace Modules\System\Controllers\Api;
use
Illuminate\Http\Request
;
use
Illuminate\Http\Request
;
use
App\Http\Controllers\BaseController
;
use
App\Http\Controllers\BaseController
;
use
Illuminate\Support\Facades\Storage
;
class
File
extends
BaseController
{
class
File
extends
BaseController
{
...
@@ -82,6 +83,9 @@ class File extends BaseController {
...
@@ -82,6 +83,9 @@ class File extends BaseController {
$path
=
$file
->
store
(
'images/'
.
date
(
'Ymd'
));
$path
=
$file
->
store
(
'images/'
.
date
(
'Ymd'
));
// 保存图片到storage/app/public/images目录
//$bool = Storage::disk('public')->put($path, file_get_contents($file -> getRealPath()));//解决方式 换成 Storage::disk('')->put()
$data
=
[
$data
=
[
'path'
=>
$path
,
'path'
=>
$path
,
'url'
=>
Storage
::
disk
()
->
url
(
$path
),
'url'
=>
Storage
::
disk
()
->
url
(
$path
),
...
...
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