Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
Z
zptz-sass-kelaidian
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
李大见
zptz-sass-kelaidian
Commits
19c0b50a
提交
19c0b50a
authored
9月 27, 2024
作者:
窦斌
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
edit
上级
1c6cea96
全部展开
显示空白字符变更
内嵌
并排
正在显示
44 个修改的文件
包含
1554 行增加
和
153 行删除
+1554
-153
Kernel.php
app/Console/Kernel.php
+5
-5
SingLeCallByTtsController.php
app/Http/Controllers/Api/SingLeCallByTtsController.php
+0
-0
SynJdPopDataController.php
app/Http/Controllers/Api/SynJdPopDataController.php
+2
-1
SysCallByTtsCostController.php
app/Http/Controllers/Api/SysCallByTtsCostController.php
+205
-0
CommonController.php
app/Http/Controllers/Common/CommonController.php
+5
-1
CompanyController.php
app/Http/Controllers/Common/CompanyController.php
+1
-0
GoodsBrandController.php
app/Http/Controllers/Common/GoodsBrandController.php
+3
-1
GoodsController.php
app/Http/Controllers/Common/GoodsController.php
+1
-1
BserviStoreController.php
app/Http/Controllers/DatasBase/BserviStoreController.php
+6
-6
BservissController.php
app/Http/Controllers/DatasBase/BservissController.php
+25
-17
TipsController.php
app/Http/Controllers/DatasBase/TipsController.php
+12
-3
InstallPersonController.php
...ttp/Controllers/InstallPerson/InstallPersonController.php
+32
-19
AotuorderController.php
app/Http/Controllers/Orders/AotuorderController.php
+12
-4
OrderListController.php
app/Http/Controllers/Orders/OrderListController.php
+4
-21
ServiceProviderController.php
app/Http/Controllers/Service/ServiceProviderController.php
+9
-2
SupplierPriceController.php
app/Http/Controllers/Service/SupplierPriceController.php
+5
-2
WarehouseController.php
app/Http/Controllers/Service/WarehouseController.php
+12
-8
AdminsController.php
app/Http/Controllers/User/AdminsController.php
+4
-2
BmmcController.php
app/Http/Controllers/User/BmmcController.php
+6
-2
LoginController.php
app/Http/Controllers/User/LoginController.php
+20
-0
OrderCallphone.php
app/Models/OrderCallphone.php
+13
-0
LoginService.php
app/Services/Api/MobileWeb/LoginService.php
+48
-27
OrderListService.php
app/Services/Api/MobileWeb/OrderListService.php
+22
-0
CommonService.php
app/Services/CommonService.php
+75
-0
OrderDeductionFeeService.php
app/Services/OrderDeductionFeeService.php
+4
-3
OrderListService.php
app/Services/OrderListService.php
+4
-1
OrderService.php
app/Services/OrderService.php
+12
-4
PlatformService.php
app/Services/PlatformService.php
+16
-12
RefundService.php
app/Services/RefundService.php
+6
-4
ServiceProviderService.php
app/Services/ServiceProviderService.php
+5
-3
SupplierPriceService.php
app/Services/SupplierPriceService.php
+6
-4
SignatureHelper.php
public/aliyunDyvmsSdk/SignatureHelper.php
+98
-0
Test.php
public/aliyunDyvmsSdk/Test.php
+54
-0
batchRobotSmartCall.php
public/aliyunDyvmsSdk/demo/batchRobotSmartCall.php
+84
-0
cancelCall.php
public/aliyunDyvmsSdk/demo/cancelCall.php
+63
-0
clickToDial.php
public/aliyunDyvmsSdk/demo/clickToDial.php
+85
-0
ivrCall.php
public/aliyunDyvmsSdk/demo/ivrCall.php
+122
-0
queryCallDetailByCallId.php
public/aliyunDyvmsSdk/demo/queryCallDetailByCallId.php
+69
-0
queryCallDetailByTaskId.php
public/aliyunDyvmsSdk/demo/queryCallDetailByTaskId.php
+69
-0
queryRobotInfoList.php
public/aliyunDyvmsSdk/demo/queryRobotInfoList.php
+63
-0
singleCallByTts.php
public/aliyunDyvmsSdk/demo/singleCallByTts.php
+89
-0
singleCallByVoice.php
public/aliyunDyvmsSdk/demo/singleCallByVoice.php
+80
-0
smartCall.php
public/aliyunDyvmsSdk/demo/smartCall.php
+90
-0
api.php
routes/api.php
+8
-0
没有找到文件。
app/Console/Kernel.php
浏览文件 @
19c0b50a
...
...
@@ -17,8 +17,8 @@ class Kernel extends ConsoleKernel
Commands\GetJdOrder
::
class
,
Commands\GetJdSelfOrder
::
class
,
Commands\GetJdSelfRefund
::
class
,
Commands\GetJdSelfShhOrder
::
class
Commands\DeductionFee
::
class
//
Commands\GetJdSelfShhOrder::class
//
Commands\DeductionFee::class
];
/**
...
...
@@ -34,9 +34,9 @@ class Kernel extends ConsoleKernel
$schedule
->
command
(
'getOrder'
)
->
everyFiveMinutes
();
//每五分钟执行一次
$schedule
->
command
(
'decJdOrder'
)
->
everyFiveMinutes
();
//每五分钟执行一次
$schedule
->
command
(
'getJdSelfOrder'
)
->
everyFiveMinutes
();
//每五分钟执行一次
$schedule
->
command
(
'getJdSelfRefund'
)
->
everyFiveMinutes
();
//每五分钟执行一次
$schedule
->
command
(
'GetJdSelfShhOrder'
)
->
everyFiveMinutes
();
//每五分钟执行一次
$schedule
->
command
(
'DeductionFee'
)
->
everyFiveMinutes
();
//每五分钟执行一次
//
$schedule->command('getJdSelfRefund')->everyFiveMinutes();//每五分钟执行一次
//
$schedule->command('GetJdSelfShhOrder')->everyFiveMinutes();//每五分钟执行一次
//
$schedule->command('DeductionFee')->everyFiveMinutes();//每五分钟执行一次
}
/**
...
...
app/Http/Controllers/Api/SingLeCallByTtsController.php
0 → 100644
浏览文件 @
19c0b50a
差异被折叠。
点击展开。
app/Http/Controllers/Api/SynJdPopDataController.php
浏览文件 @
19c0b50a
...
...
@@ -31,7 +31,8 @@ class SynJdPopDataController extends BaseController
* @date 2022/4/27
*/
public
function
addOrderData
(){
CommonService
::
addLog
(
'无sku'
,
'CESHISHUJU'
,
1111111
,
'JDPOP-无sku'
);
echo
'操作成功--****'
;
/* $str = "AAQLAodRrJ360+b6qYevz+HgyXHUehSiWki+A9YqUJVvonqI1G8rNALcCZYF9eo5A5M=";
$data['accessToken'] = 'e0a1c90e617f4b3a9865ed059f99c5f42ztb';
$data['appKey'] = '41D9668E8CB81C9890A065BEC300FD84';
...
...
app/Http/Controllers/Api/SysCallByTtsCostController.php
0 → 100644
浏览文件 @
19c0b50a
<?php
/**
* 文件名称(自动拨打电话扣费)
* 文件简单描述(自动拨打电话扣费)
* @author DouBin
* @Date: 2024/8/7
* @Time: 11:46
* @Email: db@sudianwang.com
* @version 1.0
* @copyright BlueCity
*/
namespace
App\Http\Controllers\Api
;
use
App\Http\Controllers\BaseController
;
use
App\Models\AdminInfor
;
use
App\Models\OrderCallphone
;
use
App\Models\OrderList
;
use
App\Services\CommonService
;
use
App\Services\OrderDeductionFeeService
;
use
Illuminate\Database\Eloquent\Model
;
use
Illuminate\Http\Request
;
use
DB
;
class
SysCallByTtsCostController
extends
BaseController
{
/**|---------------------------------------------------------------------------------
* @name 获取需要推送数据
* @retrun \Illuminate\Http\JsonResponse /multitype:array
* @author dou 2024/9/24 14:04
* |---------------------------------------------------------------------------------
*/
public
function
getCallByTtsCost
(
){
$time_start
=
date
(
"Y-m-d H:i:s"
,
strtotime
(
" -5 minute"
.
date
(
"Y-m-d H:i:s"
)));
$list
=
OrderCallphone
::
where
(
'och_state'
,
1
)
->
where
(
'och_creactime'
,
'<'
,
$time_start
)
->
get
();
$list
=
CommonService
::
dataToArray
(
$list
);
if
(
!
empty
(
$list
))
{
$num
=
0
;
$data
=
[];
foreach
(
$list
as
$k
=>
$v
)
{
$QueryDate
=
strtotime
(
$v
[
'och_creactime'
])
.
'000'
;
$res
=
self
::
queryCallDetailByCallId
(
$v
[
'och_CallId'
],
$QueryDate
);
$res
=
CommonService
::
dataToArray
(
$res
);
if
(
isset
(
$res
[
'Data'
])){
$och
[
'och_Message'
]
=
$res
[
'Data'
];
$res
[
'Data'
]
=
json_decode
(
str_replace
(
'\"'
,
'"'
,
$res
[
'Data'
]));
$res
[
'Data'
]
=
CommonService
::
dataToArray
(
$res
[
'Data'
]);
if
(
$res
[
'Data'
][
'duration'
]
>
0
){
$och
[
'och_state'
]
=
2
;
}
else
{
$och
[
'och_state'
]
=
3
;
}
}
else
{
$och
[
'och_Message'
]
=
''
;
$och
[
'och_state'
]
=
4
;
}
$och
[
'och_updatetime'
]
=
date
(
"Y-m-d H:i:s"
);
OrderCallphone
::
where
(
'och_id'
,
$v
[
'och_id'
])
->
update
(
$och
);
if
(
in_array
(
$och
[
'och_state'
],
[
4
,
2
,
3
]))
{
$post_data
[
'adm_id'
]
=
0
;
$post_data
[
'company_id'
]
=
$v
[
'och_company_id'
];
$post_data
[
'order_number'
]
=
$v
[
'och_order_number'
]
.
'-'
.
$v
[
'och_serial_number'
];
$post_data
[
'reo_price'
]
=
-
0.1
;
$post_data
[
'reo_pay_way'
]
=
5
;
$post_data
[
'pay_type'
]
=
1
;
OrderDeductionFeeService
::
deductFee
(
$post_data
);
}
$data
[
$num
][
'order_num'
]
=
$v
[
'och_order_number'
]
.
'-'
.
$v
[
'och_serial_number'
];
$data
[
$num
][
'och_company_id'
]
=
$v
[
'och_company_id'
];
$data
[
$num
][
'content'
]
=
$res
;
$num
++
;
}
CommonService
::
addLog
(
'电话通知扣费'
,
json_encode
(
$data
,
JSON_UNESCAPED_UNICODE
),
''
,
'getCallByTtsCost'
);
return
response
()
->
json
([
'code'
=>
200
,
'msg'
=>
'操作完成'
,
'data'
=>
$data
]);
}
else
{
CommonService
::
addLog
(
'电话通知扣费'
,
'无数据'
,
''
,
'getCallByTtsCost'
);
}
}
/**
* 通过呼叫ID获取呼叫记录
*/
function
queryCallDetailByCallId
(
$CallId
,
$QueryDate
)
{
$params
=
array
();
// *** 需用户填写部分 ***
// fixme 必填:是否启用https
$security
=
false
;
// fixme 必填: 请参阅 https://ak-console.aliyun.com/ 取得您的AK信息
$accessKeyId
=
"LTAI5t64Hr8rE8NdT1D1jKNh"
;
$accessKeySecret
=
"vpJvj5ksVOy7szD9DFraUbb7yHv8Jb"
;
// fixme 必填: 从上次呼叫调用的返回值中获取的CallId
$params
[
"CallId"
]
=
$CallId
;
// fixme 必填: Unix时间戳(毫秒),会查询这个时间点对应那一天的记录
$params
[
"QueryDate"
]
=
$QueryDate
;
// fixme 必填: 语音通知为:11000000300006, 语音验证码为:11010000138001, IVR为:11000000300005, 点击拨号为:11000000300004, SIP为:11000000300009
$params
[
"ProdId"
]
=
"11000000300006"
;
// *** 需用户填写部分结束, 以下代码若无必要无需更改 ***
// 此处可能会抛出异常,注意catch
$content
=
self
::
request
(
$accessKeyId
,
$accessKeySecret
,
"dyvmsapi.aliyuncs.com"
,
array_merge
(
$params
,
array
(
"RegionId"
=>
"cn-beijing"
,
"Action"
=>
"QueryCallDetailByCallId"
,
"Version"
=>
"2017-05-25"
,
)),
$security
);
return
$content
;
}
/**
* 生成签名并发起请求
*
* @param $accessKeyId string AccessKeyId (https://ak-console.aliyun.com/)
* @param $accessKeySecret string AccessKeySecret
* @param $domain string API接口所在域名
* @param $params array API具体参数
* @param $security boolean 使用https
* @param $method boolean 使用GET或POST方法请求,VPC仅支持POST
* @return bool|\stdClass 返回API接口调用结果,当发生错误时返回false
*/
public
function
request
(
$accessKeyId
,
$accessKeySecret
,
$domain
,
$params
,
$security
=
false
,
$method
=
'POST'
)
{
$apiParams
=
array_merge
(
array
(
"SignatureMethod"
=>
"HMAC-SHA1"
,
"SignatureNonce"
=>
uniqid
(
mt_rand
(
0
,
0xffff
),
true
),
"SignatureVersion"
=>
"1.0"
,
"AccessKeyId"
=>
$accessKeyId
,
"Timestamp"
=>
gmdate
(
"Y-m-d\TH:i:s\Z"
),
"Format"
=>
"JSON"
,
),
$params
);
ksort
(
$apiParams
);
$sortedQueryStringTmp
=
""
;
foreach
(
$apiParams
as
$key
=>
$value
)
{
$sortedQueryStringTmp
.=
"&"
.
$this
->
encode
(
$key
)
.
"="
.
$this
->
encode
(
$value
);
}
$stringToSign
=
"${method}&%2F&"
.
$this
->
encode
(
substr
(
$sortedQueryStringTmp
,
1
));
$sign
=
base64_encode
(
hash_hmac
(
"sha1"
,
$stringToSign
,
$accessKeySecret
.
"&"
,
true
));
$signature
=
$this
->
encode
(
$sign
);
$url
=
(
$security
?
'https'
:
'http'
)
.
"://
{
$domain
}
/"
;
try
{
$content
=
$this
->
fetchContent
(
$url
,
$method
,
"Signature=
{
$signature
}{
$sortedQueryStringTmp
}
"
);
return
json_decode
(
$content
);
}
catch
(
\Exception
$e
)
{
return
false
;
}
}
private
function
encode
(
$str
)
{
$res
=
urlencode
(
$str
);
$res
=
preg_replace
(
"/\+/"
,
"%20"
,
$res
);
$res
=
preg_replace
(
"/\*/"
,
"%2A"
,
$res
);
$res
=
preg_replace
(
"/%7E/"
,
"~"
,
$res
);
return
$res
;
}
private
function
fetchContent
(
$url
,
$method
,
$body
)
{
$ch
=
curl_init
();
if
(
$method
==
'POST'
)
{
curl_setopt
(
$ch
,
CURLOPT_POST
,
1
);
//post提交方式
curl_setopt
(
$ch
,
CURLOPT_POSTFIELDS
,
$body
);
}
else
{
$url
.=
'?'
.
$body
;
}
curl_setopt
(
$ch
,
CURLOPT_URL
,
$url
);
curl_setopt
(
$ch
,
CURLOPT_TIMEOUT
,
5
);
curl_setopt
(
$ch
,
CURLOPT_RETURNTRANSFER
,
1
);
curl_setopt
(
$ch
,
CURLOPT_HTTPHEADER
,
array
(
"x-sdk-client"
=>
"php/2.0.0"
));
if
(
substr
(
$url
,
0
,
5
)
==
'https'
)
{
curl_setopt
(
$ch
,
CURLOPT_SSL_VERIFYPEER
,
false
);
curl_setopt
(
$ch
,
CURLOPT_SSL_VERIFYHOST
,
false
);
}
$rtn
=
curl_exec
(
$ch
);
if
(
$rtn
===
false
)
{
// 大多由设置等原因引起,一般无法保障后续逻辑正常执行,
// 所以这里触发的是E_USER_ERROR,会终止脚本执行,无法被try...catch捕获,需要用户排查环境、网络等故障
trigger_error
(
"[CURL_"
.
curl_errno
(
$ch
)
.
"]: "
.
curl_error
(
$ch
),
E_USER_ERROR
);
}
curl_close
(
$ch
);
return
$rtn
;
}
}
app/Http/Controllers/Common/CommonController.php
浏览文件 @
19c0b50a
...
...
@@ -1274,7 +1274,7 @@ class CommonController extends BaseController
public
function
getCompanyList
(
Request
$request
){
$session
=
$request
->
get
(
'session_token'
);
$data
=
new
Company
();
if
(
$session
[
'admin_groupnew'
]
!=
7
){
//管理员可以看全部
if
(
!
in_array
(
$session
[
'admin_groupnew'
],[
7
,
8
]))
{
$data
=
$data
->
whereRaw
(
"FIND_IN_SET("
.
$session
[
'company_id'
]
.
",com_parent_id) or com_id = '"
.
$session
[
'company_id'
]
.
"'"
);
// if ($session['admin_groupnew'] != 8) {//管理员可以看全部
// $data = $data->where('com_id', $session['company_id']);
...
...
@@ -1282,6 +1282,9 @@ class CommonController extends BaseController
// $data = $data->where('com_id', '>',1);
// }
}
if
(
in_array
(
$session
[
'admin_groupnew'
],[
8
]))
{
$data
=
$data
->
whereIn
(
'com_id'
,
$session
[
'all_companys'
]);
}
$data
=
$data
->
select
(
'com_id'
,
'com_name'
)
->
get
()
->
toarray
();
return
$this
->
success
(
'获取成功'
,
$data
);
...
...
@@ -1300,6 +1303,7 @@ class CommonController extends BaseController
$data
=
new
Company
();
$data
=
$data
->
where
(
'com_type'
,
1
)
->
where
(
'com_id'
,
'!='
,
1
)
->
whereIn
(
'com_id'
,
$session
[
'all_companys'
])
->
where
(
function
(
$query
)
use
(
$request
)
{
if
(
!
empty
(
$request
[
'com_name'
]
))
{
$query
->
where
(
'com_name'
,
$request
[
'com_name'
]);
...
...
app/Http/Controllers/Common/CompanyController.php
浏览文件 @
19c0b50a
...
...
@@ -100,6 +100,7 @@ class CompanyController extends BaseController
$res
=
Company
::
insert
(
$dataArr
);
if
(
$res
){
CommonService
::
resetToken
(
$request
->
get
(
'session_token'
));
$this
->
insertingLog
(
'添加公司,'
,
''
,
$com_name
,
'公司管理'
,
$request
->
ip
(),
$request
->
get
(
'session_token'
)[
'admin_acc'
]);
return
$this
->
success
(
'添加成功'
,
[]);
}
else
{
...
...
app/Http/Controllers/Common/GoodsBrandController.php
浏览文件 @
19c0b50a
...
...
@@ -33,7 +33,9 @@ class GoodsBrandController extends BaseController
$page
=
1
;
}
$paginate
=
new
GoodsBrand
();
$paginate
=
$paginate
->
where
(
"company_id"
,
$request
->
get
(
'session_token'
)[
'company_id'
]);
if
(
!
in_array
(
$request
->
get
(
'session_token'
)[
'admin_groupnew'
],[
7
,
8
]))
{
$paginate
=
$paginate
->
where
(
"company_id"
,
$request
->
get
(
'session_token'
)[
'company_id'
]);
}
$paginate
=
$paginate
->
OrderBy
(
'sord'
,
'ASC'
)
->
paginate
(
$page_size
);
$list
=
self
::
dataToArray
(
$paginate
->
items
());
...
...
app/Http/Controllers/Common/GoodsController.php
浏览文件 @
19c0b50a
...
...
@@ -47,7 +47,7 @@ class GoodsController extends BaseController
}
$page_size
=
$request
->
input
(
'page_size'
,
10
);
$page
=
$request
->
input
(
'page'
,
1
);
if
(
$session
[
'admin_groupnew'
]
!=
7
)
{
if
(
!
in_array
(
$request
->
get
(
'session_token'
)[
'admin_groupnew'
],[
7
,
8
])
)
{
$Db
=
$Db
->
where
(
'company_id'
,
$session
[
'company_id'
]);
}
if
(
$page
<
1
){
...
...
app/Http/Controllers/DatasBase/BserviStoreController.php
浏览文件 @
19c0b50a
...
...
@@ -36,12 +36,9 @@ class BserviStoreController extends BaseController
$page
=
1
;
}
$offset
=
(
$page
-
1
)
*
$page_size
;
if
(
in_array
(
$admin_groupnew
,
[
7
,
79
,
86
,
89
]))
{
$Db
=
BserviStore
::
leftJoin
(
'admin'
,
'admin.id'
,
'='
,
'bservi_store.bs_serid'
);
}
elseif
(
$admin_groupnew
==
2
)
{
$Db
=
BserviStore
::
leftJoin
(
'admin'
,
'admin.id'
,
'='
,
'bservi_store.bs_serid'
)
->
where
(
'bservi_store.bs_serid'
,
$id
);
}
else
{
$Db
=
BserviStore
::
leftJoin
(
'admin'
,
'admin.id'
,
'='
,
'bservi_store.bs_serid'
);
if
(
$admin_groupnew
==
2
)
{
$Db
=
$Db
->
where
(
'bservi_store.bs_serid'
,
$id
);
}
if
(
$request
->
filled
(
'are_shi'
)){
//市
...
...
@@ -65,9 +62,12 @@ class BserviStoreController extends BaseController
}
}
$session
=
$request
->
get
(
'session_token'
);
if
(
$admin_groupnew
!=
7
){
if
(
!
in_array
(
$admin_groupnew
,[
7
,
8
])
){
$Db
=
$Db
->
where
(
'admin.company_id'
,
$session
[
'company_id'
]);
}
if
(
in_array
(
$session
[
'admin_groupnew'
],[
8
]))
{
$Db
=
$Db
->
whereIn
(
'admin.company_id'
,
$session
[
'all_company'
]);
}
$count
=
$Db
->
count
();
$list
=
$Db
->
select
(
'bservi_store.*'
,
'admin.company_name'
)
->
offset
(
$offset
)
->
limit
(
$page_size
)
->
get
();
...
...
app/Http/Controllers/DatasBase/BservissController.php
浏览文件 @
19c0b50a
...
...
@@ -54,9 +54,12 @@ class BservissController extends BaseController
if
(
$request
->
filled
(
'ser_id'
)){
//服务中心名称
$Db
=
$Db
->
where
(
'bs_serid'
,
$request
->
input
(
'ser_id'
));
}
if
(
$request
->
get
(
'session_token'
)[
'admin_groupnew'
]
!=
7
)
{
//管理员可以看全部
if
(
!
in_array
(
$request
->
get
(
'session_token'
)[
'admin_groupnew'
],[
7
,
8
]))
{
$Db
=
$Db
->
where
(
'admin.company_id'
,
$request
->
get
(
'session_token'
)[
'company_id'
]);
}
if
(
in_array
(
$request
->
get
(
'session_token'
)[
'admin_groupnew'
],[
8
]))
{
$Db
=
$Db
->
whereIn
(
'admin.company_id'
,
$request
->
get
(
'session_token'
)[
'all_company'
]);
}
$count
=
$Db
->
count
();
if
(
$request
->
input
(
'is_excel'
)
==
1
){
DB
::
connection
()
->
enableQueryLog
();
#开启执行日志
...
...
@@ -263,10 +266,15 @@ class BservissController extends BaseController
if
(
!
$request
->
filled
(
'company_name'
)
||!
$request
->
filled
(
'are_sid'
)){
return
$this
->
error
(
'参数错误无company_name或无are_sid'
,
ErrorInc
::
FAILED_PARAM
);
}
$session
=
$request
->
get
(
'session_token'
);
$company_name
=
$request
->
input
(
'company_name'
);
$are_sid
=
$request
->
input
(
'are_sid'
);
$serid
=
Bserviss
::
distinct
()
->
where
(
'bs_sid'
,
$are_sid
)
->
pluck
(
'bs_serid'
)
->
toArray
();
$list
=
DB
::
table
(
'admin'
)
->
whereNotIn
(
'id'
,
$serid
)
->
where
(
'admin_groupnew'
,
2
)
->
where
(
'company_id'
,
$request
->
get
(
'session_token'
)[
'company_id'
])
->
where
(
'company_name'
,
'like'
,
'%'
.
$company_name
.
'%'
)
->
select
(
'id'
,
'company_name'
)
->
orderBy
(
'id'
,
'ASC'
)
->
limit
(
'10'
)
->
get
();
if
(
!
in_array
(
$session
[
'admin_groupnew'
],[
7
,
8
]))
{
$list
=
DB
::
table
(
'admin'
)
->
whereNotIn
(
'id'
,
$serid
)
->
where
(
'admin_groupnew'
,
2
)
->
where
(
'company_id'
,
$request
->
get
(
'session_token'
)[
'company_id'
])
->
where
(
'company_name'
,
'like'
,
'%'
.
$company_name
.
'%'
)
->
select
(
'id'
,
'company_name'
)
->
orderBy
(
'id'
,
'ASC'
)
->
limit
(
'10'
)
->
get
();
}
else
{
$list
=
DB
::
table
(
'admin'
)
->
whereNotIn
(
'id'
,
$serid
)
->
whereIn
(
'admin_groupnew'
,
[
2
,
3
])
->
whereIn
(
'company_id'
,
$session
[
'all_company'
])
->
where
(
'company_name'
,
'like'
,
'%'
.
$company_name
.
'%'
)
->
select
(
'id'
,
'company_name'
)
->
orderBy
(
'id'
,
'ASC'
)
->
limit
(
'10'
)
->
get
();
}
if
(
!
$list
->
isEmpty
()){
return
$this
->
success
(
'获取成功'
,
$list
);
exit
;
}
else
{
...
...
@@ -286,6 +294,7 @@ class BservissController extends BaseController
*/
public
function
search_brand
(
Request
$request
)
{
$session
=
$request
->
get
(
'session_token'
);
if
(
$request
->
input
(
'type'
)
==
1
){
if
(
$request
->
filled
(
'serid'
)
&&
$request
->
filled
(
'bs_sid'
)){
$serid
=
$request
->
input
(
'serid'
);
...
...
@@ -296,7 +305,13 @@ class BservissController extends BaseController
foreach
(
$bsArr
as
$k
=>
$v
){
$brandid
[]
=
$v
[
'bs_branid'
];
}
$brands
=
DB
::
table
(
'goods_brand'
)
->
where
(
'company_id'
,
$request
->
get
(
'session_token'
)[
'company_id'
])
->
get
()
->
toArray
();
if
(
$session
[
'admin_groupnew'
]
==
7
){
$brands
=
DB
::
table
(
'goods_brand'
)
->
get
()
->
toArray
();
}
elseif
(
$session
[
'admin_groupnew'
]
==
8
){
$brands
=
DB
::
table
(
'goods_brand'
)
->
where
(
'company_id'
,
$session
[
'company_id'
])
->
get
()
->
toArray
();
}
else
{
$brands
=
DB
::
table
(
'goods_brand'
)
->
whereIn
(
'id'
,
explode
(
','
,
$session
[
'com_brand'
]))
->
get
()
->
toArray
();
}
if
(
!
$brands
){
return
$this
->
error
(
'暂无数据1'
,
ErrorInc
::
DATA_EMPTY
);
exit
;
}
...
...
@@ -322,19 +337,6 @@ class BservissController extends BaseController
$list
[
$k
][
'bs_min'
]
=
''
;
$list
[
$k
][
'bs_areid'
]
=
[];
}
// foreach ($bsArr as $ks=>$vs){
// if ($vs['bs_branid'] == $v['id']){
// $list[$k]['bs_brantype'] = $vs['bs_brantype'];
// $list[$k]['bs_max'] = $vs['bs_max'];
// $list[$k]['bs_min'] = $vs['bs_min'];
// //$list[$k]['bs_id'] = $vs['bs_id'];
// break;
// }else{
// $list[$k]['bs_brantype'] = '';
// $list[$k]['bs_max'] = '';
// $list[$k]['bs_min'] = '';
// }
// }
}
if
(
$list
){
return
$this
->
success
(
'获取成功'
,
$list
);
exit
;
...
...
@@ -347,7 +349,13 @@ class BservissController extends BaseController
}
}
else
{
$res
=
DB
::
table
(
"goods_brand"
)
->
where
(
'company_id'
,
$request
->
get
(
'session_token'
)[
'company_id'
])
->
select
(
'id'
,
'brand_name'
)
->
get
();
if
(
$session
[
'admin_groupnew'
]
==
7
){
$res
=
DB
::
table
(
'goods_brand'
)
->
select
(
'id'
,
'brand_name'
)
->
get
();
}
elseif
(
$session
[
'admin_groupnew'
]
==
8
){
$res
=
DB
::
table
(
'goods_brand'
)
->
where
(
'company_id'
,
$session
[
'company_id'
])
->
select
(
'id'
,
'brand_name'
)
->
get
();
}
else
{
$res
=
DB
::
table
(
'goods_brand'
)
->
whereIn
(
'id'
,
explode
(
','
,
$session
[
'com_brand'
]))
->
select
(
'id'
,
'brand_name'
)
->
get
();
}
if
(
!
$res
->
isEmpty
()){
$res
=
$res
->
toArray
();
$list
=
[];
...
...
app/Http/Controllers/DatasBase/TipsController.php
浏览文件 @
19c0b50a
...
...
@@ -49,7 +49,10 @@ class TipsController extends BaseController
$sertime
=
date
(
'Y-m-d H:i:s'
,
$sertime
);
$looktime
=
$date
-
'3600'
;
$looktime
=
date
(
'Y-m-d H:i:s'
,
$looktime
);
$where
=
"sin_type=1 AND gone_orders.reminder=1 AND gone_orders.is_delete=2 and gone_orders.p_id in ("
.
$admin_pt_id
.
")"
;
$where
=
"sin_type=1 AND gone_orders.reminder=1 AND gone_orders.is_delete=2"
;
if
(
!
in_array
(
$request
->
get
(
'session_token'
)[
'admin_groupnew'
],[
7
,
8
])
&&
!
empty
(
$admin_pt_id
)){
$where
.=
" and gone_orders.p_id in ("
.
$admin_pt_id
.
")"
;
}
$wxnum
=
Db
::
table
(
'ser_master'
)
->
where
(
'follow'
,
'5'
)
->
count
();
CommonService
::
startmysql
();
$aftertrack
=
OrderAftertrack
::
where
(
"oat_state"
,
1
)
->
where
(
'oat_looktime'
,
'<'
,
$looktime
)
->
count
();
...
...
@@ -59,18 +62,24 @@ class TipsController extends BaseController
$Aftersale
=
OrderAfter
::
where
(
'create_time'
,
'<='
,
$twelve
)
->
where
(
'status'
,
'1'
)
->
count
();
$sendorders
=
SendGoods
::
where
(
'time'
,
'<='
,
$sendtime
)
->
where
(
'type'
,
'<='
,
'2'
)
->
count
();
$Db
=
SerInfor
::
join
(
'orders'
,
'orders.sys_num'
,
'='
,
'ser_infor.sin_sysnum'
)
->
leftJoin
(
'user'
,
'user.id'
,
'='
,
'orders.customer_id'
)
->
whereRaw
(
$where
);
if
(
$request
->
get
(
'session_token'
)[
'admin_groupnew'
]
!=
7
){
if
(
!
in_array
(
$request
->
get
(
'session_token'
)[
'admin_groupnew'
],[
7
,
8
])
){
$Db
=
$Db
->
where
(
'orders.company_id'
,
$request
->
get
(
'session_token'
)[
'company_id'
]);
}
if
(
in_array
(
$request
->
get
(
'session_token'
)[
'admin_groupnew'
],[
8
])){
$Db
=
$Db
->
where
(
'orders.company_id'
,
'>'
,
1
);
}
$ser_infor
=
$Db
->
where
(
'sin_state'
,
'1'
)
->
where
(
'orders.order_status'
,
'<'
,
34
)
->
count
();
}
else
{
$refund
=
Refund
::
where
(
'state'
,
'0'
)
->
count
();
$Aftersale
=
OrderAfter
::
where
(
'status'
,
'1'
)
->
count
();
$sendorders
=
SendGoods
::
where
(
'time'
,
'<='
,
$sendtime
)
->
where
(
'type'
,
'<='
,
'2'
)
->
count
();
$Db
=
SerInfor
::
join
(
'orders'
,
'orders.sys_num'
,
'='
,
'ser_infor.sin_sysnum'
)
->
leftJoin
(
'user'
,
'user.id'
,
'='
,
'orders.customer_id'
)
->
whereRaw
(
$where
);
if
(
$request
->
get
(
'session_token'
)[
'admin_groupnew'
]
!=
7
){
if
(
!
in_array
(
$request
->
get
(
'session_token'
)[
'admin_groupnew'
],[
7
,
8
])
){
$Db
=
$Db
->
where
(
'orders.company_id'
,
$request
->
get
(
'session_token'
)[
'company_id'
]);
}
if
(
in_array
(
$request
->
get
(
'session_token'
)[
'admin_groupnew'
],[
8
])){
$Db
=
$Db
->
where
(
'orders.company_id'
,
'>'
,
1
);
}
$ser_infor
=
$Db
->
where
(
'sin_state'
,
'1'
)
->
where
(
'orders.order_status'
,
'<'
,
34
)
->
count
();
}
$massage_power
=
$request
->
input
(
'massage_power'
);
...
...
app/Http/Controllers/InstallPerson/InstallPersonController.php
浏览文件 @
19c0b50a
...
...
@@ -3,6 +3,7 @@
namespace
App\Http\Controllers\InstallPerson
;
use
App\Http\Controllers\Common\CommonController
;
use
App\Models\Company
;
use
App\Services\ExceloutService
;
use
Illuminate\Database\Eloquent\Model
;
use
Illuminate\Http\Request
;
...
...
@@ -42,30 +43,42 @@ class InstallPersonController extends BaseController
$installperson
=
new
InstallPerson
();
$company_name
=
$request
->
input
(
'company_name'
,
0
);
if
(
$request
->
input
(
'Theshy'
)
==
4
){
$
installperson
=
$installperson
->
where
(
'delet_y'
,
1
)
;
$
where
[
'delet_y'
]
=
1
;
}
elseif
(
$request
->
input
(
'Theshy'
)
==
1
){
//未认证
$installperson
=
$installperson
->
where
(
'verify_type'
,
1
)
->
where
(
'delet_y'
,
1
);
$where
[
'verify_type'
]
=
1
;
$where
[
'delet_y'
]
=
1
;
}
elseif
(
$request
->
input
(
'Theshy'
)
==
2
){
//待审核
$installperson
=
$installperson
->
where
(
'verify_type'
,
2
)
->
where
(
'delet_y'
,
1
);
$where
[
'verify_type'
]
=
2
;
$where
[
'delet_y'
]
=
1
;
}
elseif
(
$request
->
input
(
'Theshy'
)
==
3
){
//已验证
$installperson
=
$installperson
->
where
(
'verify_type'
,
3
)
->
where
(
'delet_y'
,
1
);
$where
[
'verify_type'
]
=
3
;
$where
[
'delet_y'
]
=
1
;
}
else
{
$
installperson
=
$installperson
->
where
(
'delet_y'
,
1
)
;
$
where
[
'delet_y'
]
=
1
;
}
if
(
$request
->
filled
(
'check_code'
)){
//检验码
$installperson
=
$installperson
->
where
(
'check_code'
,
'like'
,
'%'
.
$request
->
input
(
'check_code'
)
.
'%'
);
$where
[
'check_code_like'
]
=
$request
->
input
(
'check_code'
);
$wheres
[
'check_code_like'
]
=
$request
->
input
(
'check_code'
);
}
if
(
$request
->
filled
(
'install_name'
)){
//安装人姓名
$installperson
=
$installperson
->
where
(
'install_name'
,
'like'
,
'%'
.
$request
->
input
(
'install_name'
)
.
'%'
);
$where
[
'install_name_like'
]
=
$request
->
input
(
'install_name'
);
$wheres
[
'install_name_like'
]
=
$request
->
input
(
'install_name'
);
}
if
(
$request
->
filled
(
'install_phone'
)){
//安装人电话
$installperson
=
$installperson
->
where
(
'install_phone'
,
'like'
,
'%'
.
$request
->
input
(
'install_phone'
)
.
'%'
);
$where
[
'install_phone_like'
]
=
$request
->
input
(
'install_phone'
);
$wheres
[
'install_phone_like'
]
=
$request
->
input
(
'install_phone'
);
}
if
(
$request
->
filled
(
'company_name_id'
)){
//服务中心id
$installperson
=
$installperson
->
where
(
'admin_id'
,
$request
->
input
(
'company_name_id'
));
$where
[
'admin_id'
]
=
$request
->
input
(
'company_name_id'
);
$wheres
[
'admin_id'
]
=
$request
->
input
(
'company_name_id'
);
}
if
(
$session
[
'admin_groupnew'
]
!=
7
)
{
$installperson
->
where
(
'company_id'
,
$session
[
'company_id'
]);
if
(
!
in_array
(
$session
[
'admin_groupnew'
],[
7
,
8
]))
{
$where
[
'company_id'
]
=
$session
[
'company_id'
];
$wheres
[
'company_id'
]
=
$session
[
'company_id'
];
}
if
(
in_array
(
$session
[
'admin_groupnew'
],[
8
]))
{
$where
[
'company_id_searchin'
]
=
$session
[
'all_company'
];
$wheres
[
'company_id_searchin'
]
=
$session
[
'all_company'
];
}
$page_size
=
(
int
)
$request
->
input
(
'page_size'
,
20
);
$page
=
(
int
)
$request
->
input
(
'page'
,
1
);
...
...
@@ -81,8 +94,8 @@ class InstallPersonController extends BaseController
// if ($session['admin_groupnew'] != 7){//管理员可以看全部
// $installperson = $installperson->where('company_id',$session['company_id']);
// }
$paginate
=
$installperson
->
select
(
'id'
,
'cd_ids'
,
'check_code'
,
'install_name'
,
'install_phone'
,
'install_remark'
,
'install_address'
,
'installation'
,
'install_is_type'
,
'create_time'
,
'admin_id'
,
'all_show'
,
'install_is_type'
,
'install_pid'
,
'company_id'
,
'delet_y'
,
'is_shman'
,
'affiliation'
)
->
orderBy
(
'id'
,
'ASC'
)
->
paginate
(
$page_size
);
$where
=
CommonService
::
jointWhere
(
$where
);
$paginate
=
$installperson
->
whereRaw
(
$where
)
->
select
(
'id'
,
'cd_ids'
,
'check_code'
,
'install_name'
,
'install_phone'
,
'install_remark'
,
'install_address'
,
'installation'
,
'install_is_type'
,
'create_time'
,
'admin_id'
,
'all_show'
,
'install_is_type'
,
'install_pid'
,
'company_id'
,
'delet_y'
,
'is_shman'
,
'affiliation'
)
->
orderBy
(
'id'
,
'ASC'
)
->
paginate
(
$page_size
);
$list
=
self
::
dataToArray
(
$paginate
->
items
());
//导出 start
...
...
@@ -92,12 +105,12 @@ class InstallPersonController extends BaseController
return
$excel
->
getExcelOut
(
$request
->
input
(
'Pri_id'
),
$sqls
,
$session
);
}
//导出 end
$count_qb
=
InstallPerson
::
count
();
//总数
$count_wrz
=
InstallPerson
::
where
(
'delet_y'
,
1
)
->
where
(
'verify_type'
,
1
)
->
count
();
//未认证
$count_dsh
=
InstallPerson
::
where
(
'delet_y'
,
1
)
->
where
(
'verify_type'
,
2
)
->
count
();
//待审核
$count_yyz
=
InstallPerson
::
where
(
'delet_y'
,
1
)
->
where
(
'verify_type'
,
3
)
->
count
();
//已验证
$count_xsq
=
InstallPerson
::
where
(
'delet_y'
,
3
)
->
count
();
//新申请
$wheres
=
CommonService
::
jointWhere
(
$wheres
);
$count_qb
=
InstallPerson
::
whereRaw
(
$wheres
)
->
count
();
//总数
$count_wrz
=
InstallPerson
::
where
Raw
(
$wheres
)
->
where
(
'delet_y'
,
1
)
->
where
(
'verify_type'
,
1
)
->
count
();
//未认证
$count_dsh
=
InstallPerson
::
where
Raw
(
$wheres
)
->
where
(
'delet_y'
,
1
)
->
where
(
'verify_type'
,
2
)
->
count
();
//待审核
$count_yyz
=
InstallPerson
::
where
Raw
(
$wheres
)
->
where
(
'delet_y'
,
1
)
->
where
(
'verify_type'
,
3
)
->
count
();
//已验证
$count_xsq
=
InstallPerson
::
where
Raw
(
$wheres
)
->
where
(
'delet_y'
,
3
)
->
count
();
//新申请
$data
[
'show_Menu'
]
=
[
[
'show_name'
=>
'全部'
,
'status'
=>
4
,
'show_num'
=>
$count_qb
,
'checked'
=>
true
],
...
...
app/Http/Controllers/Orders/AotuorderController.php
浏览文件 @
19c0b50a
...
...
@@ -85,7 +85,7 @@ class AotuorderController extends BaseController
// return true;
// }
// }
$goodid
=
DB
::
table
(
"goods_brand"
)
->
where
(
'brand_name'
,
$goods_brand
[
0
][
'goods_brand'
])
->
where
(
'company_id'
,
$order
[
'company_id'
])
->
value
(
"id"
);
$goodid
=
DB
::
table
(
"goods_brand"
)
->
where
(
'brand_name'
,
$goods_brand
[
0
][
'goods_brand'
])
->
value
(
"id"
);
if
(
strstr
(
$user
[
'shr_sheng'
],
"市"
)){
//$sheng=rtrim($user['shr_sheng'],'市');
$sheng
=
str_replace
(
"市"
,
""
,
$user
[
'shr_sheng'
]);
...
...
@@ -143,7 +143,7 @@ class AotuorderController extends BaseController
$data
[
'code'
]
=
'2'
;
if
(
$data
[
'code'
]
==
'1'
){
}
else
{
if
(
$sheng
==
'北京
'
&&
$shi
==
'大兴
'
){
if
(
$sheng
==
'北京
s'
&&
$shi
==
'大兴s
'
){
$where
=
' and (admin_groupnew=3 or (admin_groupnew=2 and company_type=2))'
;
}
else
{
$where
=
' and admin_groupnew=2 and company_type=1 and company_id='
.
$order
[
'company_id'
];
...
...
@@ -349,14 +349,17 @@ class AotuorderController extends BaseController
$data
[
'msg'
]
=
"派单失败,该订单状态不正确,请刷新核实!"
;
return
$data
;
}
DB
::
beginTransaction
();
// 派单扣除 订单所属公司金额
// 扣费
$post_data
[
'adm_id'
]
=
$orderinfo
[
'admin_id'
]
;
$post_data
[
'adm_id'
]
=
0
;
$post_data
[
'company_id'
]
=
$orderinfo
[
'company_id'
];
$post_data
[
'order_number'
]
=
$
sys_num
;
$post_data
[
'order_number'
]
=
$
orderinfo
[
'order_num'
]
;
$post_data
[
'reo_price'
]
=
-
0.5
;
$post_data
[
'reo_pay_way'
]
=
4
;
$reduce_price
=
OrderDeductionFeeService
::
deductFee
(
$post_data
);
if
(
$reduce_price
[
'code'
]
!=
200
)
{
DB
::
rollback
();
$data
[
'code'
]
=
2
;
$data
[
'msg'
]
=
"余额不足"
;
return
$data
;
...
...
@@ -391,6 +394,7 @@ class AotuorderController extends BaseController
foreach
(
$ordermsginfo
as
$k
=>
$v
){
$orderlistIds
=
DB
::
table
(
'order_list'
)
->
where
(
'sys_num'
,
$sys_num
)
->
where
(
'order_goods_id'
,
$v
[
'id'
])
->
value
(
"id"
);
if
(
isset
(
$orderlistIds
)){
DB
::
rollback
();
$data
[
'code'
]
=
2
;
$data
[
'msg'
]
=
"派单失败,该订单已被派发"
;
return
$data
;
...
...
@@ -556,6 +560,7 @@ class AotuorderController extends BaseController
$pop
[
'company_name'
]
=
CompanyService
::
getCompanyById
(
$orderinfo
[
'company_id'
],[
'com_name'
],
'value'
);
$store
=
SysStoresService
::
sysStore
(
$pop
,
'orderUrl'
,
$store
);
if
(
$store
[
'ErrorCode'
]
!=
1
){
DB
::
rollback
();
$data
[
'code'
]
=
$store
[
'ErrorCode'
];
$data
[
'msg'
]
=
$store
[
'ErrorMessage'
];
return
$data
;
...
...
@@ -632,6 +637,7 @@ class AotuorderController extends BaseController
// $post['distype']='2';
$returnOrder
=
DB
::
table
(
'orders'
)
->
where
(
'sys_num'
,
$sys_num
)
->
update
(
$post
);
if
(
$returnOrder
&&
$returnOrderList
&&
$returnMan
){
DB
::
commit
();
$file_path
=
"./url.txt"
;
$myfile
=
fopen
(
$file_path
,
"a"
);
$txt
=
date
(
"Y-m-d H:i:s"
)
.
"--"
.
$sys_num
.
"--"
.
$ser_id
.
"--"
.
$install
[
'check_code'
]
.
"
\r
"
;
...
...
@@ -660,12 +666,14 @@ class AotuorderController extends BaseController
$data
[
'msg'
]
=
"派单成功"
;
return
$data
;
}
else
{
DB
::
rollback
();
//$this->error("派单失败!");
$data
[
'code'
]
=
2
;
$data
[
'msg'
]
=
"派单失败"
;
return
$data
;
}
}
else
{
DB
::
rollback
();
//$this->error("派单失败!");
$data
[
'code'
]
=
2
;
$data
[
'msg'
]
=
"派单失败"
;
...
...
app/Http/Controllers/Orders/OrderListController.php
浏览文件 @
19c0b50a
...
...
@@ -143,37 +143,20 @@ class OrderListController extends BaseController
}
$session_token
=
$request
->
get
(
'session_token'
);
if
(
$session_token
[
'admin_groupnew'
]
==
2
){
$ansql
=
" ser_id in ("
.
$session_token
[
'id'
]
.
")"
;
}
elseif
(
$session_token
[
'com_type'
]
==
2
){
$where
.=
" and agency_id='"
.
$session_token
[
'company_id'
]
.
"'"
;
}
else
{
if
(
!
in_array
(
$session_token
[
'admin_groupnew'
],[
7
,
8
]))
{
$ansql
=
" p_id in ("
.
$session_token
[
'admin_pt_id'
]
.
")"
;
}
//$ansql = "p_id in (".$session_token['admin_pt_id'].")";
}
// if($session_token['admin_groupnew']!=7){
// $where .= ' and company_id='.$session_token['company_id'];
// }
if
(
!
in_array
(
$session_token
[
'admin_groupnew'
],
[
2
,
3
,
7
])){
//管理员可以看全部
if
(
!
in_array
(
$session_token
[
'admin_groupnew'
],
[
2
,
3
,
7
,
8
])){
//管理员可以看全部
$where
.=
" and company_id='"
.
$session_token
[
'company_id'
]
.
"'"
;
}
if
(
$session_token
[
'admin_groupnew'
]
==
3
)
{
$where
.=
" and agency_id='"
.
$session_token
[
'company_id'
]
.
"'"
;
// $where['gone_order_list.agency_id'] = $session['company_id'];
if
(
in_array
(
$session_token
[
'admin_groupnew'
],
[
2
,
3
,
8
])){
//管理员可以看全部
$where
.=
" and company_id>1"
;
}
//统计数量
// $show_nums = OrderList::whereRaw($where)->where('stauas','!=',40)->selectRaw("stauas,count('id') as num")->groupBy('stauas')->get()->toArray();
$wjd
=
OrderList
::
whereRaw
(
$where
)
->
whereRaw
(
"(stauas = 10 or stauas = 20)"
)
->
count
();
$dwc
=
OrderList
::
whereRaw
(
$where
)
->
where
(
'stauas'
,
34
)
->
where
(
'delay_status'
,
1
)
->
count
();
$dasql
=
"stauas=30 AND (day_time<'"
.
$time
.
"' OR day_time is null)"
;
if
(
$session_token
[
'admin_groupnew'
]
==
2
){
$azz
=
OrderList
::
whereRaw
(
$where
)
->
where
Raw
(
$ansql
)
->
where
([
'stauas'
=>
30
,
'invalid'
=>
1
])
->
count
();
$azz
=
OrderList
::
whereRaw
(
$where
)
->
where
([
'stauas'
=>
30
,
'invalid'
=>
1
])
->
count
();
}
else
{
$azz
=
OrderList
::
whereRaw
(
$where
)
->
whereRaw
(
$dasql
)
->
count
();
}
...
...
app/Http/Controllers/Service/ServiceProviderController.php
浏览文件 @
19c0b50a
...
...
@@ -415,11 +415,13 @@ class ServiceProviderController extends BaseController
$session
=
Request
()
->
get
(
'session_token'
);
//用户信息
$brandList
=
PjBrandsService
::
getAll
();
//品牌
if
(
$session
[
'com_type'
]
==
2
){
$agent_brand
=
trim
(
$session
[
'
agent
_brand'
],
','
);
$agent_brand
=
trim
(
$session
[
'
com
_brand'
],
','
);
$agent_brand
=
explode
(
','
,
$agent_brand
);
$brandList
=
CommonService
::
arrayFilterFieldValue
(
$brandList
,[[
'id'
=>
$agent_brand
]]);
}
else
{
$brandList
=
CommonService
::
arrayFilterFieldValue
(
$brandList
,[[
'company_id'
=>
$session
[
'company_id'
]]]);
$agent_brand
=
trim
(
$session
[
'com_brand'
],
','
);
$agent_brand
=
explode
(
','
,
$agent_brand
);
$brandList
=
CommonService
::
arrayFilterFieldValue
(
$brandList
,[[
'id'
=>
$agent_brand
]]);
}
$serviceTypes
=
CategoryService
::
getAll
();
//服务类型
// $serviceItems = ServiceItemsService::getAll(); //服务项目
...
...
@@ -560,6 +562,8 @@ class ServiceProviderController extends BaseController
$com_data
[
'com_create_time'
]
=
date
(
'Y-m-d H:i:s'
);
$com_data
[
'com_end_time'
]
=
date
(
'Y-m-d H:i:s'
,
strtotime
(
'+50 year'
));
$com_data
[
'com_admin_id'
]
=
$session
[
'id'
];
$com_data
[
'com_parent_id'
]
=
$session
[
'com_parent_id'
];
$com_data
[
'com_brand'
]
=
$adminData
[
'agent_brand'
];
$company_id
=
DB
::
table
(
'company'
)
->
insertGetId
(
$com_data
);
$adminData
[
'company_id'
]
=
$company_id
;
// 新增默认仓库
...
...
@@ -624,6 +628,9 @@ class ServiceProviderController extends BaseController
$content
=
$session
[
'admin_acc'
]
.
"成员"
.
$request
->
input
(
'admin_acc'
);
$this
->
insertingLog
(
'添加,'
,
''
,
$content
,
'服务商管理'
,
$request
->
ip
(),
$session
[
'admin_acc'
]);
//日志
DB
::
commit
();
if
(
$adminData
[
'admin_groupnew'
]
==
3
)
{
//经销商新增一个公司
CommonService
::
resetToken
(
$session
);
}
return
response
()
->
json
([
'Data'
=>
''
,
'ErrorMessage'
=>
'添加成功'
,
'ErrorCode'
=>
1
]);
}
else
{
DB
::
rollback
();
...
...
app/Http/Controllers/Service/SupplierPriceController.php
浏览文件 @
19c0b50a
...
...
@@ -90,8 +90,11 @@ public function index(Request $request)
{
$session
=
$request
->
get
(
'session_token'
);
$data
=
$this
->
dataService
->
search_s
(
$request
->
all
(),
[
'*'
],
1
,
20
,
$session
);
$page
=
Request
()
->
input
(
'page'
,
1
);
if
(
$page
<
1
)
{
$page
=
1
;
}
$data
=
$this
->
dataService
->
search_s
(
$request
->
all
(),
[
'*'
],
$page
,
20
,
$session
);
if
(
method_exists
(
$this
->
dataService
,
'formatPageContent'
))
{
//根据权限格式化页面button
$token
=
$request
->
input
(
'token'
);
...
...
app/Http/Controllers/Service/WarehouseController.php
浏览文件 @
19c0b50a
...
...
@@ -50,9 +50,12 @@ class WarehouseController extends BaseController
}
$page_size
=
$request
->
input
(
'page_size'
,
10
);
$page
=
$request
->
input
(
'page'
,
1
);
if
(
$session
[
'admin_groupnew'
]
!=
7
)
{
if
(
!
in_array
(
$session
[
'admin_groupnew'
],[
7
,
8
])
)
{
$Db
=
$Db
->
where
(
'company_id'
,
$session
[
'company_id'
]);
}
if
(
in_array
(
$session
[
'admin_groupnew'
],[
8
]))
{
$Db
=
$Db
->
whereIn
(
'company_id'
,
$session
[
'all_company'
]);
}
if
(
$page
<
1
){
$page
=
1
;
}
...
...
@@ -79,7 +82,7 @@ class WarehouseController extends BaseController
$list
[
$k
][
'comapny_name'
]
=
DB
::
table
(
'company'
)
->
where
(
'com_id'
,
$v
[
'company_id'
])
->
value
(
'com_name'
);
if
(
$session
[
'admin_groupnew'
]
==
7
)
{
if
(
in_array
(
$session
[
'admin_groupnew'
],[
7
,
8
])
)
{
$button
=
[
'wareGoods'
,
'addGoodsNum'
];
}
else
{
$button
=
[
'wareGoods'
];
...
...
@@ -253,6 +256,12 @@ class WarehouseController extends BaseController
->
select
(
'shck_ckmc'
,
'pg_goodsname'
,
'goio_num'
,
'goio_type'
,
'goio_sys_num'
,
'goio_serial_number'
,
'goio_old_num'
,
'goio_new_num'
,
'com_name'
)
->
paginate
(
$page_size
);
$list
=
$paginate
->
items
();
$data
[
'page'
]
=
[
'count'
=>
$paginate
->
total
(),
'page'
=>
$paginate
->
currentPage
(),
'page_size'
=>
$page_size
,
'allPage'
=>
$paginate
->
lastPage
()
];
if
(
$list
){
foreach
(
$list
as
$k
=>
$v
){
if
(
empty
(
$v
[
'goio_sys_num'
]))
{
...
...
@@ -269,14 +278,9 @@ class WarehouseController extends BaseController
}
$data
[
'list'
]
=
$list
;
$data
[
'page'
]
=
[
'count'
=>
$paginate
->
total
(),
'page'
=>
$paginate
->
currentPage
(),
'page_size'
=>
$page_size
,
'allPage'
=>
$paginate
->
lastPage
()
];
return
$this
->
success
(
'获取成功'
,
$data
);
}
else
{
$data
[
'list'
]
=
$list
;
return
$this
->
error
(
'暂无数据'
,
ErrorInc
::
DATA_EMPTY
,
$data
);
}
}
...
...
app/Http/Controllers/User/AdminsController.php
浏览文件 @
19c0b50a
...
...
@@ -74,9 +74,11 @@ class AdminsController extends BaseController
$Db
=
$Db
->
where
(
'admin_groupnew'
,
'!='
,
2
);
}
else
{
//其他只能看到除自己所属部门的成员
$Db
=
$Db
->
where
(
'admin_groupnew'
,
'!='
,
2
)
->
whereIn
(
'admin_groupnew'
,
$ids
)
->
where
(
'id'
,
'!='
,
$session
[
'id'
]);
//
if ($session['admin_groupnew'] != 8) {//管理员可以看全部
if
(
$session
[
'admin_groupnew'
]
!=
8
)
{
//管理员可以看全部
$Db
=
$Db
->
where
(
'company_id'
,
$session
[
'company_id'
]);
// }
}
else
{
$Db
=
$Db
->
whereIn
(
'company_id'
,
$session
[
'all_companys'
]);
}
}
$count
=
$Db
->
count
();
...
...
app/Http/Controllers/User/BmmcController.php
浏览文件 @
19c0b50a
...
...
@@ -42,9 +42,13 @@ class BmmcController extends BaseController
if
(
$request
->
get
(
'session_token'
)[
'admin_groupnew'
]
!=
'7'
){
// CommonService::startmysql();
$list
=
Bmmc
::
whereRaw
(
"FIND_IN_SET ('"
.
$request
->
get
(
'session_token'
)[
'admin_groupnew'
]
.
"',bmmc_pids) "
);
//
if($request->get('session_token')['admin_groupnew']!='8'){
if
(
$request
->
get
(
'session_token'
)[
'admin_groupnew'
]
!=
'8'
){
$list
=
$list
->
whereIn
(
'company_id'
,[
$request
->
get
(
'session_token'
)[
'company_id'
],
1
]);
// }
}
else
{
$all_companys
=
$request
->
get
(
'session_token'
)[
'all_companys'
];
$all_companys
[]
=
1
;
$list
=
$list
->
whereIn
(
'company_id'
,
$all_companys
);
}
$list
=
$list
->
select
(
'id'
,
'bmmc_name'
,
'bmmc_pid'
,
'bmmc_pids'
)
->
orderBy
(
'id'
,
'ASC'
)
->
get
();
// dump(CommonService::showmysql());
$parent_id
=
$request
->
get
(
'session_token'
)[
'admin_groupnew'
];
...
...
app/Http/Controllers/User/LoginController.php
浏览文件 @
19c0b50a
...
...
@@ -235,6 +235,26 @@ class LoginController extends BaseController
$com_parent_id
=
$company
[
'com_parent_id'
];
// $com_parent_id = Company::where("com_id",$result['company_id'])->value('com_parent_id');
$result
[
'com_parent_id'
]
=
$com_parent_id
.
","
.
$result
[
'company_id'
];
$result
[
'com_brand'
]
=
$company
[
'com_brand'
];
$all_company
=
Company
::
whereRaw
(
"FIND_IN_SET("
.
$result
[
'company_id'
]
.
",com_parent_id) and com_type=2"
)
->
select
(
'com_id'
)
->
get
();
$all_company
=
CommonService
::
dataToArray
(
$all_company
);
if
(
$all_company
){
$all_company
=
array_column
(
$all_company
,
'com_id'
);
$all_company
[]
=
$result
[
'company_id'
];
}
else
{
$all_company
=
[
$result
[
'company_id'
]];
}
$result
[
'all_company'
]
=
$all_company
;
$all_companys
=
Company
::
whereRaw
(
"FIND_IN_SET("
.
$result
[
'company_id'
]
.
",com_parent_id) and com_type=1"
)
->
select
(
'com_id'
)
->
get
();
$all_companys
=
CommonService
::
dataToArray
(
$all_companys
);
if
(
$all_companys
){
$all_companys
=
array_column
(
$all_companys
,
'com_id'
);
$all_companys
[]
=
$result
[
'company_id'
];
}
else
{
$all_companys
=
[
$result
[
'company_id'
]];
}
$result
[
'all_companys'
]
=
$all_companys
;
$result
[
'com_type'
]
=
$company
[
'com_type'
];
if
(
$company
[
'com_type'
]
==
2
){
$result
[
'search_id'
]
=
Admin
::
where
(
'company_id'
,
$result
[
'company_id'
])
->
where
(
"admin_groupnew"
,
3
)
->
value
(
'id'
);
...
...
app/Models/OrderCallphone.php
0 → 100644
浏览文件 @
19c0b50a
<?php
namespace
App\Models
;
use
Illuminate\Database\Eloquent\Model
;
class
OrderCallphone
extends
Model
{
protected
$table
=
'order_callphone'
;
// 拒绝添加的字段
protected
$guarded
=
[];
public
$timestamps
=
false
;
}
app/Services/Api/MobileWeb/LoginService.php
浏览文件 @
19c0b50a
...
...
@@ -55,7 +55,7 @@ class LoginService
if
(
$find_person
[
'install_is_type'
]
!=
1
)
{
return
[
'ErrorCode'
=>
203
,
'ErrorMessage'
=>
'当前账号已停用!'
,
'data'
=>
''
];
}
if
(
$request
[
'user_type'
]
==
2
&&
$company
[
'com_type'
]
==
2
){
if
(
$request
[
'user_type'
]
==
2
&&
$company
[
'com_type'
]
==
2
&&
$find_person
[
'admin_groupnew'
]
!=
2
){
$request
[
'user_type'
]
=
3
;
}
if
(
isset
(
$request
[
'openid'
])
&&
$request
[
'openid'
]
!=
''
)
{
...
...
@@ -63,6 +63,39 @@ class LoginService
$bingding_res
=
self
::
accreditBinding
(
$request
,
$find_person
);
}
if
(
$request
[
'user_type'
]
>
1
)
{
if
(
$company
[
'com_type'
]
==
2
&&
$find_person
[
'admin_groupnew'
]
==
2
){
$button
=
[
[
"pagePath"
=>
"/pages/index/index"
,
"text"
=>
"接单"
,
"iconPath"
=>
"tab_icon_01.png"
,
"selectedIconPath"
=>
"tab_icon_01_on.png"
,
'type'
=>
'OrderTaking'
],
[
"pagePath"
=>
"/pages/order/installOrderList"
,
"text"
=>
"安装"
,
"iconPath"
=>
"tab_icon_02.png"
,
"selectedIconPath"
=>
"tab_icon_02_on.png"
,
'type'
=>
'InstallOrder'
],
[
"pagePath"
=>
""
,
"text"
=>
"更多"
,
"iconPath"
=>
"tab_icon_04.png"
,
"selectedIconPath"
=>
"tab_icon_04_on.png"
,
'type'
=>
'moreButton'
]
];
}
else
{
$button
=
[
[
"pagePath"
=>
"/pages/index/index"
,
"text"
=>
"接单"
,
"iconPath"
=>
"tab_icon_01.png"
,
"selectedIconPath"
=>
"tab_icon_01_on.png"
,
'type'
=>
'OrderTaking'
],
[
"pagePath"
=>
"/pages/order/installOrderList"
,
"text"
=>
"安装"
,
"iconPath"
=>
"tab_icon_02.png"
,
"selectedIconPath"
=>
"tab_icon_02_on.png"
,
'type'
=>
'InstallOrder'
],
[
"pagePath"
=>
"/pages/order/billManagement"
,
"text"
=>
"账单"
,
"iconPath"
=>
"tab_icon_03.png"
,
"selectedIconPath"
=>
"tab_icon_03_on.png"
,
'type'
=>
'orderBill'
],
[
"pagePath"
=>
""
,
"text"
=>
"更多"
,
"iconPath"
=>
"tab_icon_04.png"
,
"selectedIconPath"
=>
"tab_icon_04_on.png"
,
'type'
=>
'moreButton'
]
];
}
$button_more
=
[
[
"pagePath"
=>
"/pages/order/afterOrderList"
,
"text"
=>
"售后"
,
"iconPath"
=>
""
,
"selectedIconPath"
=>
""
,
'type'
=>
'afterOrderList'
],
[
"pagePath"
=>
"/pages/login/forgotPassword"
,
"text"
=>
"修改密码"
,
"iconPath"
=>
""
,
"selectedIconPath"
=>
""
,
'type'
=>
'forgotPassword'
],
[
"pagePath"
=>
"/pages/technician/technicianList"
,
"text"
=>
"技师"
,
"iconPath"
=>
""
,
"selectedIconPath"
=>
""
,
'type'
=>
'technicianList'
],
[
"pagePath"
=>
""
,
"text"
=>
"退出"
,
"iconPath"
=>
""
,
"selectedIconPath"
=>
""
,
'type'
=>
'quit'
]
];
}
else
{
$button
=
[
[
"pagePath"
=>
"/pages/order/installOrderList"
,
"text"
=>
"安装"
,
"iconPath"
=>
"tab_icon_02.png"
,
"selectedIconPath"
=>
"tab_icon_02_on.png"
,
'type'
=>
'InstallOrder'
],
[
"pagePath"
=>
""
,
"text"
=>
"更多"
,
"iconPath"
=>
"tab_icon_04.png"
,
"selectedIconPath"
=>
"tab_icon_04_on.png"
,
'type'
=>
'moreButton'
]
];
$button_more
=
[
[
"pagePath"
=>
"/pages/order/afterOrderList"
,
"text"
=>
"售后"
,
"iconPath"
=>
""
,
"selectedIconPath"
=>
""
,
'type'
=>
'afterOrderList'
],
[
"pagePath"
=>
"/pages/login/forgotPassword"
,
"text"
=>
"修改密码"
,
"iconPath"
=>
""
,
"selectedIconPath"
=>
""
,
'type'
=>
'forgotPassword'
],
[
"pagePath"
=>
""
,
"text"
=>
"退出"
,
"iconPath"
=>
""
,
"selectedIconPath"
=>
""
,
'type'
=>
'quit'
]
];
}
$expiration_time
=
7
*
24
*
60
*
60
;
//登录过期时间
// 生成token
$unique_string
=
md5
(
uniqid
(
md5
(
microtime
(
true
))
.
rand
(
100000
,
999999
),
true
));
//生成唯一字符串
...
...
@@ -90,7 +123,16 @@ class LoginService
return
[
"ErrorCode"
=>
204
,
'ErrorMessage'
=>
'登录失败!1'
,
'data'
=>
''
];
}
// 返回数据
// // 返回数据
// $return_data = [
// 'api_token' => Crypt::encrypt($api_token), //生成前台token
// 'account' => $find_person['check_code'],
// 'install_name' => $find_person['install_name'],
// 'install_phone' => $find_person['install_phone'],
// 'install_id' => $find_person['id'],
// 'admin_id' => $find_person['admin_id'],
// 'company_id' => $find_person['company_id'],
// ];
$return_data
=
[
'api_token'
=>
Crypt
::
encrypt
(
$api_token
),
//生成前台token
'account'
=>
$find_person
[
'check_code'
],
...
...
@@ -99,6 +141,10 @@ class LoginService
'install_id'
=>
$find_person
[
'id'
],
'admin_id'
=>
$find_person
[
'admin_id'
],
'company_id'
=>
$find_person
[
'company_id'
],
'button'
=>
$button
,
'user_type'
=>
$request
[
'user_type'
],
'button_more'
=>
$button_more
,
'openid'
=>
$request
[
'openid'
],
];
return
[
'ErrorCode'
=>
1
,
'ErrorMessage'
=>
'登录成功'
,
'data'
=>
$return_data
];
}
...
...
@@ -124,31 +170,6 @@ class LoginService
if
(
empty
(
$lote_res
))
{
return
[
"ErrorCode"
=>
500
,
'ErrorMessage'
=>
'登录失败!2'
,
'data'
=>
''
];
}
if
(
$request
[
'user_type'
]
>
1
)
{
$button
=
[
[
"pagePath"
=>
"/pages/index/index"
,
"text"
=>
"接单"
,
"iconPath"
=>
"tab_icon_01.png"
,
"selectedIconPath"
=>
"tab_icon_01_on.png"
,
'type'
=>
'OrderTaking'
],
[
"pagePath"
=>
"/pages/order/installOrderList"
,
"text"
=>
"安装"
,
"iconPath"
=>
"tab_icon_02.png"
,
"selectedIconPath"
=>
"tab_icon_02_on.png"
,
'type'
=>
'InstallOrder'
],
[
"pagePath"
=>
"/pages/order/billManagement"
,
"text"
=>
"账单"
,
"iconPath"
=>
"tab_icon_03.png"
,
"selectedIconPath"
=>
"tab_icon_03_on.png"
,
'type'
=>
'orderBill'
],
[
"pagePath"
=>
""
,
"text"
=>
"更多"
,
"iconPath"
=>
"tab_icon_04.png"
,
"selectedIconPath"
=>
"tab_icon_04_on.png"
,
'type'
=>
'moreButton'
]
];
$button_more
=
[
[
"pagePath"
=>
"/pages/order/afterOrderList"
,
"text"
=>
"售后"
,
"iconPath"
=>
""
,
"selectedIconPath"
=>
""
,
'type'
=>
'afterOrderList'
],
[
"pagePath"
=>
"/pages/login/forgotPassword"
,
"text"
=>
"修改密码"
,
"iconPath"
=>
""
,
"selectedIconPath"
=>
""
,
'type'
=>
'forgotPassword'
],
[
"pagePath"
=>
"/pages/technician/technicianList"
,
"text"
=>
"技师"
,
"iconPath"
=>
""
,
"selectedIconPath"
=>
""
,
'type'
=>
'technicianList'
],
[
"pagePath"
=>
""
,
"text"
=>
"退出"
,
"iconPath"
=>
""
,
"selectedIconPath"
=>
""
,
'type'
=>
'quit'
]
];
}
else
{
$button
=
[
[
"pagePath"
=>
"/pages/order/installOrderList"
,
"text"
=>
"安装"
,
"iconPath"
=>
"tab_icon_02.png"
,
"selectedIconPath"
=>
"tab_icon_02_on.png"
,
'type'
=>
'InstallOrder'
],
[
"pagePath"
=>
""
,
"text"
=>
"更多"
,
"iconPath"
=>
"tab_icon_04.png"
,
"selectedIconPath"
=>
"tab_icon_04_on.png"
,
'type'
=>
'moreButton'
]
];
$button_more
=
[
[
"pagePath"
=>
"/pages/order/afterOrderList"
,
"text"
=>
"售后"
,
"iconPath"
=>
""
,
"selectedIconPath"
=>
""
,
'type'
=>
'afterOrderList'
],
[
"pagePath"
=>
"/pages/login/forgotPassword"
,
"text"
=>
"修改密码"
,
"iconPath"
=>
""
,
"selectedIconPath"
=>
""
,
'type'
=>
'forgotPassword'
],
[
"pagePath"
=>
""
,
"text"
=>
"退出"
,
"iconPath"
=>
""
,
"selectedIconPath"
=>
""
,
'type'
=>
'quit'
]
];
}
// 返回数据
$return_data
=
[
'api_token'
=>
Crypt
::
encrypt
(
$api_token
),
//生成前台token
...
...
app/Services/Api/MobileWeb/OrderListService.php
浏览文件 @
19c0b50a
...
...
@@ -158,6 +158,13 @@ class OrderListService extends Model
if
(
$session
[
'user_type'
]
!=
1
)
{
$list_items
[
$key
][
'button'
][]
=
[
'action'
=>
'transferOfOrder'
,
'name'
=>
'改派'
];
}
if
(
$value
[
'stauas'
]
==
30
){
if
(
isset
(
$installLine
[
$value
[
'serial_number'
]][
'line_state'
])
&&
$list_items
[
$key
][
'line_state'
]
>
1
)
{
$list_items
[
$key
][
'button'
][]
=
[
'action'
=>
'contact'
,
'name'
=>
'修改预约'
];
}
else
{
$list_items
[
$key
][
'button'
][]
=
[
'action'
=>
'contact'
,
'name'
=>
'预约时间'
];
}
}
}
if
(
$request
[
'stauas'
]
==
3
)
{
$list_items
[
$key
][
'line_state'
]
=
1
;
...
...
@@ -180,7 +187,11 @@ class OrderListService extends Model
;
break
;
}
if
(
$list_items
[
$key
][
'line_state'
]
==
1
){
$list_items
[
$key
][
'button'
][]
=
[
'action'
=>
'contact'
,
'name'
=>
'预约时间'
];
}
else
{
$list_items
[
$key
][
'button'
][]
=
[
'action'
=>
'contact'
,
'name'
=>
'修改预约'
];
}
}
else
{
$list_items
[
$key
][
'button'
][]
=
[
'action'
=>
'contact'
,
'name'
=>
'预约时间'
];
}
...
...
@@ -834,6 +845,13 @@ class OrderListService extends Model
if
(
$session
[
'user_type'
]
!=
1
)
{
$data
[
'button'
][]
=
[
'action'
=>
'transferOfOrder'
,
'name'
=>
'改派'
];
}
if
(
$orderListArr
[
'stauas'
]
==
30
){
if
(
isset
(
$installLine
)
&&
$installLine
>
1
)
{
$data
[
'button'
][]
=
[
'action'
=>
'contact'
,
'name'
=>
'修改预约'
];
}
else
{
$data
[
'button'
][]
=
[
'action'
=>
'contact'
,
'name'
=>
'预约时间'
];
}
}
}
if
(
$request
[
'stauas'
]
==
3
)
{
if
(
isset
(
$installLine
))
{
...
...
@@ -854,7 +872,11 @@ class OrderListService extends Model
;
break
;
}
if
(
$installLine
==
1
){
$data
[
'button'
][]
=
[
'action'
=>
'contact'
,
'name'
=>
'预约时间'
];
}
else
{
$data
[
'button'
][]
=
[
'action'
=>
'contact'
,
'name'
=>
'修改预约'
];
}
}
else
{
$data
[
'button'
][]
=
[
'action'
=>
'contact'
,
'name'
=>
'预约时间'
];
}
...
...
app/Services/CommonService.php
浏览文件 @
19c0b50a
...
...
@@ -12,12 +12,18 @@
namespace
App\Services
;
use
App\Models\Admin
;
use
App\Models\AdminInfor
;
use
App\Models\AdminToken
;
use
App\Models\ApplyNote
;
use
App\Models\Company
;
use
App\Models\Czrz
;
use
App\Models\Department
;
use
App\Models\Functions
;
use
App\Models\NoteDetail
;
use
App\Models\OrderAfter
;
use
App\Models\Orders
;
use
App\Models\Permissions
;
use
App\Models\SmsTemplate
;
use
App\Models\SyncStores
;
use
App\OtherModels\SmsRecord
;
...
...
@@ -1725,4 +1731,73 @@ class CommonService extends Service{
return
true
;
}
}
/**|---------------------------------------------------------------------------------
* @name 重置登录权限
* @param string ju_ordernum 订单单号
* @retrun \Illuminate\Http\JsonResponse /multitype:array
* @author dou 2024/9/27 14:37
* |---------------------------------------------------------------------------------
*/
public
static
function
resetToken
(
$session
){
$result
=
Admin
::
where
(
'id'
,
$session
[
'id'
])
->
first
();
$company
=
Company
::
where
(
"com_id"
,
$result
[
'company_id'
])
->
first
();
$com_parent_id
=
$company
[
'com_parent_id'
];
$result
[
'com_parent_id'
]
=
$com_parent_id
.
","
.
$result
[
'company_id'
];
$result
[
'com_brand'
]
=
$company
[
'com_brand'
];
$all_company
=
Company
::
whereRaw
(
"FIND_IN_SET("
.
$result
[
'company_id'
]
.
",com_parent_id) and com_type=2"
)
->
select
(
'com_id'
)
->
get
();
$all_company
=
CommonService
::
dataToArray
(
$all_company
);
if
(
$all_company
){
$all_company
=
array_column
(
$all_company
,
'com_id'
);
$all_company
[]
=
$result
[
'company_id'
];
}
else
{
$all_company
=
[
$result
[
'company_id'
]];
}
$result
[
'all_company'
]
=
$all_company
;
$all_companys
=
Company
::
whereRaw
(
"FIND_IN_SET("
.
$result
[
'company_id'
]
.
",com_parent_id) and com_type=1"
)
->
select
(
'com_id'
)
->
get
();
$all_companys
=
CommonService
::
dataToArray
(
$all_companys
);
if
(
$all_companys
){
$all_companys
=
array_column
(
$all_companys
,
'com_id'
);
$all_companys
[]
=
$result
[
'company_id'
];
}
else
{
$all_companys
=
[
$result
[
'company_id'
]];
}
$result
[
'all_companys'
]
=
$all_companys
;
$result
[
'com_type'
]
=
$company
[
'com_type'
];
if
(
$company
[
'com_type'
]
==
2
){
$result
[
'search_id'
]
=
Admin
::
where
(
'company_id'
,
$result
[
'company_id'
])
->
where
(
"admin_groupnew"
,
3
)
->
value
(
'id'
);
}
else
{
$result
[
'search_id'
]
=
$result
[
'id'
];
}
$function
=
Functions
::
where
(
'function_type'
,
3
)
->
select
(
'function_id'
,
'function_model'
,
'function_action'
)
->
get
()
->
toArray
();
$list
=
[];
foreach
(
$function
as
$k
=>
$v
){
$list
[]
=
$v
[
'function_model'
]
.
':'
.
$v
[
'function_action'
];
}
$arr
[
'at_time'
]
=
date
(
'Y-m-d H:i:s'
);
$arr
[
'at_adminid'
]
=
$result
[
'id'
];
$at_permissions
[
'admindata'
]
=
$result
;
$search_token
=
AdminToken
::
where
(
'at_adminid'
,
$result
[
'id'
])
->
orderBy
(
'at_time'
,
'DESC'
)
->
first
();
/*********************获取所有按钮**************************/
$function_id
=
Department
::
where
(
'id'
,
$result
[
'admin_groupnew'
])
->
value
(
'function_id'
);
$function_id
=
explode
(
','
,
$function_id
);
$at_permissions
[
'function_id'
]
=
$function_id
;
$at_permissions
=
json_encode
(
$at_permissions
);
$arr
[
'at_permissions'
]
=
$at_permissions
;
$res
=
Permissions
::
whereIn
(
'function_id'
,
$function_id
)
->
where
(
'function_position'
,
'!='
,
3
)
->
select
(
'function_id'
,
'function_parent_id'
,
'function_name'
,
'function_model'
,
'function_action'
,
'function_position'
,
'sort_order'
)
->
orderBy
(
'sort_order'
,
'DESC'
)
->
get
()
->
toArray
();
$at_permiss
=
[];
foreach
(
$res
as
$k
=>
$v
){
$at_permiss
[
$v
[
'function_parent_id'
]][]
=
$v
;
}
$arr
[
'at_perm'
]
=
json_encode
(
$at_permiss
);
$arr
[
'at_accredit'
]
=
''
;
/********************************************************************/
if
(
$search_token
){
AdminToken
::
where
(
'at_token'
,
$search_token
[
'at_token'
])
->
update
(
$arr
);
}
else
{
AdminToken
::
where
(
'at_token'
,
$search_token
[
'at_token'
])
->
insert
(
$arr
);
}
}
}
app/Services/OrderDeductionFeeService.php
浏览文件 @
19c0b50a
...
...
@@ -71,17 +71,18 @@ class OrderDeductionFeeService extends Service
$add_dfee
[
'reo_state'
]
=
1
;
$add_dfee
[
'reo_create_time'
]
=
date
(
'Y-m-d H:i:s'
);
$add_dfee
[
'reo_pay_time'
]
=
date
(
'Y-m-d H:i:s'
);
$add_dfee
[
'reo_pay_way'
]
=
4
;
//4派单
扣费
$add_dfee
[
'reo_pay_way'
]
=
$data
[
'reo_pay_way'
];
//4派单扣费 5电话通知
扣费
$add_dfee
[
'reo_type'
]
=
2
;
$add_dfee
[
'reo_client_type'
]
=
$find_company_info
[
'com_type'
];
//公司类型
$update
[
'adre_banlance'
]
=
$find_balance
[
'adre_banlance'
]
+
$data
[
'reo_price'
];
if
((
$update
[
'adre_banlance'
]
+
$find_balance
[
'adre_credit_limit'
])
<=
0
)
{
if
((
$update
[
'adre_banlance'
]
+
$find_balance
[
'adre_credit_limit'
])
<=
0
&&
(
!
isset
(
$data
[
'pay_type'
])
||
$data
[
'pay_type'
]
!=
1
)
)
{
return
[
'code'
=>
501
,
'msg'
=>
'余额不足,请充值'
];
}
$add_res
=
DB
::
table
(
'recharge_order'
)
->
insertGetId
(
$add_dfee
);
$update_res
=
DB
::
table
(
'admin_recharge'
)
->
where
(
'adre_id'
,
$find_balance
[
'adre_id'
])
->
update
(
$update
);
->
increment
(
'adre_banlance'
,
$data
[
'reo_price'
]
);
if
(
$add_res
&&
$update_res
)
{
return
[
'code'
=>
200
,
'msg'
=>
'操作成功'
];
}
...
...
app/Services/OrderListService.php
浏览文件 @
19c0b50a
...
...
@@ -568,9 +568,12 @@ class OrderListService extends Service
}
// }
if
(
!
in_array
(
$session
[
'admin_groupnew'
],
[
2
,
3
,
7
])){
//管理员可以看全部
if
(
!
in_array
(
$session
[
'admin_groupnew'
],
[
2
,
3
,
7
,
8
])){
//管理员可以看全部
$where
[
'gone_order_list.company_id'
]
=
$session
[
'company_id'
];
}
if
(
in_array
(
$session
[
'admin_groupnew'
],
[
8
])){
//管理员可以看全部
$where
[
'gone_order_list.company_id_searchin'
]
=
$session
[
'all_companys'
];
}
$where
=
CommonService
::
jointWhere
(
$where
);
$page_size
=
$input
[
'page_size'
]
??
10
;
...
...
app/Services/OrderService.php
浏览文件 @
19c0b50a
...
...
@@ -382,9 +382,13 @@ class OrderService extends Service
$where
[
'gone_orders.category_findinset'
]
=
$input
[
'cd_id'
];
}
if
(
$session
[
'admin_groupnew'
]
!=
7
){
//管理员可以看全部 && $session['admin_groupnew'] != 8
// if ($session['admin_groupnew'] != 7){//管理员可以看全部 && $session['admin_groupnew'] != 8
if
(
!
in_array
(
$session
[
'admin_groupnew'
],[
7
,
8
]))
{
$where
[
'gone_orders.company_id'
]
=
$session
[
'company_id'
];
}
if
(
in_array
(
$session
[
'admin_groupnew'
],[
8
]))
{
$where
[
'gone_orders.company_id_searchin'
]
=
$session
[
'all_companys'
];
}
/*---------------------------------------------拼接订单列表查询条件结束-------------------------------------------------------*/
$is_excel
=
$input
[
'is_excel'
]
??
'0'
;
...
...
@@ -509,9 +513,12 @@ class OrderService extends Service
$where
[
'p_id_searchin'
]
=
$admin_pt_id
;
}
if
(
$session
[
'admin_groupnew'
]
!=
7
)
{
if
(
!
in_array
(
$session
[
'admin_groupnew'
],[
7
,
8
])
)
{
$where
[
'company_id'
]
=
$session
[
'company_id'
];
}
if
(
in_array
(
$session
[
'admin_groupnew'
],[
8
]))
{
$where
[
'company_id_searchin'
]
=
$session
[
'all_companys'
];
}
$statuswhere
=
OrderService
::
getStatusWhere
(
$status
);
foreach
(
$statuswhere
as
$k
=>
$v
){
...
...
@@ -1282,10 +1289,11 @@ class OrderService extends Service
$returnOrder
=
Orders
::
where
(
'sys_num'
,
$input
[
'sys_num'
])
->
update
(
$post
);
// 派单扣除 订单所属公司金额
// 扣费
$post_data
[
'adm_id'
]
=
$
orderinfo
[
'admin_id'
]
;
$post_data
[
'adm_id'
]
=
$
session
[
'admin_id'
]
??
0
;
$post_data
[
'company_id'
]
=
$orderinfo
[
'company_id'
];
$post_data
[
'order_number'
]
=
$
input
[
'sys
_num'
];
$post_data
[
'order_number'
]
=
$
orderinfo
[
'order
_num'
];
$post_data
[
'reo_price'
]
=
-
0.5
;
$post_data
[
'reo_pay_way'
]
=
4
;
$reduce_price
=
OrderDeductionFeeService
::
deductFee
(
$post_data
);
if
(
$reduce_price
[
'code'
]
!=
200
)
{
DB
::
rollback
();
...
...
app/Services/PlatformService.php
浏览文件 @
19c0b50a
...
...
@@ -51,29 +51,32 @@ class PlatformService extends Service
public
function
search
(
$param
,
$columns
=
array
(
'*'
),
$page
=
1
,
$pageSize
=
20
,
$session
=
''
)
{
$where
=
[];
if
(
$session
[
'admin_groupnew'
]
!=
7
){
//管理员可以看全部
$where
[]
=
[
'company_id'
,
'='
,
$session
[
'company_id'
]];
if
(
!
in_array
(
$session
[
'admin_groupnew'
],[
7
,
8
]))
{
$where
[
'company_id'
]
=
$session
[
'company_id'
];
}
if
(
in_array
(
$session
[
'admin_groupnew'
],[
8
]))
{
$where
[
'company_id_searchin'
]
=
$session
[
'all_companys'
];
}
if
(
$param
[
'type'
])
{
$where
[
]
=
[
'type'
,
'='
,
$param
[
'type'
]
];
$where
[
'type'
]
=
$param
[
'type'
];
}
if
(
$param
[
'pt_name'
])
{
//平台名称
$where
[
]
=
[
'pt_name'
,
'like'
,
'%'
.
$param
[
'pt_name'
]
.
'%
'
];
$where
[
'type_like'
]
=
$param
[
'pt_name
'
];
}
if
(
$param
[
'pt_zt'
])
{
//状态 1:启用;2:停用
$where
[
]
=
[
'pt_zt'
,
'='
,
$param
[
'pt_zt'
]
];
$where
[
'pt_zt'
]
=
$param
[
'pt_zt'
];
}
if
(
$param
[
'three_pd'
])
{
//0:自家;1:第三方
$where
[
]
=
[
'three_pd'
,
'='
,
$param
[
'three_pd'
]
];
$where
[
'three_pd'
]
=
$param
[
'three_pd'
];
}
if
(
$param
[
'p_paytype'
])
{
//开票公司
$where
[
]
=
[
'p_paytype'
,
'='
,
$param
[
'p_paytype'
]
];
$where
[
'p_paytype'
]
=
$param
[
'p_paytype'
];
}
if
(
$param
[
'bus_type'
])
{
if
(
$param
[
'bus_type'
]
==
2
)
{
$where
[
]
=
[
'bus_type'
,
'='
,
2
]
;
$where
[
'bus_type'
]
=
2
;
}
else
{
$where
[
]
=
[
'bus_type'
,
'!='
,
2
]
;
$where
[
'bus_type_noteq'
]
=
2
;
}
}
if
(
$param
[
'sord_asc'
])
{
//字母排序
...
...
@@ -84,15 +87,16 @@ class PlatformService extends Service
$orderBy
[
0
]
=
'sord'
;
$orderBy
[
1
]
=
'ASC'
;
}
$where
=
CommonService
::
jointWhere
(
$where
);
$count
=
$this
->
modelMain
->
where
(
$where
)
->
where
Raw
(
$where
)
->
count
();
$totalPage
=
ceil
(
$count
/
$pageSize
);
if
(
$pageSize
>
0
)
{
$offset
=
(
$page
-
1
)
*
$pageSize
;
$list
=
$this
->
modelMain
->
where
(
$where
)
->
where
Raw
(
$where
)
->
select
(
$columns
)
//->orderBy('sord','ASC')
->
orderBy
(
$orderBy
[
0
],
$orderBy
[
1
])
...
...
@@ -101,7 +105,7 @@ class PlatformService extends Service
->
get
();
}
else
{
$list
=
$this
->
modelMain
->
where
(
$where
)
->
where
Raw
(
$where
)
->
select
(
$columns
)
//->orderBy('sord','ASC')
->
orderBy
(
$orderBy
[
0
],
$orderBy
[
1
])
...
...
app/Services/RefundService.php
浏览文件 @
19c0b50a
...
...
@@ -112,10 +112,11 @@ class RefundService extends Service
$where
[
1
]
=
1
;
if
(
!
in_array
(
$session
[
'admin_groupnew'
],[
7
,
8
])){
$where
[
'pt_id_searchin'
]
=
trim
(
$admin_pt_id
);
}
if
(
$session
[
'admin_groupnew'
]
!=
7
)
{
//管理员可以看全部
$where
[
'company_id'
]
=
$session
[
'company_id'
];
}
if
(
in_array
(
$session
[
'admin_groupnew'
],[
8
])){
$where
[
'company_id_searchin'
]
=
$session
[
'all_companys'
];
}
// $where['pt_id_searchin'] = $admin_pt_id;
if
(
isset
(
$params
[
'state'
])){
...
...
@@ -176,10 +177,11 @@ class RefundService extends Service
$where1
[
1
]
=
1
;
if
(
!
in_array
(
$session
[
'admin_groupnew'
],[
7
,
8
])){
$where1
[
'pt_id_searchin'
]
=
trim
(
$admin_pt_id
);
}
if
(
$session
[
'admin_groupnew'
]
!=
7
)
{
//管理员可以看全部
$where1
[
'company_id'
]
=
$session
[
'company_id'
];
}
if
(
in_array
(
$session
[
'admin_groupnew'
],[
8
])){
$where1
[
'company_id_searchin'
]
=
$session
[
'all_companys'
];
}
$where1
=
CommonService
::
jointWhere
(
$where1
);
//未处理
...
...
app/Services/ServiceProviderService.php
浏览文件 @
19c0b50a
...
...
@@ -15,6 +15,7 @@ namespace App\Services;
use
App\Exports\AfterCustExport
;
use
App\Exports\ServiceProviderExport
;
use
App\Models\Admin
;
use
App\Models\Company
;
use
App\Models\GoodsBrand
;
use
BlueCity\Core\Service\Service
;
use
Illuminate\Support\Facades\Log
;
...
...
@@ -98,10 +99,11 @@ class ServiceProviderService extends Service
if
(
Request
()
->
filled
(
'verstorename'
))
{
$query
->
where
(
'admin_infor.verstorename'
,
'like'
,
Request
()
->
input
(
'verstorename'
)
.
'%'
);
//京东名称
}
if
(
$session
[
'admin_groupnew'
]
!=
7
)
{
if
(
!
in_array
(
$session
[
'admin_groupnew'
],[
7
,
8
])
)
{
$query
->
where
(
'admin.company_id'
,
$session
[
'company_id'
]);
// $com_parent_id = explode(',', $session['com_parent_id']);
// $query->whereIn('admin.company_id', $com_parent_id);
}
if
(
in_array
(
$session
[
'admin_groupnew'
],[
8
]))
{
$query
->
whereIn
(
'admin.company_id'
,
$session
[
'all_company'
]);
}
$count
=
$query
->
count
();
$totalPage
=
1
;
...
...
app/Services/SupplierPriceService.php
浏览文件 @
19c0b50a
...
...
@@ -75,10 +75,12 @@ class SupplierPriceService extends Service
if
(
!
empty
(
$param
[
'type'
]))
{
//结束时间
$Db
=
$Db
->
where
(
"gh_price.type"
,
$param
[
'type'
]);
}
if
(
$session
[
'admin_groupnew'
]
!=
7
){
//管理员可以看全部 && $session['admin_groupnew'] != 8
if
(
!
in_array
(
$session
[
'admin_groupnew'
],[
7
,
8
])){
$Db
=
$Db
->
where
(
"gh_price.company_id"
,
$session
[
'company_id'
]);
}
if
(
in_array
(
$session
[
'admin_groupnew'
],[
8
])){
$Db
=
$Db
->
whereIn
(
"gh_price.company_id"
,
$session
[
'all_companys'
]);
}
$count
=
$Db
->
count
();
$totalPage
=
ceil
(
$count
/
$pageSize
);
if
(
$pageSize
>
0
)
{
...
...
@@ -103,7 +105,7 @@ class SupplierPriceService extends Service
$list
=
$data
[
'list'
];
//按钮-添加
$all_button
=
BmmcService
::
wherebutton
(
$token
,
$priID
);
if
((
$request
[
'type'
]
==
2
&&
$session
[
'admin_groupnew'
]
==
7
)
||
(
$request
[
'type'
]
==
1
&&
$session
[
'admin_groupnew'
]
!=
7
))
{
if
((
$request
[
'type'
]
==
2
&&
in_array
(
$session
[
'admin_groupnew'
],[
7
,
8
]))
||
(
$request
[
'type'
]
==
1
&&
!
in_array
(
$session
[
'admin_groupnew'
],[
7
,
8
])
))
{
$addPt
=
BmmcService
::
getTopButton
(
'addGhprice'
,
''
,
$all_button
);
}
else
{
$addPt
=
BmmcService
::
getTopButton
(
''
,
''
,
$all_button
);
...
...
@@ -122,7 +124,7 @@ class SupplierPriceService extends Service
}
else
{
$list
[
$kl
][
'type'
]
=
$vl
[
'pg_series'
]
.
'-'
.
$vl
[
'version'
];
}
if
((
$request
[
'type'
]
==
2
&&
$session
[
'admin_groupnew'
]
==
7
)
||
$request
[
'type'
]
==
1
)
{
if
((
$request
[
'type'
]
==
2
&&
in_array
(
$session
[
'admin_groupnew'
],[
7
,
8
]))
||
(
$request
[
'type'
]
==
1
&&
!
in_array
(
$session
[
'admin_groupnew'
],[
7
,
8
]))
)
{
$button
=
BmmcService
::
getListButton
([
'editGhprice, delGhPrice'
],
$all_button
);
//编辑,删除按钮
}
else
{
$button
=
BmmcService
::
getListButton
([],
$all_button
);
//编辑,删除按钮
...
...
public/aliyunDyvmsSdk/SignatureHelper.php
0 → 100644
浏览文件 @
19c0b50a
<?php
namespace
Aliyun\DySDKLite
;
/**
* 签名助手 2017/11/19
*
* Class SignatureHelper
*/
class
SignatureHelper
{
/**
* 生成签名并发起请求
*
* @param $accessKeyId string AccessKeyId (https://ak-console.aliyun.com/)
* @param $accessKeySecret string AccessKeySecret
* @param $domain string API接口所在域名
* @param $params array API具体参数
* @param $security boolean 使用https
* @param $method boolean 使用GET或POST方法请求,VPC仅支持POST
* @return bool|\stdClass 返回API接口调用结果,当发生错误时返回false
*/
public
function
request
(
$accessKeyId
,
$accessKeySecret
,
$domain
,
$params
,
$security
=
false
,
$method
=
'POST'
)
{
$apiParams
=
array_merge
(
array
(
"SignatureMethod"
=>
"HMAC-SHA1"
,
"SignatureNonce"
=>
uniqid
(
mt_rand
(
0
,
0xffff
),
true
),
"SignatureVersion"
=>
"1.0"
,
"AccessKeyId"
=>
$accessKeyId
,
"Timestamp"
=>
gmdate
(
"Y-m-d\TH:i:s\Z"
),
"Format"
=>
"JSON"
,
),
$params
);
ksort
(
$apiParams
);
$sortedQueryStringTmp
=
""
;
foreach
(
$apiParams
as
$key
=>
$value
)
{
$sortedQueryStringTmp
.=
"&"
.
$this
->
encode
(
$key
)
.
"="
.
$this
->
encode
(
$value
);
}
$stringToSign
=
"${method}&%2F&"
.
$this
->
encode
(
substr
(
$sortedQueryStringTmp
,
1
));
$sign
=
base64_encode
(
hash_hmac
(
"sha1"
,
$stringToSign
,
$accessKeySecret
.
"&"
,
true
));
$signature
=
$this
->
encode
(
$sign
);
$url
=
(
$security
?
'https'
:
'http'
)
.
"://
{
$domain
}
/"
;
try
{
$content
=
$this
->
fetchContent
(
$url
,
$method
,
"Signature=
{
$signature
}{
$sortedQueryStringTmp
}
"
);
return
json_decode
(
$content
);
}
catch
(
\Exception
$e
)
{
return
false
;
}
}
private
function
encode
(
$str
)
{
$res
=
urlencode
(
$str
);
$res
=
preg_replace
(
"/\+/"
,
"%20"
,
$res
);
$res
=
preg_replace
(
"/\*/"
,
"%2A"
,
$res
);
$res
=
preg_replace
(
"/%7E/"
,
"~"
,
$res
);
return
$res
;
}
private
function
fetchContent
(
$url
,
$method
,
$body
)
{
$ch
=
curl_init
();
if
(
$method
==
'POST'
)
{
curl_setopt
(
$ch
,
CURLOPT_POST
,
1
);
//post提交方式
curl_setopt
(
$ch
,
CURLOPT_POSTFIELDS
,
$body
);
}
else
{
$url
.=
'?'
.
$body
;
}
curl_setopt
(
$ch
,
CURLOPT_URL
,
$url
);
curl_setopt
(
$ch
,
CURLOPT_TIMEOUT
,
5
);
curl_setopt
(
$ch
,
CURLOPT_RETURNTRANSFER
,
1
);
curl_setopt
(
$ch
,
CURLOPT_HTTPHEADER
,
array
(
"x-sdk-client"
=>
"php/2.0.0"
));
if
(
substr
(
$url
,
0
,
5
)
==
'https'
)
{
curl_setopt
(
$ch
,
CURLOPT_SSL_VERIFYPEER
,
false
);
curl_setopt
(
$ch
,
CURLOPT_SSL_VERIFYHOST
,
false
);
}
$rtn
=
curl_exec
(
$ch
);
if
(
$rtn
===
false
)
{
// 大多由设置等原因引起,一般无法保障后续逻辑正常执行,
// 所以这里触发的是E_USER_ERROR,会终止脚本执行,无法被try...catch捕获,需要用户排查环境、网络等故障
trigger_error
(
"[CURL_"
.
curl_errno
(
$ch
)
.
"]: "
.
curl_error
(
$ch
),
E_USER_ERROR
);
}
curl_close
(
$ch
);
return
$rtn
;
}
}
\ No newline at end of file
public/aliyunDyvmsSdk/Test.php
0 → 100644
浏览文件 @
19c0b50a
<?php
/*
* 此文件用于检测DEMO运行环境,无需修改,请在浏览器中运行检测
*
* 2017/11/19
*/
echo
'<style>li {font-size: 16px;} li.fail {color:red} li.success {color: green} li label{ display:inline-block; width: 15em}</style>'
;
echo
'<h1>执行环境检测</h1>'
;
function
success
(
$title
)
{
print_r
(
"<li class=
\"
success
\"
><label>
{
$title
}
</label>[成功]</li>"
);
}
function
fail
(
$title
,
$description
)
{
print_r
(
"<li class=
\"
fail
\"
><label>
{
$title
}
</label>[失败]
{
$description
}
</li>"
);
}
if
(
preg_match
(
"/^\d+\.\d+/"
,
PHP_VERSION
,
$matches
))
{
$version
=
$matches
[
0
];
if
(
$version
>=
5.4
)
{
success
(
"PHP
$version
"
);
}
else
{
fail
(
"PHP
$version
"
,
"需要PHP>=5.4版本"
);
exit
(
1
);
}
}
try
{
set_error_handler
(
function
()
{
throw
new
Exception
();
});
date_default_timezone_get
();
restore_error_handler
();
}
catch
(
Exception
$e
)
{
fail
(
'默认时区设置'
,
'请设置默认时区,如:date_default_timezone_set("Asia/Shanghai")'
);
}
echo
'<h2>依赖扩展检测,如失败请安装相应扩展</h2>'
;
$dependencies
=
array
(
'json_encode'
=>
null
,
'curl_init'
=>
null
,
'hash_hmac'
=>
null
,
'simplexml_load_string'
=>
'如果是php7.x + ubuntu环境,请确认php7.x-libxml是否安装,x为子版本号'
,
);
foreach
(
$dependencies
as
$funcName
=>
$description
)
{
if
(
!
function_exists
(
$funcName
))
{
fail
(
$funcName
,
$description
||
''
);
}
else
{
success
(
$funcName
);
}
}
\ No newline at end of file
public/aliyunDyvmsSdk/demo/batchRobotSmartCall.php
0 → 100644
浏览文件 @
19c0b50a
<?php
/*
* 此文件用于验证语音服务API接口,供开发时参考
* 执行验证前请确保文件为utf-8编码,并替换相应参数为您自己的信息,并取消相关调用的注释
* 建议验证前先执行Test.php验证PHP环境
*
* 2017/11/30
*/
namespace
Aliyun\DySDKLite\Vms\Demo
;
require_once
dirname
(
__DIR__
)
.
"/SignatureHelper.php"
;
use
Aliyun\DySDKLite\SignatureHelper
;
// todo 接口定义,请先替换相应参数为您自己的信息
/**
* 智能外呼批量任务呼叫
*/
function
batchRobotSmartCall
()
{
$params
=
array
();
// *** 需用户填写部分 ***
// fixme 必填:是否启用https
$security
=
false
;
// fixme 必填: 请参阅 https://ak-console.aliyun.com/ 取得您的AK信息
$accessKeyId
=
"your access key id"
;
$accessKeySecret
=
"your access key secret"
;
// fixme 必填: 被叫显号,可在语音控制台中找到所购买的显号
$params
[
"CalledShowNumber"
]
=
"06336760013"
;
// fixme 必填: 被叫号码
$params
[
"CalledNumber"
]
=
"1004,1005"
;
// fixme 必填: 机器人ID
$params
[
"DialogId"
]
=
"331234432"
;
// fixme 必填: 公司名称
$params
[
"CorpName"
]
=
"阿里巴巴通信技术(北京)有限公司"
;
// fixme 必填: 任务名称
$params
[
"TaskName"
]
=
"批量任务测试"
;
// todo 选填: 早媒体语音识别标识,默认是false,使用的话设成true
// $params["EarlyMediaAsr"] = "false";
// todo 选填: 是否定时呼叫,设为true,则必须设置scheduleTime
// $params["ScheduleCall"] = "false";
// todo 选填: 约定的呼叫时间
// $params["ScheduleTime"] = "2017-11-27 20:09:06";
// *** 需用户填写部分结束, 以下代码若无必要无需更改 ***
// 初始化SignatureHelper实例用于设置参数,签名以及发送请求
$helper
=
new
SignatureHelper
();
// 此处可能会抛出异常,注意catch
$content
=
$helper
->
request
(
$accessKeyId
,
$accessKeySecret
,
"dyvmsapi.aliyuncs.com"
,
array_merge
(
$params
,
array
(
"RegionId"
=>
"cn-hangzhou"
,
"Action"
=>
"BatchRobotSmartCall"
,
"Version"
=>
"2017-05-25"
,
)),
$security
);
return
$content
;
}
ini_set
(
"display_errors"
,
"on"
);
// 显示错误提示,仅用于测试时排查问题
// error_reporting(E_ALL); // 显示所有错误提示,仅用于测试时排查问题
set_time_limit
(
0
);
// 防止脚本超时,仅用于测试使用,生产环境请按实际情况设置
header
(
"Content-Type: text/plain; charset=utf-8"
);
// 输出为utf-8的文本格式,仅用于测试
// 验证智能外呼批量任务呼叫(BatchRobotSmartCall)接口
print_r
(
batchRobotSmartCall
());
public/aliyunDyvmsSdk/demo/cancelCall.php
0 → 100644
浏览文件 @
19c0b50a
<?php
/*
* 此文件用于验证语音服务API接口,供开发时参考
* 执行验证前请确保文件为utf-8编码,并替换相应参数为您自己的信息,并取消相关调用的注释
* 建议验证前先执行Test.php验证PHP环境
*
* 2017/11/30
*/
namespace
Aliyun\DySDKLite\Vms\Demo
;
require_once
dirname
(
__DIR__
)
.
"/SignatureHelper.php"
;
use
Aliyun\DySDKLite\SignatureHelper
;
// todo 接口定义,请先替换相应参数为您自己的信息
/**
* 取消呼叫
*/
function
cancelCall
()
{
$params
=
array
();
// *** 需用户填写部分 ***
// fixme 必填:是否启用https
$security
=
false
;
// fixme 必填: 请参阅 https://ak-console.aliyun.com/ 取得您的AK信息
$accessKeyId
=
"your access key id"
;
$accessKeySecret
=
"your access key secret"
;
// fixme 必填: 从上次呼叫调用的返回值中获取的CallId
$params
[
"CallId"
]
=
"113853585007^100675005007"
;
// *** 需用户填写部分结束, 以下代码若无必要无需更改 ***
// 初始化SignatureHelper实例用于设置参数,签名以及发送请求
$helper
=
new
SignatureHelper
();
// 此处可能会抛出异常,注意catch
$content
=
$helper
->
request
(
$accessKeyId
,
$accessKeySecret
,
"dyvmsapi.aliyuncs.com"
,
array_merge
(
$params
,
array
(
"RegionId"
=>
"cn-hangzhou"
,
"Action"
=>
"CancelCall"
,
"Version"
=>
"2017-05-25"
,
)),
$security
);
return
$content
;
}
ini_set
(
"display_errors"
,
"on"
);
// 显示错误提示,仅用于测试时排查问题
// error_reporting(E_ALL); // 显示所有错误提示,仅用于测试时排查问题
set_time_limit
(
0
);
// 防止脚本超时,仅用于测试使用,生产环境请按实际情况设置
header
(
"Content-Type: text/plain; charset=utf-8"
);
// 输出为utf-8的文本格式,仅用于测试
// 验证取消呼叫(CancelCall)接口
print_r
(
cancelCall
());
public/aliyunDyvmsSdk/demo/clickToDial.php
0 → 100644
浏览文件 @
19c0b50a
<?php
/*
* 此文件用于验证语音服务API接口,供开发时参考
* 执行验证前请确保文件为utf-8编码,并替换相应参数为您自己的信息,并取消相关调用的注释
* 建议验证前先执行Test.php验证PHP环境
*
* 2017/11/30
*/
namespace
Aliyun\DySDKLite\Vms\Demo
;
require_once
dirname
(
__DIR__
)
.
"/SignatureHelper.php"
;
use
Aliyun\DySDKLite\SignatureHelper
;
// todo 接口定义,请先替换相应参数为您自己的信息
/**
* 点击拨号
*/
function
clickToDial
()
{
$params
=
array
();
// *** 需用户填写部分 ***
// fixme 必填:是否启用https
$security
=
false
;
// fixme 必填: 请参阅 https://ak-console.aliyun.com/ 取得您的AK信息
$accessKeyId
=
"your access key id"
;
$accessKeySecret
=
"your access key secret"
;
// fixme 必填: 主叫显号, 可在语音控制台中找到所购买的显号
$params
[
"CallerShowNumber"
]
=
"05344757036"
;
// fixme 必填: 主叫号码
$params
[
"CallerNumber"
]
=
"1800000000"
;
// fixme 必填: 被叫显号, 可在语音控制台中找到所购买的显号
$params
[
"CalledShowNumber"
]
=
"4001112222"
;
// fixme 必填: 被叫号码
$params
[
"CalledNumber"
]
=
"13700000000"
;
// fixme 可选: 是否录音
$params
[
"RecordFlag"
]
=
true
;
// fixme 可选: 是否开启实时ASR功能
$params
[
"AsrFlag"
]
=
true
;
// fixme 可选: ASR模型ID
$params
[
"AsrModelId"
]
=
'2070aca1eff146f9a7bc826f1c3d4d33'
;
// fixme 可选: 预留给调用方使用的ID, 最终会通过在回执消息中将此ID带回给调用方(15个字符及以内)
$params
[
"OutId"
]
=
"yourOutId"
;
// *** 需用户填写部分结束, 以下代码若无必要无需更改 ***
// 初始化SignatureHelper实例用于设置参数,签名以及发送请求
$helper
=
new
SignatureHelper
();
// 此处可能会抛出异常,注意catch
$content
=
$helper
->
request
(
$accessKeyId
,
$accessKeySecret
,
"dyvmsapi.aliyuncs.com"
,
array_merge
(
$params
,
array
(
"RegionId"
=>
"cn-hangzhou"
,
"Action"
=>
"ClickToDial"
,
"Version"
=>
"2017-05-25"
,
)),
$security
);
return
$content
;
}
ini_set
(
"display_errors"
,
"on"
);
// 显示错误提示,仅用于测试时排查问题
// error_reporting(E_ALL); // 显示所有错误提示,仅用于测试时排查问题
set_time_limit
(
0
);
// 防止脚本超时,仅用于测试使用,生产环境请按实际情况设置
header
(
"Content-Type: text/plain; charset=utf-8"
);
// 输出为utf-8的文本格式,仅用于测试
// 验证点击拨号(ClickToDial)接口
print_r
(
clickToDial
());
public/aliyunDyvmsSdk/demo/ivrCall.php
0 → 100644
浏览文件 @
19c0b50a
<?php
/*
* 此文件用于验证语音服务API接口,供开发时参考
* 执行验证前请确保文件为utf-8编码,并替换相应参数为您自己的信息,并取消相关调用的注释
* 建议验证前先执行Test.php验证PHP环境
*
* 2017/11/30
*/
namespace
Aliyun\DySDKLite\Vms\Demo
;
require_once
dirname
(
__DIR__
)
.
"/SignatureHelper.php"
;
use
Aliyun\DySDKLite\SignatureHelper
;
// todo 接口定义,请先替换相应参数为您自己的信息
/**
* 交互式语音应答
*/
function
ivrCall
()
{
$params
=
array
();
// *** 需用户填写部分 ***
// fixme 必填:是否启用https
$security
=
false
;
// fixme 必填: 请参阅 https://ak-console.aliyun.com/ 取得您的AK信息
$accessKeyId
=
"your access key id"
;
$accessKeySecret
=
"your access key secret"
;
// fixme 必填: 被叫显号
$params
[
"CalledShowNumber"
]
=
"4001112222"
;
// fixme 必填: 被叫显号
$params
[
"CalledNumber"
]
=
"13700000000"
;
// fixme 必填: 呼叫开始时播放的提示音-语音文件Code名称或者Tts模板Code
$params
[
"StartCode"
]
=
"TTS_10001"
;
// fixme 可选: Tts模板中的变量替换JSON,假如Tts模板中存在变量,则此处必填
$params
[
"StartTtsParams"
]
=
array
(
"AckNum"
=>
"123456"
);
// fixme 必填: 按键与语音文件ID或tts模板的映射关系
$menuKeyMaps
=
array
(
array
(
// 按下1键, 播放语音
"Key"
=>
"1"
,
"Code"
=>
"9a9d7222-670f-40b0-a3af.wav"
),
array
(
// 按下2键, 播放语音
"Key"
=>
"2"
,
"Code"
=>
"44e3e577-3d3a-418f-932c.wav"
),
array
(
// 按下3键, 播放TTS语音
"Key"
=>
"3"
,
"Code"
=>
"TTS_71390000"
,
"TtsParams"
=>
array
(
"product"
=>
"aliyun"
,
"code"
=>
"123"
)
),
);
// fixme 可选: 重复播放次数
$params
[
"PlayTimes"
]
=
3
;
// fixme 可选: 等待用户按键超时时间,单位毫秒
$params
[
"Timeout"
]
=
3000
;
// fixme 可选: 播放结束时播放的结束提示音,支持语音文件和Tts模板2种方式,但是类型需要与StartCode一致,即前者为Tts类型的,后者也需要是Tts类型的
$params
[
"ByeCode"
]
=
"TTS_71400007"
;
// fixme 可选: Tts模板变量替换JSON,当ByeCode为Tts时且Tts模板中带变量的情况下此参数必填
$params
[
"ByeTtsParams"
]
=
array
(
"product"
=>
"aliyun"
,
"code"
=>
"123"
);
// fixme 可选: 预留给调用方使用的ID, 最终会通过在回执消息中将此ID带回给调用方
$params
[
"OutId"
]
=
"yourOutId"
;
// *** 需用户填写部分结束, 以下代码若无必要无需更改 ***
if
(
!
empty
(
$params
[
"StartTtsParams"
])
&&
is_array
(
$params
[
"StartTtsParams"
]))
{
$params
[
"StartTtsParams"
]
=
json_encode
(
$params
[
"StartTtsParams"
],
JSON_UNESCAPED_UNICODE
);
}
if
(
!
empty
(
$params
[
"ByeTtsParams"
])
&&
is_array
(
$params
[
"ByeTtsParams"
]))
{
$params
[
"ByeTtsParams"
]
=
json_encode
(
$params
[
"ByeTtsParams"
],
JSON_UNESCAPED_UNICODE
);
}
$i
=
0
;
foreach
(
$menuKeyMaps
as
$menuKeyMap
)
{
++
$i
;
$params
[
"MenuKeyMap."
.
$i
.
".Key"
]
=
$menuKeyMap
[
"Key"
];
$params
[
"MenuKeyMap."
.
$i
.
".Code"
]
=
$menuKeyMap
[
"Code"
];
if
(
!
empty
(
$menuKeyMap
[
"TtsParams"
])
&&
is_array
(
$menuKeyMap
[
"TtsParams"
]))
{
$params
[
"MenuKeyMap."
.
$i
.
".TtsParams"
]
=
json_encode
(
$menuKeyMap
[
"TtsParams"
],
JSON_UNESCAPED_UNICODE
);
}
}
// 初始化SignatureHelper实例用于设置参数,签名以及发送请求
$helper
=
new
SignatureHelper
();
// 此处可能会抛出异常,注意catch
$content
=
$helper
->
request
(
$accessKeyId
,
$accessKeySecret
,
"dyvmsapi.aliyuncs.com"
,
array_merge
(
$params
,
array
(
"RegionId"
=>
"cn-hangzhou"
,
"Action"
=>
"IvrCall"
,
"Version"
=>
"2017-05-25"
,
)),
$security
);
return
$content
;
}
ini_set
(
"display_errors"
,
"on"
);
// 显示错误提示,仅用于测试时排查问题
// error_reporting(E_ALL); // 显示所有错误提示,仅用于测试时排查问题
set_time_limit
(
0
);
// 防止脚本超时,仅用于测试使用,生产环境请按实际情况设置
header
(
"Content-Type: text/plain; charset=utf-8"
);
// 输出为utf-8的文本格式,仅用于测试
// 验证交互式语音应答(IvrCall)接口
print_r
(
ivrCall
());
\ No newline at end of file
public/aliyunDyvmsSdk/demo/queryCallDetailByCallId.php
0 → 100644
浏览文件 @
19c0b50a
<?php
/*
* 此文件用于验证语音服务API接口,供开发时参考
* 执行验证前请确保文件为utf-8编码,并替换相应参数为您自己的信息,并取消相关调用的注释
* 建议验证前先执行Test.php验证PHP环境
*
* 2017/11/30
*/
namespace
Aliyun\DySDKLite\Vms\Demo
;
require_once
dirname
(
__DIR__
)
.
"/SignatureHelper.php"
;
use
Aliyun\DySDKLite\SignatureHelper
;
// todo 接口定义,请先替换相应参数为您自己的信息
/**
* 通过呼叫ID获取呼叫记录
*/
function
queryCallDetailByCallId
()
{
$params
=
array
();
// *** 需用户填写部分 ***
// fixme 必填:是否启用https
$security
=
false
;
// fixme 必填: 请参阅 https://ak-console.aliyun.com/ 取得您的AK信息
$accessKeyId
=
"your access key id"
;
$accessKeySecret
=
"your access key secret"
;
// fixme 必填: 从上次呼叫调用的返回值中获取的CallId
$params
[
"CallId"
]
=
"113853585007^100675005007"
;
// fixme 必填: Unix时间戳(毫秒),会查询这个时间点对应那一天的记录
$params
[
"QueryDate"
]
=
"1234567890123"
;
// fixme 必填: 语音通知为:11000000300006, 语音验证码为:11010000138001, IVR为:11000000300005, 点击拨号为:11000000300004, SIP为:11000000300009
$params
[
"ProdId"
]
=
"11010000138001"
;
// *** 需用户填写部分结束, 以下代码若无必要无需更改 ***
// 初始化SignatureHelper实例用于设置参数,签名以及发送请求
$helper
=
new
SignatureHelper
();
// 此处可能会抛出异常,注意catch
$content
=
$helper
->
request
(
$accessKeyId
,
$accessKeySecret
,
"dyvmsapi.aliyuncs.com"
,
array_merge
(
$params
,
array
(
"RegionId"
=>
"cn-hangzhou"
,
"Action"
=>
"QueryCallDetailByCallId"
,
"Version"
=>
"2017-05-25"
,
)),
$security
);
return
$content
;
}
ini_set
(
"display_errors"
,
"on"
);
// 显示错误提示,仅用于测试时排查问题
// error_reporting(E_ALL); // 显示所有错误提示,仅用于测试时排查问题
set_time_limit
(
0
);
// 防止脚本超时,仅用于测试使用,生产环境请按实际情况设置
header
(
"Content-Type: text/plain; charset=utf-8"
);
// 输出为utf-8的文本格式,仅用于测试
// 验证通过呼叫ID获取呼叫记录(QueryCallDetailByCallId)
print_r
(
queryCallDetailByCallId
());
public/aliyunDyvmsSdk/demo/queryCallDetailByTaskId.php
0 → 100644
浏览文件 @
19c0b50a
<?php
/*
* 此文件用于验证语音服务API接口,供开发时参考
* 执行验证前请确保文件为utf-8编码,并替换相应参数为您自己的信息,并取消相关调用的注释
* 建议验证前先执行Test.php验证PHP环境
*
* 2017/11/30
*/
namespace
Aliyun\DySDKLite\Vms\Demo
;
require_once
dirname
(
__DIR__
)
.
"/SignatureHelper.php"
;
use
Aliyun\DySDKLite\SignatureHelper
;
// todo 接口定义,请先替换相应参数为您自己的信息
/**
* 通过任务ID获取机器人话单详情
*/
function
queryCallDetailByTaskId
()
{
$params
=
array
();
// *** 需用户填写部分 ***
// fixme 必填:是否启用https
$security
=
false
;
// fixme 必填: 请参阅 https://ak-console.aliyun.com/ 取得您的AK信息
$accessKeyId
=
"your access key id"
;
$accessKeySecret
=
"your access key secret"
;
// fixme 必填: 接口返回的任务ID
$params
[
"TaskId"
]
=
"4001112222"
;
// fixme 必填: 被叫号码,目前只支持单个
$params
[
"Callee"
]
=
"13700000000"
;
// fixme 必填: Unix时间戳,会查询这个时间点对应那一天的记录(单位毫秒)
$params
[
"QueryDate"
]
=
time
()
.
'000'
;
// *** 需用户填写部分结束, 以下代码若无必要无需更改 ***
// 初始化SignatureHelper实例用于设置参数,签名以及发送请求
$helper
=
new
SignatureHelper
();
// 此处可能会抛出异常,注意catch
$content
=
$helper
->
request
(
$accessKeyId
,
$accessKeySecret
,
"dyvmsapi.aliyuncs.com"
,
array_merge
(
$params
,
array
(
"RegionId"
=>
"cn-hangzhou"
,
"Action"
=>
"QueryCallDetailByTaskId"
,
"Version"
=>
"2017-05-25"
,
)),
$security
);
return
$content
;
}
ini_set
(
"display_errors"
,
"on"
);
// 显示错误提示,仅用于测试时排查问题
// error_reporting(E_ALL); // 显示所有错误提示,仅用于测试时排查问题
set_time_limit
(
0
);
// 防止脚本超时,仅用于测试使用,生产环境请按实际情况设置
header
(
"Content-Type: text/plain; charset=utf-8"
);
// 输出为utf-8的文本格式,仅用于测试
// 验证通过任务ID获取机器人话单详情(QueryCallDetailByTaskId)
print_r
(
queryCallDetailByTaskId
());
public/aliyunDyvmsSdk/demo/queryRobotInfoList.php
0 → 100644
浏览文件 @
19c0b50a
<?php
/*
* 此文件用于验证语音服务API接口,供开发时参考
* 执行验证前请确保文件为utf-8编码,并替换相应参数为您自己的信息,并取消相关调用的注释
* 建议验证前先执行Test.php验证PHP环境
*
* 2017/11/30
*/
namespace
Aliyun\DySDKLite\Vms\Demo
;
require_once
dirname
(
__DIR__
)
.
"/SignatureHelper.php"
;
use
Aliyun\DySDKLite\SignatureHelper
;
// todo 接口定义,请先替换相应参数为您自己的信息
/**
* 机器人列表查询接口
*/
function
queryRobotInfoList
()
{
$params
=
array
();
// *** 需用户填写部分 ***
// fixme 必填:是否启用https
$security
=
false
;
// fixme 必填: 请参阅 https://ak-console.aliyun.com/ 取得您的AK信息
$accessKeyId
=
"your access key id"
;
$accessKeySecret
=
"your access key secret"
;
// todo 可选: 审核状态,默认返回全部,CONFIGURABLE 可配置 AUDITING 审核中 AUDITPASS 审核通过 AUDITFAIL 审核失败
$params
[
"AuditStatus"
]
=
"AUDITPASS"
;
// *** 需用户填写部分结束, 以下代码若无必要无需更改 ***
// 初始化SignatureHelper实例用于设置参数,签名以及发送请求
$helper
=
new
SignatureHelper
();
// 此处可能会抛出异常,注意catch
$content
=
$helper
->
request
(
$accessKeyId
,
$accessKeySecret
,
"dyvmsapi.aliyuncs.com"
,
array_merge
(
$params
,
array
(
"RegionId"
=>
"cn-hangzhou"
,
"Action"
=>
"QueryRobotInfoList"
,
"Version"
=>
"2017-05-25"
,
)),
$security
);
return
$content
;
}
ini_set
(
"display_errors"
,
"on"
);
// 显示错误提示,仅用于测试时排查问题
// error_reporting(E_ALL); // 显示所有错误提示,仅用于测试时排查问题
set_time_limit
(
0
);
// 防止脚本超时,仅用于测试使用,生产环境请按实际情况设置
header
(
"Content-Type: text/plain; charset=utf-8"
);
// 输出为utf-8的文本格式,仅用于测试
// 验证机器人列表查询接口(QueryRobotInfoList)
print_r
(
queryRobotInfoList
());
public/aliyunDyvmsSdk/demo/singleCallByTts.php
0 → 100644
浏览文件 @
19c0b50a
<?php
/*
* 此文件用于验证语音服务API接口,供开发时参考
* 执行验证前请确保文件为utf-8编码,并替换相应参数为您自己的信息,并取消相关调用的注释
* 建议验证前先执行Test.php验证PHP环境
*
* 2017/11/30
*/
namespace
Aliyun\DySDKLite\Vms\Demo
;
require_once
dirname
(
__DIR__
)
.
"/SignatureHelper.php"
;
use
Aliyun\DySDKLite\SignatureHelper
;
// todo 接口定义,请先替换相应参数为您自己的信息
/**
* 文本转语音外呼
*/
function
singleCallByTts
()
{
$params
=
array
();
// *** 需用户填写部分 ***
// fixme 必填:是否启用https
$security
=
false
;
// fixme 必填: 请参阅 https://ak-console.aliyun.com/ 取得您的AK信息
$accessKeyId
=
"LTAI5t64Hr8rE8NdT1D1jKNh"
;
$accessKeySecret
=
"vpJvj5ksVOy7szD9DFraUbb7yHv8Jb"
;
// fixme 必填: 被叫显号
//$params["CalledShowNumber"] = "4001112222";
// fixme 必填: 被叫显号
$params
[
"CalledNumber"
]
=
"18233154732"
;
// fixme 必填: Tts模板Code
$params
[
"TtsCode"
]
=
"TTS_304855064"
;
// fixme 选填: Tts模板中的变量替换JSON,假如Tts模板中存在变量,则此处必填
//$params["TtsParam"] = array("AckNum" => "123456");
// fixme 选填: 音量
$params
[
"Volume"
]
=
100
;
// fixme 选填: 播放次数
$params
[
"PlayTimes"
]
=
2
;
// fixme 选填: 音量, 取值范围 0~200
$params
[
"Volume"
]
=
100
;
// fixme 选填: 预留给调用方使用的ID, 最终会通过在回执消息中将此ID带回给调用方
$params
[
"OutId"
]
=
"123456"
;
// *** 需用户填写部分结束, 以下代码若无必要无需更改 ***
if
(
!
empty
(
$params
[
"TtsParam"
])
&&
is_array
(
$params
[
"TtsParam"
]))
{
$params
[
"TtsParam"
]
=
json_encode
(
$params
[
"TtsParam"
],
JSON_UNESCAPED_UNICODE
);
}
// 初始化SignatureHelper实例用于设置参数,签名以及发送请求
$helper
=
new
SignatureHelper
();
// 此处可能会抛出异常,注意catch
$content
=
$helper
->
request
(
$accessKeyId
,
$accessKeySecret
,
"dyvmsapi.aliyuncs.com"
,
array_merge
(
$params
,
array
(
"RegionId"
=>
"cn-hangzhou"
,
"Action"
=>
"SingleCallByTts"
,
"Version"
=>
"2017-05-25"
,
)),
$security
);
return
$content
;
}
ini_set
(
"display_errors"
,
"on"
);
// 显示错误提示,仅用于测试时排查问题
// error_reporting(E_ALL); // 显示所有错误提示,仅用于测试时排查问题
set_time_limit
(
0
);
// 防止脚本超时,仅用于测试使用,生产环境请按实际情况设置
header
(
"Content-Type: text/plain; charset=utf-8"
);
// 输出为utf-8的文本格式,仅用于测试
// 验证文本转语音外呼(SingleCallByTts)接口
print_r
(
singleCallByTts
());
\ No newline at end of file
public/aliyunDyvmsSdk/demo/singleCallByVoice.php
0 → 100644
浏览文件 @
19c0b50a
<?php
/*
* 此文件用于验证语音服务API接口,供开发时参考
* 执行验证前请确保文件为utf-8编码,并替换相应参数为您自己的信息,并取消相关调用的注释
* 建议验证前先执行Test.php验证PHP环境
*
* 2017/11/30
*/
namespace
Aliyun\DySDKLite\Vms\Demo
;
require_once
dirname
(
__DIR__
)
.
"/SignatureHelper.php"
;
use
Aliyun\DySDKLite\SignatureHelper
;
// todo 接口定义,请先替换相应参数为您自己的信息
/**
* 语音文件外呼
*/
function
singleCallByVoice
()
{
$params
=
array
();
// *** 需用户填写部分 ***
// fixme 必填:是否启用https
$security
=
false
;
// fixme 必填: 请参阅 https://ak-console.aliyun.com/ 取得您的AK信息
$accessKeyId
=
"your access key id"
;
$accessKeySecret
=
"your access key secret"
;
// fixme 必填: 被叫显号
$params
[
"CalledShowNumber"
]
=
"4001112222"
;
// fixme 必填: 被叫显号
$params
[
"CalledNumber"
]
=
"13700000000"
;
// fixme 必填: 语音文件Code
$params
[
"VoiceCode"
]
=
"c2e99ebc-2d4c-4e78-8d2a-afbb06cf6216.wav"
;
// fixme 选填: 音量
$params
[
"Volume"
]
=
100
;
// fixme 选填: 播放次数
$params
[
"PlayTimes"
]
=
3
;
// fixme 选填: 外呼流水号
// $params["OutId"] = "yourOutId";
// *** 需用户填写部分结束, 以下代码若无必要无需更改 ***
// 初始化SignatureHelper实例用于设置参数,签名以及发送请求
$helper
=
new
SignatureHelper
();
// 此处可能会抛出异常,注意catch
$content
=
$helper
->
request
(
$accessKeyId
,
$accessKeySecret
,
"dyvmsapi.aliyuncs.com"
,
array_merge
(
$params
,
array
(
"RegionId"
=>
"cn-hangzhou"
,
"Action"
=>
"SingleCallByVoice"
,
"Version"
=>
"2017-05-25"
,
)),
$security
);
return
$content
;
}
ini_set
(
"display_errors"
,
"on"
);
// 显示错误提示,仅用于测试时排查问题
// error_reporting(E_ALL); // 显示所有错误提示,仅用于测试时排查问题
set_time_limit
(
0
);
// 防止脚本超时,仅用于测试使用,生产环境请按实际情况设置
header
(
"Content-Type: text/plain; charset=utf-8"
);
// 输出为utf-8的文本格式,仅用于测试
// 验证语音文件外呼(SingleCallByVoice)接口
print_r
(
singleCallByVoice
());
\ No newline at end of file
public/aliyunDyvmsSdk/demo/smartCall.php
0 → 100644
浏览文件 @
19c0b50a
<?php
/*
* 此文件用于验证语音服务API接口,供开发时参考
* 执行验证前请确保文件为utf-8编码,并替换相应参数为您自己的信息,并取消相关调用的注释
* 建议验证前先执行Test.php验证PHP环境
*
* 2017/11/30
*/
namespace
Aliyun\DySDKLite\Vms\Demo
;
require_once
dirname
(
__DIR__
)
.
"/SignatureHelper.php"
;
use
Aliyun\DySDKLite\SignatureHelper
;
// todo 接口定义,请先替换相应参数为您自己的信息
/**
* 智能外呼
*/
function
smartCall
()
{
$params
=
array
();
// *** 需用户填写部分 ***
// fixme 必填:是否启用https
$security
=
false
;
// fixme 必填: 请参阅 https://ak-console.aliyun.com/ 取得您的AK信息
$accessKeyId
=
"your access key id"
;
$accessKeySecret
=
"your access key secret"
;
// fixme 必填: 被叫显号,可在语音控制台中找到所购买的显号
$params
[
"CalledShowNumber"
]
=
"06336760013"
;
// fixme 必填: 被叫号码
$params
[
"CalledNumber"
]
=
"1005"
;
// fixme 必填: 语音文件ID
$params
[
"VoiceCode"
]
=
"3355eedd-3706-4f75-bff9-e645e88e1730.wav"
;
// fixme 选填: 外部扩展字段
$params
[
"OutId"
]
=
"yourOutId"
;
// fixme 选填:放音速度
$params
[
"Speed"
]
=
1
;
// fixme 选填: 音量
$params
[
"Volume"
]
=
10
;
// fixme 选填: 静音时长
$params
[
"MuteTime"
]
=
10000
;
// fixme 选填: 停顿时长
$params
[
"PauseTime"
]
=
800
;
// fixme 选填: 开场放音文件是否可打断,默认为true,打断
$params
[
"ActionCodeBreak"
]
=
"true"
;
// fixme 选填:ASR模型ID
$params
[
"AsrModelId"
]
=
"2070aca1eff146f9a7bc826f1c3d4d31"
;
// *** 需用户填写部分结束, 以下代码若无必要无需更改 ***
// 初始化SignatureHelper实例用于设置参数,签名以及发送请求
$helper
=
new
SignatureHelper
();
// 此处可能会抛出异常,注意catch
$content
=
$helper
->
request
(
$accessKeyId
,
$accessKeySecret
,
"dyvmsapi.aliyuncs.com"
,
array_merge
(
$params
,
array
(
"RegionId"
=>
"cn-hangzhou"
,
"Action"
=>
"SmartCall"
,
"Version"
=>
"2017-05-25"
,
)),
$security
);
return
$content
;
}
ini_set
(
"display_errors"
,
"on"
);
// 显示错误提示,仅用于测试时排查问题
// error_reporting(E_ALL); // 显示所有错误提示,仅用于测试时排查问题
set_time_limit
(
0
);
// 防止脚本超时,仅用于测试使用,生产环境请按实际情况设置
header
(
"Content-Type: text/plain; charset=utf-8"
);
// 输出为utf-8的文本格式,仅用于测试
// 验证智能外呼(SmartCall)接口
print_r
(
smartCall
());
routes/api.php
浏览文件 @
19c0b50a
...
...
@@ -1151,6 +1151,14 @@ Route::group(
Route
::
group
([
'prefix'
=>
'SynOrderRejected'
],
function
(){
Route
::
get
(
'rejectedOrder'
,
'SynOrderRejectedController@rejectedOrder'
);
//自动拒单
});
#系统任务 >> 电话通知
Route
::
group
([
'prefix'
=>
'SingLeCallByTts'
],
function
(){
Route
::
get
(
'getSingleCallByTts'
,
'SingLeCallByTtsController@getSingleCallByTts'
);
//电话通知
});
#系统任务 >> 电话通知
Route
::
group
([
'prefix'
=>
'getCallByTtsCost'
],
function
(){
Route
::
get
(
'getCallByTtsCost'
,
'SysCallByTtsCostController@getCallByTtsCost'
);
//电弧通知扣费
});
#天猫服务单
/* Route::group(['prefix'=>'tmOrder'], function (){
Route::post('addOrderByTm', 'AddTmOrderController@addOrderByTm');//添加天猫单
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论