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
6702d1d1
authored
Feb 13, 2023
by
杨树贤
Browse files
Options
_('Browse Files')
Download
Plain Diff
Merge branch 'master' of
http://git.ichunt.net/semour/semour_web
parents
45aa4c3b
9cd5319d
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
133 additions
and
21 deletions
app/Http/Controllers/HomeController.php
app/Http/Services/InquiryService.php
app/Http/Services/OrderService.php
app/helpers.php
resources/views/common/footersm.blade.php
resources/views/common/mallFooter.blade.php
resources/views/layouts/app.blade.php
resources/views/layouts/appMall.blade.php
app/Http/Controllers/HomeController.php
View file @
6702d1d1
...
...
@@ -26,6 +26,16 @@ class HomeController extends Controller
*/
public
function
index
()
{
// $data = [
// 'name'=>rand(100,100000),
// 'order_sn'=>rand(100,100000),
// ];
// $res = SendMsg($data,'semour_order',['13713025362'],0);
// $res = SendMsg($data,'semour_order',['578953158@qq.com'],1);
// print_r($res);
// die();
return
view
(
'home.home'
);
}
}
app/Http/Services/InquiryService.php
View file @
6702d1d1
...
...
@@ -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
;
});
}
...
...
app/Http/Services/OrderService.php
View file @
6702d1d1
...
...
@@ -4,6 +4,7 @@ namespace App\Http\Services;
use
App\Exceptions\InvalidRequestException
;
use
App\Http\Models\User\TaxInfoModel
;
use
App\Models\Cms\CmsUserModel
;
use
App\Models\OrderAddressModel
;
use
App\Models\OrderItemsModel
;
use
App\Models\OrderModel
;
...
...
@@ -226,6 +227,19 @@ class OrderService
$con
->
commit
();
#发送钉钉消息
$saleInfo
=
CmsUserModel
::
getInfoByUserId
(
$userInfo
[
"sale_id"
]);
$msgData
=
[
'name'
=>
$userInfo
[
"account_properties"
]
==
1
?
$userInfo
[
"name"
]
:
$userInfo
[
"company_name"
],
'order_sn'
=>
$order_sn
,
];
if
(
$saleInfo
[
"mobile"
]){
SendMsg
(
$msgData
,
'semour_order'
,[
$saleInfo
[
"mobile"
]],
0
);
}
if
(
$saleInfo
[
"email"
]){
SendMsg
(
$msgData
,
'semour_order'
,[
$saleInfo
[
"email"
]],
1
);
}
return
$order_id
;
}
catch
(
\Exception
$e
){
$con
->
rollback
();
...
...
app/helpers.php
View file @
6702d1d1
...
...
@@ -26,6 +26,38 @@ if (!function_exists('generate_letters')) {
}
/*
* 发送信息
* @param array $data 替换的内容数组,["name"=>"小红"]
* @param string $key 在消息系统新建的模板编号,如:
semour_inquire 深茂询价消息
semour_order 深茂订单消息
* @param array $ToUser 指定接收人 [13713025362,13713025363]
*/
function
SendMsg
(
$data
=
[],
$key
=
''
,
$ToUser
=
'INNER_PERSON'
,
$is_ignore
=
0
){
if
(
$key
==
""
){
return
false
;
}
$touser_json
=
json_encode
(
$ToUser
);
$check
[
'touser'
]
=
$touser_json
;
$check
[
'data'
]
=
urldecode
(
json_encode
(
$data
,
JSON_UNESCAPED_UNICODE
));
# $check['data'] ="{\"goods_name\":\"MPVZ5004GW7U\",\"brand_name\":\"恩智浦牌\\/NXP牌\",\"goods_title\":\"多元件集成电路\",\"material_sn\":\"WL2021060300070421\",\"tax_rate_low\":\"0.7000\",\"tax_rate_land\":\"0.0000\",\"tax_rate_added\":\"13.0000\",\"supervision_con\":\"\",\"number\":\"8542391000\"}";
$check
[
'pf'
]
=
1
;
$check
[
'keyword'
]
=
$key
;
$check
[
'is_ignore'
]
=
$is_ignore
;
$check
[
'k1'
]
=
time
();
$check
[
'k2'
]
=
MD5
(
MD5
(
$check
[
'k1'
])
.
"fh6y5t4rr351d2c3bryi"
);
$response
=
Http
::
asForm
()
->
post
(
"http://api.ichunt.com/msg/sendMessageByAuto"
,
$check
);
# print_r($response->body());
# die();
$res
=
json_decode
(
$response
->
body
(),
true
);
if
(
empty
(
$res
[
'err_code'
])
||
$res
[
'err_code'
]
!=
0
)
return
false
;
return
true
;
}
/*
* 反爬虫用html标签替换数字,不包括“.”
* $number 数字串
*/
...
...
resources/views/common/footersm.blade.php
View file @
6702d1d1
...
...
@@ -22,7 +22,7 @@
</div>
<div
class=
"itemftsm"
>
<p
class=
"row"
><b>
A member of
</b><img
src=
"/assets/images/home/lxlogo.png"
alt=
""
class=
"logoftsm2"
></p>
<a
href=
"javascript:void(0)"
class=
"fz-14"
>
Copyright © 202
2
SEMOUR ELECTRONICS All rights reserved.
</a>
<a
href=
"javascript:void(0)"
class=
"fz-14"
>
Copyright © 202
3
SEMOUR ELECTRONICS All rights reserved.
</a>
</div>
</div>
...
...
resources/views/common/mallFooter.blade.php
View file @
6702d1d1
...
...
@@ -56,7 +56,7 @@
</div>
<div
class=
"itemftsp"
>
<p
class=
"row"
><span>
A member of
</span>
<img
src=
"/assets/images/home/lxlogo.png"
alt=
""
class=
"logoftsm2"
></p>
<span>
Copyright © 202
2
SEMOUR ELECTRONICS All rights reserved.
</span>
<span>
Copyright © 202
3
SEMOUR ELECTRONICS All rights reserved.
</span>
</div>
</div>
...
...
resources/views/layouts/app.blade.php
View file @
6702d1d1
<!DOCTYPE html>
<html>
<head>
<meta
charset=
"utf-8"
>
<meta
http-equiv=
"X-UA-Compatible"
content=
"IE=edge"
>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1"
>
<!-- CSRF Token -->
<meta
name=
"csrf-token"
content=
"{{ csrf_token() }}"
>
<title>
@yield('title')Electronics Supply Chain Solution Provider
</title>
@include("common.css")
@yield('css')
<!-- Google tag (gtag.js) -->
<script
async
src=
"https://www.googletagmanager.com/gtag/js?id=G-FEW2RM8MTJ"
></script>
<script>
...
...
@@ -9,16 +18,26 @@
gtag
(
'js'
,
new
Date
());
gtag
(
'config'
,
'G-FEW2RM8MTJ'
);
</script>
<meta
charset=
"utf-8"
>
<meta
http-equiv=
"X-UA-Compatible"
content=
"IE=edge"
>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1"
>
<!-- CSRF Token -->
<meta
name=
"csrf-token"
content=
"{{ csrf_token() }}"
>
<title>
@yield('title')Electronics Supply Chain Solution Provider
</title>
@include("common.css")
<!-- Meta Pixel Code -->
<script>
!
function
(
f
,
b
,
e
,
v
,
n
,
t
,
s
)
{
if
(
f
.
fbq
)
return
;
n
=
f
.
fbq
=
function
(){
n
.
callMethod
?
n
.
callMethod
.
apply
(
n
,
arguments
):
n
.
queue
.
push
(
arguments
)};
if
(
!
f
.
_fbq
)
f
.
_fbq
=
n
;
n
.
push
=
n
;
n
.
loaded
=!
0
;
n
.
version
=
'2.0'
;
n
.
queue
=
[];
t
=
b
.
createElement
(
e
);
t
.
async
=!
0
;
t
.
src
=
v
;
s
=
b
.
getElementsByTagName
(
e
)[
0
];
s
.
parentNode
.
insertBefore
(
t
,
s
)}(
window
,
document
,
'script'
,
'https://connect.facebook.net/en_US/fbevents.js'
);
fbq
(
'init'
,
'492184879780601'
);
fbq
(
'track'
,
'PageView'
);
</script>
<noscript><img
height=
"1"
width=
"1"
style=
"display:none"
src=
"https://www.facebook.com/tr?id=492184879780601&ev=PageView&noscript=1"
/></noscript>
<!-- End Meta Pixel Code -->
@yield('css')
</head>
<body>
<div
id=
"app"
>
...
...
resources/views/layouts/appMall.blade.php
View file @
6702d1d1
<!DOCTYPE html>
<html>
<head>
<meta
charset=
"utf-8"
>
<meta
http-equiv=
"X-UA-Compatible"
content=
"IE=edge"
>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1"
>
<!-- CSRF Token -->
<meta
name=
"csrf-token"
content=
"{{ csrf_token() }}"
>
<title>
@yield('title')Electronics Supply Chain Solution Provider SEMOUR
</title>
@include("common.css")
@yield('css')
<!-- Google tag (gtag.js) -->
<script
async
src=
"https://www.googletagmanager.com/gtag/js?id=G-FEW2RM8MTJ"
></script>
<script>
...
...
@@ -10,15 +19,23 @@
gtag
(
'config'
,
'G-FEW2RM8MTJ'
);
</script>
<meta
charset=
"utf-8"
>
<meta
http-equiv=
"X-UA-Compatible"
content=
"IE=edge"
>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1"
>
<!-- CSRF Token -->
<meta
name=
"csrf-token"
content=
"{{ csrf_token() }}"
>
<title>
@yield('title')Electronics Supply Chain Solution Provider SEMOUR
</title>
@include("common.css")
@yield('css')
<!-- Meta Pixel Code -->
<script>
!
function
(
f
,
b
,
e
,
v
,
n
,
t
,
s
)
{
if
(
f
.
fbq
)
return
;
n
=
f
.
fbq
=
function
(){
n
.
callMethod
?
n
.
callMethod
.
apply
(
n
,
arguments
):
n
.
queue
.
push
(
arguments
)};
if
(
!
f
.
_fbq
)
f
.
_fbq
=
n
;
n
.
push
=
n
;
n
.
loaded
=!
0
;
n
.
version
=
'2.0'
;
n
.
queue
=
[];
t
=
b
.
createElement
(
e
);
t
.
async
=!
0
;
t
.
src
=
v
;
s
=
b
.
getElementsByTagName
(
e
)[
0
];
s
.
parentNode
.
insertBefore
(
t
,
s
)}(
window
,
document
,
'script'
,
'https://connect.facebook.net/en_US/fbevents.js'
);
fbq
(
'init'
,
'492184879780601'
);
fbq
(
'track'
,
'PageView'
);
</script>
<noscript><img
height=
"1"
width=
"1"
style=
"display:none"
src=
"https://www.facebook.com/tr?id=492184879780601&ev=PageView&noscript=1"
/></noscript>
<!-- End Meta Pixel Code -->
</head>
<body>
<div
id=
"app"
>
...
...
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