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
e42b1a4e
authored
Nov 14, 2022
by
杨树贤
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
地址接口不分页
parent
660d3237
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
14 additions
and
6 deletions
.idea/workspace.xml
app/Http/Controllers/Api/UserAddressApiController.php
app/Http/Controllers/Api/UserApiController.php
app/Http/Services/UserAddressService.php
.idea/workspace.xml
View file @
e42b1a4e
...
...
@@ -3,8 +3,9 @@
<component
name=
"ChangeListManager"
>
<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$/app/Http/Controllers/Api/AuthApiController.php"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/app/Http/Controllers/Api/AuthApiController.php"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/app/Http/Services/InquiryService.php"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/app/Http/Services/InquiryService.php"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/app/Http/Controllers/Api/UserAddressApiController.php"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/app/Http/Controllers/Api/UserAddressApiController.php"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/app/Http/Controllers/Api/UserApiController.php"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/app/Http/Controllers/Api/UserApiController.php"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/app/Http/Services/UserAddressService.php"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/app/Http/Services/UserAddressService.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$/storage/app/.gitignore"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/storage/app/.gitignore"
afterDir=
"false"
/>
...
...
@@ -189,7 +190,7 @@
<workItem
from=
"1667266026118"
duration=
"40321000"
/>
<workItem
from=
"1667959054458"
duration=
"183000"
/>
<workItem
from=
"1667986756173"
duration=
"14315000"
/>
<workItem
from=
"1668150640953"
duration=
"1
5808
000"
/>
<workItem
from=
"1668150640953"
duration=
"1
8277
000"
/>
</task>
<servers
/>
</component>
...
...
app/Http/Controllers/Api/UserAddressApiController.php
View file @
e42b1a4e
...
...
@@ -17,7 +17,7 @@ class UserAddressApiController extends Controller
{
$userId
=
$request
->
user
->
id
;
$data
=
UserAddressService
::
getUserAddressList
(
$userId
);
return
$this
->
setSuccessData
(
$data
[
'data'
],
$data
[
'total'
]
);
return
$this
->
setSuccessData
(
$data
[
'data'
],
count
(
$data
[
'data'
])
);
}
public
function
detail
(
Request
$request
)
...
...
app/Http/Controllers/Api/UserApiController.php
View file @
e42b1a4e
...
...
@@ -4,6 +4,7 @@ namespace App\Http\Controllers\Api;
use
App\Http\Requests\UserUpdate
;
use
App\Models\UserModel
;
use
http\Client\Curl\User
;
use
Illuminate\Foundation\Auth\Access\AuthorizesRequests
;
use
Illuminate\Foundation\Bus\DispatchesJobs
;
use
Illuminate\Foundation\Validation\ValidatesRequests
;
...
...
@@ -101,7 +102,13 @@ class UserApiController extends Controller
return
$this
->
setError
(
'Email code invalid'
);
}
$result
=
UserModel
::
where
(
'id'
,
$userId
)
->
update
([
'email'
=>
$email
]);
//先判断下邮箱是否存在
$existEmail
=
UserModel
::
where
(
'email'
,
$email
)
->
exists
();
if
(
$existEmail
)
{
return
$this
->
setError
(
'Email has been registered'
);
}
$result
=
UserModel
::
where
(
'id'
,
$userId
)
->
update
([
'email'
=>
$email
,
'update_time'
=>
time
()]);
if
(
!
$result
)
{
return
$this
->
setError
(
'Change email failed'
);
}
...
...
app/Http/Services/UserAddressService.php
View file @
e42b1a4e
...
...
@@ -57,7 +57,7 @@ class UserAddressService
]);
}
])
->
where
(
'user_id'
,
$userId
)
->
orderBy
(
'address_id'
,
'desc'
);
$result
=
$query
->
paginate
(
10
)
->
toArray
();
$result
=
$query
->
get
(
)
->
toArray
();
foreach
(
$result
[
'data'
]
as
&
$item
)
{
$item
[
'create_time'
]
=
date
(
'Y-m-d H:i:s'
,
$item
[
'create_time'
]);
$item
[
'country'
]
=
\Arr
::
get
(
$item
[
'country'
],
'name'
);
...
...
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