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
05354937
authored
Dec 28, 2022
by
杨树贤
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
新增询价通知业务员
parent
3c604653
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
2 deletions
app/Http/Services/InquiryService.php
app/Http/Services/InquiryService.php
View file @
05354937
...
...
@@ -2,6 +2,7 @@
namespace
App\Http\Services
;
use
App\Models\Cms\CmsUserModel
;
use
App\Models\InquiryModel
;
use
App\Models\InquiryItemsModel
;
use
Carbon\Carbon
;
...
...
@@ -15,8 +16,9 @@ class InquiryService
$items
=
\Arr
::
get
(
$data
,
'items'
,
[]);
$items
=
json_decode
(
$items
,
true
);
$remark
=
$data
[
'remark'
];
$sn
=
self
::
generateSn
();
$inquiry
=
[
'inquiry_sn'
=>
self
::
generateSn
()
,
'inquiry_sn'
=>
$sn
,
'user_id'
=>
$user
->
id
,
'sales_id'
=>
$user
->
sale_id
,
'priority'
=>
InquiryModel
::
PRIORITY_HIGH
,
...
...
@@ -35,7 +37,25 @@ class InquiryService
'remark'
=>
$remark
,
];
}
return
InquiryItemsModel
::
addInquiryItems
(
$inquiryItems
);
$result
=
InquiryItemsModel
::
addInquiryItems
(
$inquiryItems
);
if
(
$result
)
{
//判断客户类型,如果是个人则取客户名称,如果是公司取公司名称
if
(
$user
->
account_properties
==
1
)
{
$name
=
$user
->
name
;
}
else
{
$name
=
$user
->
company_name
;
}
if
(
empty
(
$user
->
sale_id
))
{
return
true
;
}
$salesEmail
=
CmsUserModel
::
where
(
'userId'
,
$user
->
sale_id
)
->
value
(
'email'
);
$data
=
[
'name'
=>
$name
,
'inquiry_sn'
=>
$sn
,
];
SendMsg
(
$data
,
'semour_inquire'
,
[
$salesEmail
],
1
);
}
return
$result
;
});
}
...
...
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