Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
朱继来
/
后台订单管理
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
7d6907d7
authored
Jun 17, 2020
by
朱继来
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
调整采购邮件
parent
b056ade5
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
20 deletions
app/Http/Controllers/OrderController.php
resources/views/detail/detail_items_info.php
app/Http/Controllers/OrderController.php
View file @
7d6907d7
...
...
@@ -2093,6 +2093,8 @@ Class OrderController extends Controller
$CmsModel
=
new
CmsModel
();
$sale_name
=
$CmsModel
->
getUserName
(
$info
[
'order_info'
][
'sale_id'
]);
//获取业务员
$to_user_array
=
[];
//循环订单详情
foreach
(
$info
[
'order_items_info'
]
as
$key
=>
$value
)
{
if
(
$value
[
'status'
]
==
-
1
)
continue
;
...
...
@@ -2121,11 +2123,10 @@ Class OrderController extends Controller
$send_buyers
[
$value
[
'buyer_id'
]][
'date'
]
=
intval
(
$id
);
$send_buyers
[
$value
[
'buyer_id'
]][
'id'
]
=
$sale_name
;
$send_buyers
[
$value
[
'buyer_id'
]][
'ccUser'
]
=
[];
$to_user_array
[]
=
$value
[
'send_email'
];
$tmp
[
'projectId'
]
=
$key
+
1
;
$data
[
'data'
][]
=
$tmp
;
//
$tmp['projectId'] = $key+1;
//
$data['data'][] = $tmp;
}
$cc_send_mail_array
=
Config
(
'config.cc_email'
);
// 固定抄送人
...
...
@@ -2150,7 +2151,6 @@ Class OrderController extends Controller
// 各个采购邮件推入队列
foreach
(
$send_buyers
as
$k
=>
&
$v
)
{
$v
[
'combined'
]
=
0
;
$v
[
'ccUser'
]
=
$cc_send_mail_array
;
foreach
(
$v
[
'data'
]
as
$item
)
{
$v
[
'combined'
]
+=
$item
[
'totalPrice'
];
...
...
@@ -2159,27 +2159,45 @@ Class OrderController extends Controller
// 若不属于自营采购部,则添加联营采购管理人员
if
(
!
$perm
->
checkUserDepartment
(
$k
,
51
))
{
$joint_purchase_manager
=
Config
(
'config.joint_purchase_manager'
);
$
v
[
'ccUser'
]
=
array_merge
(
$cc_send_mail_array
,
$joint_purchase_manager
);
$
cc_send_mail_array
=
array_merge
(
$cc_send_mail_array
,
$joint_purchase_manager
);
}
array_push
(
$v
[
'ccUser'
],
$request
->
user
->
email
);
$v
[
'ccUser'
]
=
array_unique
(
$v
[
'ccUser'
]);
// 默认抄送给当前客服
array_push
(
$cc_send_mail_array
,
$request
->
user
->
email
);
// 默认抄送给当前客服
$cc_send_mail_array
=
array_unique
(
$cc_send_mail_array
);
$v
[
'ccUser'
]
=
$cc_send_mail_array
;
$this
->
pushQueue
(
$v
);
}
$data
[
'toUser'
]
=
$request
->
user
->
email
;
// 收件人
$data
[
'ccUser'
]
=
$cc_send_mail_array
;
$data
[
'combined'
]
=
$info
[
'order_info'
][
'order_amount'
];
$data
[
'order_amount'
]
=
$info
[
'order_info'
][
'order_amount'
];
$data
[
'date'
]
=
date
(
'Y-m-d'
,
time
());
// $data['kefu_remark'] = $info['order_temp_info']['kefu_remark']; // 客服备注
$data
[
'id'
]
=
$sale_name
;
$data
[
'order_id'
]
=
intval
(
$id
);
$data
[
'operator_id'
]
=
intval
(
$request
->
user
->
userId
);
$data
[
'operator_event'
]
=
'发送邮件成功,收件人邮箱:'
.
json_encode
(
$data
[
'toUser'
])
.
',抄送人邮箱:'
.
json_encode
(
$data
[
'ccUser'
]);
// $data['toUser'] = $request->user->email; // 收件人
// $data['ccUser'] = $cc_send_mail_array;
// $data['combined'] = $info['order_info']['order_amount'];
// $data['order_amount'] = $info['order_info']['order_amount'];
// $data['date'] = date('Y-m-d',time());
// $data['id'] = $sale_name;
// $data['order_id'] = intval($id);
// $data['operator_id'] = intval($request->user->userId);
// $data['operator_event'] = '发送邮件成功,收件人邮箱:'.json_encode($data['toUser']).',抄送人邮箱:'.json_encode($data['ccUser']);
// $this->pushQueue($data);
$event
=
'发送邮件成功,收件人邮箱:'
.
json_encode
(
$to_user_array
)
.
',抄送人邮箱:'
.
json_encode
(
$cc_send_mail_array
);
// 添加操作日志
$OrderActionLogModel
=
new
OrderActionLogModel
;
$OrderActionLogModel
->
addLog
(
$id
,
$request
->
user
->
userId
,
2
,
$event
);
// 同步到ERP
$url
=
Config
(
'website.api_domain'
)
.
'order/sysiteminfo'
;
$resData
[
'order_id'
]
=
$id
;
$resData
[
'k1'
]
=
time
();
$resData
[
'k2'
]
=
md5
(
md5
(
$resData
[
'k1'
])
.
'fh6y5t4rr351d2c3bryi'
);
$temp
=
json_decode
(
curlApi
(
$url
,
$resData
,
"POST"
),
true
);
// 连接API
$this
->
pushQueue
(
$data
)
;
if
(
$temp
[
'err_code'
]
!=
0
)
return
[
'errcode'
=>
$temp
[
'err_code'
],
'errmsg'
=>
$temp
[
'err_msg'
]]
;
return
[
'errcode'
=>
0
,
'errmsg'
=>
'推送到邮件队列成功,请稍等...'
];
}
...
...
resources/views/detail/detail_items_info.php
View file @
7d6907d7
...
...
@@ -143,7 +143,7 @@
<td>
<!-- <button type="button" class="btn btn-success btn-xs remarks">编辑</button> -->
<?php
if
(
in_array
(
$order_info
[
'status'
],
[
1
,
2
,
3
])
&&
$v
[
'status'
]
==
1
)
{
?>
<?php
if
(
in_array
(
$order_info
[
'status'
],
[
1
,
2
,
3
,
4
])
&&
$v
[
'status'
]
==
1
)
{
?>
<button
type=
"button"
class=
"btn btn-success btn-xs edit-item"
data-id=
"
<?=
$v
[
'rec_id'
]
?>
"
data-batch=
"
<?=
$v
[
'batch'
]
?>
"
data-bid=
"
<?=
$v
[
'buyer_id'
]
?>
"
data-remarks=
"
<?=
$v
[
'remarks'
]
?>
"
>
编辑
</button>
<?php
}
?>
</td>
...
...
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