Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
黄成意
/
php_frq_api
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
67713314
authored
May 14, 2021
by
hcy001
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
邮件或者短信
parent
ddfd9d7f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
11 deletions
app/Model/CommonModel.php
app/Model/QuoteModel.php
app/Model/CommonModel.php
View file @
67713314
...
...
@@ -148,9 +148,9 @@ class CommonModel extends Model
* 发送短信、邮件
* @param [type] $userId [指定发送人的后台ID]
* @param [type] $contents [发送内容]
* @
return [type] [description]
* @
param int $types 短信还是邮件: 1 发送邮件+短信 2 只发短信 3 只发邮件
*/
public
function
send_msg
(
$userId
,
$contents
)
public
function
send_msg
(
$userId
,
$contents
,
$types
=
1
)
{
//调用消息接口
$url
=
Config
(
'website.api_domain'
)
.
'msg/sendmessagebyauto'
;
...
...
@@ -180,7 +180,7 @@ class CommonModel extends Model
];
// 短信
if
(
$user_id
)
{
if
(
$user_id
&&
$types
!=
3
)
{
$msgData
[
'keyword'
]
=
$keyword_text
;
$msgData
[
'touser'
]
=
$user_id
;
...
...
@@ -190,7 +190,7 @@ class CommonModel extends Model
}
// 邮件
if
(
$email
)
{
if
(
$email
&&
$types
!=
2
)
{
$msgData
[
'keyword'
]
=
$keyword_email
;
$msgData
[
'touser'
]
=
json_encode
([
$email
]);
$msgData
[
'is_ignore'
]
=
1
;
...
...
app/Model/QuoteModel.php
View file @
67713314
...
...
@@ -554,13 +554,13 @@ class QuoteModel extends Model
$con
->
commit
();
// 推送消息
//
$inquiry_id = InquiryItemsModel::where('id', $inquiry_items_id)->value('inquiry_id');
//
//
$InquiryModel = new InquiryModel;
//
$inquiry_uid = $InquiryModel->where('id', $inquiry_id)->value('create_uid'); // 询价人
//
//
$contents = '您有新报价,请及时查看!';
// $CommonModel->send_msg($inquiry_uid, $contents
);
$inquiry_id
=
InquiryItemsModel
::
where
(
'id'
,
$inquiry_items_id
)
->
value
(
'inquiry_id'
);
$InquiryModel
=
new
InquiryModel
;
$inquiry_uid
=
$InquiryModel
->
where
(
'id'
,
$inquiry_id
)
->
value
(
'create_uid'
);
// 询价人
$contents
=
'您有新报价,请及时查看!'
;
$CommonModel
->
send_msg
(
$inquiry_uid
,
$contents
,
2
);
return
[
0
,
"新增成功"
];
}
catch
(
\Exception
$e
)
{
...
...
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