Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
semour
/
semour_web
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
ecd19adc
authored
Nov 10, 2022
by
杨树贤
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
默认地址设置的问题
parent
9ffe949b
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
3 deletions
.idea/workspace.xml
app/Http/Services/UserAddressService.php
.idea/workspace.xml
View file @
ecd19adc
...
@@ -3,8 +3,6 @@
...
@@ -3,8 +3,6 @@
<component
name=
"ChangeListManager"
>
<component
name=
"ChangeListManager"
>
<list
default=
"true"
id=
"fb90add0-1393-48c2-9f26-72365d42cd03"
name=
"变更"
comment=
""
>
<list
default=
"true"
id=
"fb90add0-1393-48c2-9f26-72365d42cd03"
name=
"变更"
comment=
""
>
<change
beforePath=
"$PROJECT_DIR$/.idea/workspace.xml"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/.idea/workspace.xml"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/.idea/workspace.xml"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/.idea/workspace.xml"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/app/Http/Controllers/Api/CountryApiController.php"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/app/Http/Controllers/Api/CountryApiController.php"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/app/Http/Services/CountryService.php"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/app/Http/Services/CountryService.php"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/bootstrap/app.php"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/bootstrap/app.php"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/bootstrap/app.php"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/bootstrap/app.php"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/bootstrap/cache/.gitignore"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/bootstrap/cache/.gitignore"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/bootstrap/cache/.gitignore"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/bootstrap/cache/.gitignore"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/storage/app/.gitignore"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/storage/app/.gitignore"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/storage/app/.gitignore"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/storage/app/.gitignore"
afterDir=
"false"
/>
...
@@ -188,7 +186,7 @@
...
@@ -188,7 +186,7 @@
<workItem
from=
"1666835076791"
duration=
"693000"
/>
<workItem
from=
"1666835076791"
duration=
"693000"
/>
<workItem
from=
"1667266026118"
duration=
"40321000"
/>
<workItem
from=
"1667266026118"
duration=
"40321000"
/>
<workItem
from=
"1667959054458"
duration=
"183000"
/>
<workItem
from=
"1667959054458"
duration=
"183000"
/>
<workItem
from=
"1667986756173"
duration=
"7
143
000"
/>
<workItem
from=
"1667986756173"
duration=
"7
812
000"
/>
</task>
</task>
<servers
/>
<servers
/>
</component>
</component>
...
...
app/Http/Services/UserAddressService.php
View file @
ecd19adc
...
@@ -18,6 +18,11 @@ class UserAddressService
...
@@ -18,6 +18,11 @@ class UserAddressService
}
}
$address
[
'user_id'
]
=
$user
->
id
;
$address
[
'user_id'
]
=
$user
->
id
;
$address
[
'create_time'
]
=
time
();
$address
[
'create_time'
]
=
time
();
//如果没有默认地址,那么就设置为默认地址
$hasDefaultAddress
=
UserAddressModel
::
where
(
'user_id'
,
$user
->
id
)
->
where
(
'is_default'
,
1
)
->
exists
();
if
(
!
$hasDefaultAddress
)
{
$address
[
'is_default'
]
=
1
;
}
return
UserAddressModel
::
insert
(
$address
);
return
UserAddressModel
::
insert
(
$address
);
});
});
}
}
...
...
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