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
37f59c2b
authored
Nov 16, 2022
by
杨树贤
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
询价单号
parent
ec3b831c
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
1 deletions
app/Http/Controllers/AuthController.php
app/Http/Services/InquiryService.php
app/Http/Controllers/AuthController.php
View file @
37f59c2b
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
namespace
App\Http\Controllers
;
namespace
App\Http\Controllers
;
use
App\Http\Services\InquiryService
;
use
Illuminate\Http\Request
;
use
Illuminate\Http\Request
;
class
AuthController
extends
Controller
class
AuthController
extends
Controller
...
@@ -9,7 +10,6 @@ class AuthController extends Controller
...
@@ -9,7 +10,6 @@ class AuthController extends Controller
public
function
forget
()
public
function
forget
()
{
{
return
view
(
'auth.forget'
);
return
view
(
'auth.forget'
);
}
}
public
function
change
()
public
function
change
()
...
...
app/Http/Services/InquiryService.php
View file @
37f59c2b
...
@@ -4,6 +4,7 @@ namespace App\Http\Services;
...
@@ -4,6 +4,7 @@ namespace App\Http\Services;
use
App\Models\InquiryModel
;
use
App\Models\InquiryModel
;
use
App\Models\InquiryItemsModel
;
use
App\Models\InquiryItemsModel
;
use
Carbon\Carbon
;
use
Illuminate\Support\Facades\DB
;
use
Illuminate\Support\Facades\DB
;
class
InquiryService
class
InquiryService
...
@@ -15,6 +16,7 @@ class InquiryService
...
@@ -15,6 +16,7 @@ class InquiryService
$items
=
json_decode
(
$items
,
true
);
$items
=
json_decode
(
$items
,
true
);
$remark
=
$data
[
'remark'
];
$remark
=
$data
[
'remark'
];
$inquiry
=
[
$inquiry
=
[
'inquiry_sn'
=>
self
::
generateSn
(),
'user_id'
=>
$user
->
id
,
'user_id'
=>
$user
->
id
,
'user_types'
=>
$user
->
account_properties
,
'user_types'
=>
$user
->
account_properties
,
'remark'
=>
$remark
,
'remark'
=>
$remark
,
...
@@ -80,4 +82,12 @@ class InquiryService
...
@@ -80,4 +82,12 @@ class InquiryService
return
$result
;
return
$result
;
}
}
public
static
function
generateSn
()
{
$maxInquiryId
=
InquiryModel
::
orderBy
(
'inquiry_id'
,
'desc'
)
->
value
(
'inquiry_id'
);
$id
=
str_pad
((
$maxInquiryId
+
1
),
6
,
0
,
STR_PAD_LEFT
);
$time
=
Carbon
::
now
()
->
addMonths
(
-
9
)
->
addDays
(
-
10
)
->
timestamp
;
return
'XJ'
.
date
(
'Ymd'
,
$time
)
.
$id
;
}
}
}
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