Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
Z
zptz-sass-kelaidian
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
李大见
zptz-sass-kelaidian
Commits
5f4e1cbb
提交
5f4e1cbb
authored
9月 20, 2024
作者:
李大见
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'master' of
http://gitlab.bluearp.com/ldj/zptz-sass-kelaidian
上级
f097e136
08ae72ef
显示空白字符变更
内嵌
并排
正在显示
18 个修改的文件
包含
219 行增加
和
55 行删除
+219
-55
OrderListController.php
app/Http/Controllers/Api/MobileWeb/OrderListController.php
+5
-0
CommonController.php
app/Http/Controllers/Common/CommonController.php
+1
-1
OrderListController.php
app/Http/Controllers/Orders/OrderListController.php
+4
-0
PayController.php
app/Http/Controllers/Service/PayController.php
+1
-1
ServiceProviderController.php
app/Http/Controllers/Service/ServiceProviderController.php
+7
-0
WarehouseController.php
app/Http/Controllers/Service/WarehouseController.php
+6
-2
LoginController.php
app/Http/Controllers/User/LoginController.php
+9
-1
RequestPcMiddleware.php
app/Http/Middleware/RequestPcMiddleware.php
+1
-0
WebLogin.php
app/Http/Middleware/WebLogin.php
+6
-1
AftersaleOrderValidator.php
...ests/Validators/Api/MobileWeb/AftersaleOrderValidator.php
+2
-2
AftersaleOrderService.php
app/Services/AftersaleOrderService.php
+1
-0
AftersaleOrderService.php
app/Services/Api/MobileWeb/AftersaleOrderService.php
+21
-9
LoginService.php
app/Services/Api/MobileWeb/LoginService.php
+78
-14
OrderListService.php
app/Services/Api/MobileWeb/OrderListService.php
+52
-15
StatementsListService.php
app/Services/Api/MobileWeb/StatementsListService.php
+13
-3
OrderListService.php
app/Services/OrderListService.php
+11
-6
OrderService.php
app/Services/OrderService.php
+0
-0
api.php
routes/api.php
+1
-0
没有找到文件。
app/Http/Controllers/Api/MobileWeb/OrderListController.php
浏览文件 @
5f4e1cbb
...
...
@@ -268,4 +268,9 @@ class OrderListController extends Controller
$return_data
=
OrderListService
::
LicenseFeedback
(
$request
->
all
());
return
response
()
->
json
(
$return_data
);
}
//获取施工门店信息
public
function
getService
(
Request
$request
){
$return_data
=
OrderListService
::
getService
(
$request
->
all
());
return
response
()
->
json
(
$return_data
);
}
}
app/Http/Controllers/Common/CommonController.php
浏览文件 @
5f4e1cbb
...
...
@@ -392,7 +392,7 @@ class CommonController extends BaseController
break
;
case
2
:
if
(
$parameter
[
'company_name_like'
]
!=
'统一价格'
)
{
$parameter
[
'admin_groupnew
'
]
=
2
;
$parameter
[
'admin_groupnew
_searchin'
]
=
[
2
,
3
]
;
$list
=
AdminsService
::
getAdmins
(
$parameter
,
[
'id'
,
'company_name'
],
[]);
if
(
$Pri_id
!=
86
)
{
$lists
[
0
][
'id'
]
=
'0'
;
...
...
app/Http/Controllers/Orders/OrderListController.php
浏览文件 @
5f4e1cbb
...
...
@@ -133,6 +133,8 @@ class OrderListController extends BaseController
$where
=
"is_delete = 1"
;
if
(
$session_token
[
'admin_groupnew'
]
==
2
){
$where
.=
" and ser_id='"
.
$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
]))
{
$where
.=
" and p_id in ("
.
$session_token
[
'admin_pt_id'
]
.
")"
;
...
...
@@ -143,6 +145,8 @@ 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'
]
.
")"
;
...
...
app/Http/Controllers/Service/PayController.php
浏览文件 @
5f4e1cbb
...
...
@@ -90,7 +90,7 @@ class PayController extends BaseController
if
(
$list
){
foreach
(
$list
as
$k
=>
$v
){
$button
=
[];
if
(
$v
[
'reo_pay_state'
]
==
1
&&
$v
[
'reo_type'
]
==
1
){
if
(
$v
[
'reo_pay_state'
]
==
1
&&
$v
[
'reo_type'
]
==
1
&&
$v
[
''
]
){
$button
[]
=
'payment'
;
}
$button
=
BmmcService
::
getListButton
(
$button
,
$all_button
);
...
...
app/Http/Controllers/Service/ServiceProviderController.php
浏览文件 @
5f4e1cbb
...
...
@@ -414,7 +414,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
=
explode
(
','
,
$agent_brand
);
$brandList
=
CommonService
::
arrayFilterFieldValue
(
$brandList
,[[
'id'
=>
$agent_brand
]]);
}
else
{
$brandList
=
CommonService
::
arrayFilterFieldValue
(
$brandList
,[[
'company_id'
=>
$session
[
'company_id'
]]]);
}
$serviceTypes
=
CategoryService
::
getAll
();
//服务类型
// $serviceItems = ServiceItemsService::getAll(); //服务项目
$serviceItems
=
PjBrandsService
::
dataList
();
//门店属性
...
...
@@ -543,6 +549,7 @@ class ServiceProviderController extends BaseController
// $adminData = $request->only(array_keys($this->validateRules['rules']));
$adminData
=
$this
->
_setAdminData
(
$adminData
,
$request
);
$adminData
[
'company_id'
]
=
$session
[
'company_id'
];
$adminData
[
'company_type'
]
=
$session
[
'com_type'
];
if
(
$adminData
[
'admin_groupnew'
]
==
3
)
{
//经销商新增一个公司
$adminData
[
'admin_groupnew'
]
=
3
;
...
...
app/Http/Controllers/Service/WarehouseController.php
浏览文件 @
5f4e1cbb
...
...
@@ -39,6 +39,7 @@ class WarehouseController extends BaseController
$session
=
Request
()
->
get
(
'session_token'
);
//用户信息
$Db
=
new
Warehouse
();
$Db
=
$Db
->
leftjoin
(
'company'
,
'com_id'
,
'='
,
'company_id'
);
$Db
=
$Db
->
where
(
'com_type'
,
2
);
if
(
$request
->
filled
(
'shck_ckmc'
)){
//仓库名称
$shck_ckmc
=
$request
->
input
(
'shck_ckmc'
);
$Db
=
$Db
->
where
(
'shck_ckmc'
,
'like'
,
'%'
.
$shck_ckmc
.
'%'
);
...
...
@@ -231,9 +232,12 @@ class WarehouseController extends BaseController
->
leftjoin
(
'pj_goods as p'
,
'p.pg_id'
,
'='
,
'g.goio_goo_id'
)
->
leftjoin
(
'warehouse as w'
,
'g.goio_ware_id'
,
'='
,
'w.id'
)
->
leftjoin
(
'company as c'
,
'c.com_id'
,
'='
,
'w.company_id'
)
->
where
(
function
(
$query
)
use
(
$request
)
{
->
where
(
function
(
$query
)
use
(
$request
,
$session
)
{
if
(
$session
[
'com_type'
]
==
2
)
{
$query
->
where
(
'w.company_id'
,
$session
[
'company_id'
]);
}
if
(
!
empty
(
$request
[
'company_id'
]))
{
$query
->
where
(
'company_id'
,
$request
[
'company_id'
]);
$query
->
where
(
'
w.
company_id'
,
$request
[
'company_id'
]);
}
})
->
where
(
function
(
$query
)
use
(
$request
)
{
...
...
app/Http/Controllers/User/LoginController.php
浏览文件 @
5f4e1cbb
...
...
@@ -231,8 +231,16 @@ class LoginController extends BaseController
* |----------------------------------------------------------------------
*/
public
function
getGroupData
(
$parameter
,
$result
,
$ip
){
$com_parent_id
=
Company
::
where
(
"com_id"
,
$result
[
'company_id'
])
->
value
(
'com_parent_id'
);
$company
=
Company
::
where
(
"com_id"
,
$result
[
'company_id'
])
->
first
();
$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_type'
]
=
$company
[
'com_type'
];
if
(
$company
[
'com_type'
]
==
2
){
$company
[
'search_id'
]
=
Admin
::
where
(
'company_id'
,
$result
[
'company_id'
])
->
where
(
"admin_groupnew"
,
3
)
->
value
(
'id'
);
}
else
{
$company
[
'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
){
...
...
app/Http/Middleware/RequestPcMiddleware.php
浏览文件 @
5f4e1cbb
...
...
@@ -2,6 +2,7 @@
namespace
App\Http\Middleware
;
use
App\Models\Company
;
use
Closure
;
use
DB
;
use
App\Models\AdminToken
;
...
...
app/Http/Middleware/WebLogin.php
浏览文件 @
5f4e1cbb
...
...
@@ -2,6 +2,7 @@
namespace
App\Http\Middleware
;
use
App\Models\Admin
;
use
Closure
;
use
DB
;
use
Illuminate\Support\Facades\Crypt
;
...
...
@@ -55,7 +56,7 @@ class WebLogin
$now_time
=
$hours
+
10
*
60
*
60
;
if
(
$now_time
>
$login_web
[
'lowe_last_login'
])
{
// 每隔2个小时更新一次,降低更新次数,如果登录时间超过2个小时在操作就当前时间加12小时
DB
::
table
(
'login_web'
)
->
where
(
'api_token'
,
'='
,
$api_token
)
->
update
([
'lowe_last_login'
=>
$hours
+
12
*
60
*
60
]);
DB
::
table
(
'login_web'
)
->
where
(
'api_token'
,
'='
,
$api_token
)
->
update
([
'lowe_last_login'
=>
$hours
+
7
*
24
*
60
*
60
]);
}
$request
[
'api_token'
]
=
$api_token
;
//赋值解密后的token值
$session
[
'user_type'
]
=
$login_web
[
'user_type'
];
//用户账号类型
...
...
@@ -63,6 +64,10 @@ class WebLogin
$session
[
'install_id'
]
=
$login_web
[
'install_id'
];
//操作人id
$session
[
'admin_id'
]
=
$login_web
[
'admin_id'
];
//所属服务商id
$session
[
'install_name'
]
=
$login_web
[
'install_name'
];
//操作人信息
if
(
$login_web
[
'user_type'
]
==
3
){
$admin_id
=
Admin
::
where
(
'company_id'
,
$login_web
[
'company_id'
])
->
where
(
'admin_groupnew'
,
3
)
->
value
(
'id'
);
$session
[
'admin_id'
]
=
$admin_id
;
//所属服务商id
}
$request
[
'session'
]
=
$session
;
return
$next
(
$request
);
}
...
...
app/Http/Requests/Validators/Api/MobileWeb/AftersaleOrderValidator.php
浏览文件 @
5f4e1cbb
...
...
@@ -85,7 +85,7 @@ class AftersaleOrderValidator extends FormRequest
return
$validator
->
errors
();
}
}
//
日常反馈验证器
//
上传图片
public
function
uploadValidator
(
$data
)
{
// 自定义错误消息
...
...
@@ -107,7 +107,7 @@ class AftersaleOrderValidator extends FormRequest
}
}
//
添加图片验证器
//
删除图片
public
function
deletPicValidator
(
$data
)
{
// 自定义错误消息
...
...
app/Services/AftersaleOrderService.php
浏览文件 @
5f4e1cbb
...
...
@@ -890,6 +890,7 @@ class AftersaleOrderService extends Service
}
$post
[
'after_type'
]
=
$after_type
;
$post
[
'company_id'
]
=
$session
[
'company_id'
];
$post
[
'agency_id'
]
=
$orderInfo
[
'agency_id'
]
??
'0'
;
$rea
=
OrderAfter
::
insertGetId
(
$post
);
/*---------------------------------------添加售后数据结束------------------------------------------*/
if
(
$rea
){
...
...
app/Services/Api/MobileWeb/AftersaleOrderService.php
浏览文件 @
5f4e1cbb
...
...
@@ -45,7 +45,14 @@ class AftersaleOrderService extends Model
$session
=
$request
[
'session'
];
// 查询列表
$list_data
=
DB
::
table
(
'order_after as o'
);
$where
[
'ser_id'
]
=
$session
[
'admin_id'
];
//服务商id
if
(
$session
[
'user_type'
]
==
3
){
$where
[
'agency_id'
]
=
$session
[
'company_id'
];
//服务商id
if
(
isset
(
$request
[
'search_company_id'
])
&&
!
empty
(
$request
[
'search_company_id'
])){
//仅展示本门店
$where
[
'ser_id'
]
=
$request
[
'search_company_id'
];
//服务商id
}
}
else
{
$where
[
'ser_id'
]
=
$session
[
'admin_id'
];
//服务商id
}
if
(
!
empty
(
$session
[
'install_id'
])
&&
$session
[
'user_type'
]
==
1
)
{
$where
[
'intall_id'
]
=
$session
[
'install_id'
];
//技师id
}
...
...
@@ -66,7 +73,8 @@ class AftersaleOrderService extends Model
}
$wheres
=
array_merge
(
$where
,
$wheres
);
$wheres
=
CommonService
::
jointWhere
(
$wheres
);
$list_data
=
$list_data
->
whereRaw
(
$wheres
)
$list_data
=
$list_data
->
whereRaw
(
$wheres
)
->
select
(
'id'
,
'after_num'
,
'shr_id'
,
'shr_name'
,
'shr_phone'
,
'shr_address'
,
'shr_sheng'
,
'shr_shi'
,
'shr_xian'
,
'good_names'
,
'create_time'
,
'deal_sertime'
,
'finish_time'
,
'status'
,
'day_time'
);
$list_data
=
$list_data
->
orderby
(
'id'
,
'desc'
);
...
...
@@ -97,11 +105,15 @@ class AftersaleOrderService extends Model
$list_items
[
$key
][
'first_name'
]
=
$mb_first
;
$list_items
[
$key
][
'day_time'
]
=
empty
(
$value
[
'day_time'
])
?
'--'
:
$value
[
'day_time'
];
$list_items
[
$key
][
'button'
]
=
[];
if
(
in_array
(
$value
[
'status'
],[
1
])){
$list_items
[
$key
][
'button'
]
=
[[
'action'
=>
'handle_ive'
,
'name'
=>
'立即处理'
]];
if
(
$session
[
'user_type'
]
==
3
&&
$value
[
'ser_id'
]){
}
else
{
if
(
in_array
(
$value
[
'status'
],
[
1
]))
{
$list_items
[
$key
][
'button'
]
=
[[
'action'
=>
'handle_ive'
,
'name'
=>
'立即处理'
]];
}
if
(
in_array
(
$value
[
'status'
],
[
10
]))
{
$list_items
[
$key
][
'button'
]
=
[[
'action'
=>
'quality'
,
'name'
=>
'申请完成'
],
[
'action'
=>
'dailyFeedback'
,
'name'
=>
'日常反馈'
]];
}
if
(
in_array
(
$value
[
'status'
],[
10
])){
$list_items
[
$key
][
'button'
]
=
[[
'action'
=>
'quality'
,
'name'
=>
'申请完成'
],[
'action'
=>
'dailyFeedback'
,
'name'
=>
'日常反馈'
]];
}
}
$page
[
'count'
]
=
$list_data
->
total
();
//总数据个数
...
...
@@ -349,8 +361,8 @@ class AftersaleOrderService extends Model
* @param [type] $data [description]
* @return [type] [description]
*/
public
static
function
quality
(
$data
)
{
$session
=
$data
(
'session'
)
;
public
static
function
quality
(
$data
)
{
$session
=
$data
[
'session'
]
;
$find_data
=
OrderAfter
::
where
(
'id'
,
$data
[
'id'
])
->
first
();
$serial_number
=
$find_data
[
'serial_number'
];
if
(
$find_data
[
'status'
]
==
1
||
$find_data
[
'status'
]
==
10
||
$find_data
[
'status'
]
==
15
){
...
...
@@ -358,7 +370,7 @@ class AftersaleOrderService extends Model
return
[
'ErrorCode'
=>
2
,
'ErrorMessage'
=>
'售后状态错误'
,
'Data'
=>
[]];
}
Db
::
beginTransaction
();
$rest
=
CommonService
::
accMe
(
$find_data
[
'sys_num'
],
"售后订单"
,
"【售后】申请完成,"
.
$data
[
'
quality_content
'
],
$serial_number
,
'2'
,
2
,
$session
[
'install_name'
],
$session
[
'install_id'
]);
$rest
=
CommonService
::
accMe
(
$find_data
[
'sys_num'
],
"售后订单"
,
"【售后】申请完成,"
.
$data
[
'
remark
'
],
$serial_number
,
'2'
,
2
,
$session
[
'install_name'
],
$session
[
'install_id'
]);
if
(
$rest
){
$get
[
'deal_time'
]
=
date
(
"Y-m-d H:i:s"
);
...
...
app/Services/Api/MobileWeb/LoginService.php
浏览文件 @
5f4e1cbb
...
...
@@ -16,13 +16,18 @@ class LoginService
// 登录
public
static
function
login
(
$request
)
{
if
(
isset
(
$request
[
'logins_type'
])
&&
$request
[
'logins_type'
]
==
2
){
$password
=
$request
[
'password'
];
}
else
{
$password
=
md5
(
$request
[
'password'
]);
}
if
(
$request
[
'user_type'
]
==
1
)
{
//技师登录
// 查询登录账号数据
$find_person
=
DB
::
table
(
'install_person as install'
)
->
leftJoin
(
'admin as adm'
,
'install.admin_id'
,
'='
,
'adm.id'
)
->
where
(
'delet_y'
,
1
)
->
where
(
'check_code'
,
$request
[
'account'
])
->
where
(
'install_password'
,
md5
(
$request
[
'password'
])
)
->
where
(
'install_password'
,
$password
)
->
select
(
'install.id'
,
'check_code'
,
'install_name'
,
'install_phone'
,
'install_is_type'
,
'admin_id'
,
'adm.company_id'
,
'admin_groupnew'
)
->
first
();
}
elseif
(
$request
[
'user_type'
]
==
2
)
{
//服务商登录
...
...
@@ -31,33 +36,34 @@ class LoginService
return
[
'ErrorCode'
=>
201
,
'ErrorMessage'
=>
'请填写公司名称!'
,
'data'
=>
''
];
}
//查询公司名称是否存在
$company_id
=
Company
::
where
(
"com_name"
,
$request
[
'company_name'
])
->
value
(
'com_id'
);
$company
=
Company
::
where
(
"com_name"
,
$request
[
'company_name'
])
->
select
(
'com_id'
,
'com_type'
)
->
first
();
$company_id
=
$company
[
'com_id'
];
// 查询登录账号数据
$find_person
=
DB
::
table
(
'admin as adm'
)
->
leftJoin
(
'admin_infor as adin'
,
'adin.admin_id'
,
'='
,
'adm.id'
)
->
where
(
'admin_acc'
,
$request
[
'account'
])
->
where
(
'company_id'
,
$company_id
)
->
whereIn
(
'admin_groupnew'
,
[
2
,
3
])
->
where
(
'admin_password'
,
md5
(
$request
[
'password'
])
)
->
where
(
'admin_password'
,
$password
)
->
select
(
'adm.id'
,
'admin_acc as check_code'
,
'admin_name as install_name'
,
'phone as install_phone'
,
'enable as install_is_type'
,
'adm.id as admin_id'
,
'admin_groupnew'
,
'company_id'
)
->
first
();
$find_person
=
CommonService
::
dataToArray
(
$find_person
);
}
if
(
empty
(
$find_person
))
{
return
[
'ErrorCode'
=>
202
,
'ErrorMessage'
=>
'账号密码错误!'
,
'data'
=>
''
];
return
[
'ErrorCode'
=>
202
,
'ErrorMessage'
=>
'账号密码错误!'
,
'data'
=>
''
];
}
if
(
$find_person
[
'install_is_type'
]
!=
1
)
{
return
[
'ErrorCode'
=>
203
,
'ErrorMessage'
=>
'当前账号已停用!'
,
'data'
=>
''
];
}
if
(
$request
[
'user_type'
]
==
2
&&
$
find_person
[
'admin_groupnew'
]
==
3
){
if
(
$request
[
'user_type'
]
==
2
&&
$
company
[
'com_type'
]
==
2
){
$request
[
'user_type'
]
=
3
;
}
if
(
$request
[
'openid'
]
)
{
if
(
isset
(
$request
[
'openid'
])
&&
$request
[
'openid'
]
!=
''
)
{
// 微信授权绑定用户信息
$bingding_res
=
self
::
accreditBinding
(
$request
,
$find_person
);
}
$expiration_time
=
12
*
60
*
60
;
//登录过期时间
$expiration_time
=
7
*
24
*
60
*
60
;
//登录过期时间
// 生成token
$unique_string
=
md5
(
uniqid
(
md5
(
microtime
(
true
))
.
rand
(
100000
,
999999
),
true
));
//生成唯一字符串
$api_token
=
sha1
(
$unique_string
);
//加密
...
...
@@ -155,6 +161,7 @@ class LoginService
'button'
=>
$button
,
'user_type'
=>
$request
[
'user_type'
],
'button_more'
=>
$button_more
,
'openid'
=>
$request
[
'openid'
],
];
return
[
'ErrorCode'
=>
1
,
'ErrorMessage'
=>
'登录成功'
,
'data'
=>
$return_data
];
}
else
{
...
...
@@ -165,12 +172,33 @@ class LoginService
// 微信授权绑定
public
static
function
accreditBinding
(
$request
,
$find_person
)
{
if
(
$request
[
'user_type'
]
==
1
){
$type
=
2
;
}
else
{
$type
=
1
;
}
$master
=
DB
::
table
(
'ser_master'
)
->
where
(
'wechat_number'
,
$request
[
'openid'
])
->
where
(
'ser_id'
,
$find_person
[
'id'
])
->
where
(
'type'
,
$type
)
->
value
(
'id'
);
if
(
!
$master
&&
isset
(
$request
[
'push_type'
])
&&
$request
[
'push_type'
]
==
1
){
$poss
[
'wechat_number'
]
=
$request
[
'openid'
];
$poss
[
'ser_id'
]
=
$find_person
[
'id'
];
$poss
[
'creact_time'
]
=
date
(
"Y-m-d H:i:s"
);
$poss
[
'company_id'
]
=
$find_person
[
'company_id'
];
$poss
[
'type'
]
=
$type
;
DB
::
table
(
'ser_master'
)
->
insert
(
$poss
);
}
elseif
(
isset
(
$request
[
'push_type'
])
&&
$request
[
'push_type'
]
==
2
&&
$master
){
DB
::
table
(
'ser_master'
)
->
where
(
'id'
,
$master
)
->
update
([
'is_delet'
=>
2
]);
}
// 查询数据表openID是否存在绑定,存在绑定改为离线
DB
::
table
(
'installation_master'
)
->
where
(
'wechat_number'
,
$request
[
'openid'
])
->
update
([
'priority'
=>
2
,
'update_time'
=>
date
(
'Y-m-d H:i:s'
)]);
$find_data
=
DB
::
table
(
'installation_master'
)
->
where
(
'check_code'
,
$find_person
[
'
check_code
'
])
->
where
(
'check_code'
,
$find_person
[
'
id
'
])
->
where
(
'type'
,
$request
[
'user_type'
])
->
value
(
'id'
);
if
(
$find_data
){
...
...
@@ -181,11 +209,10 @@ class LoginService
// 新增绑定关系
$data
[
'wechat_number'
]
=
$request
[
'openid'
];
$data
[
'type'
]
=
$request
[
'user_type'
];
$data
[
'check_code'
]
=
$find_person
[
'
check_code
'
];
$data
[
'check_code'
]
=
$find_person
[
'
id
'
];
$data
[
'inst_name'
]
=
$find_person
[
'install_name'
];
$data
[
'inst_phone'
]
=
$find_person
[
'install_phone'
];
$data
[
'admin_id'
]
=
$find_person
[
'admin_id'
];
$data
[
'install_id'
]
=
$find_person
[
'id'
];
$data
[
'adminn_id'
]
=
$find_person
[
'admin_id'
];
$data
[
'priority'
]
=
1
;
return
DB
::
table
(
'installation_master'
)
->
insert
(
$data
);
}
...
...
@@ -276,10 +303,47 @@ class LoginService
$result
=
CommonService
::
requestGet
(
$url
);
$jsoninfo
=
json_decode
(
$result
,
true
);
if
(
isset
(
$jsoninfo
[
"openid"
])){
return
[
"ErrorCode"
=>
1
,
'ErrorMessage'
=>
'操作成功'
,
'data'
=>
$jsoninfo
[
"openid"
]];
$return_data
=
[
'api_token'
=>
''
,
//生成前台token
'account'
=>
''
,
'install_name'
=>
''
,
'install_phone'
=>
''
,
'install_id'
=>
''
,
'admin_id'
=>
''
,
'company_id'
=>
''
,
'openid'
=>
$jsoninfo
[
"openid"
],
];
$find_data
=
DB
::
table
(
'installation_master'
)
->
where
(
'wechat_number'
,
$jsoninfo
[
"openid"
])
->
where
(
"priority"
,
1
)
->
first
();
//openid
if
(
$find_data
){
if
(
$find_data
[
'type'
]
==
1
){
$admin
=
InstallPerson
::
where
(
'id'
,
$find_data
[
'check_code'
])
->
select
(
'check_code as admin_acc'
,
'install_password as admin_password'
)
->
first
();
$login
[
'user_type'
]
=
1
;
$company_name
=
''
;
}
else
{
$admin
=
Admin
::
where
(
'id'
,
$find_data
[
'check_code'
])
->
select
(
'admin_acc'
,
'admin_password'
,
'company_id'
)
->
first
();
if
(
$admin
){
$company_name
=
Company
::
where
(
"com_id"
,
$admin
[
'company_id'
])
->
value
(
'com_name'
);
}
$login
[
'user_type'
]
=
2
;
}
$login
[
'logins_type'
]
=
2
;
$login
[
'login_type'
]
=
1
;
$login
[
'account'
]
=
$admin
[
'admin_acc'
];
$login
[
'password'
]
=
$admin
[
'admin_password'
];
$login
[
'company_name'
]
=
$company_name
;
$login
[
'openid'
]
=
$jsoninfo
[
"openid"
];
$data
=
self
::
login
(
$login
);
if
(
$data
[
'ErrorCode'
]
==
1
){
return
[
'ErrorCode'
=>
1
,
'ErrorMessage'
=>
'操作成功'
,
'data'
=>
$data
[
'data'
]];
}
}
return
[
'ErrorCode'
=>
201
,
'ErrorMessage'
=>
'自动登录失败'
,
'data'
=>
$return_data
];
}
else
{
return
[
"ErrorCode"
=>
ErrorInc
::
SAPI_FAILED
,
'ErrorMessage'
=>
'
操作
失败'
,
'data'
=>
$jsoninfo
];
return
[
"ErrorCode"
=>
ErrorInc
::
SAPI_FAILED
,
'ErrorMessage'
=>
'
自动登录
失败'
,
'data'
=>
$jsoninfo
];
}
$openid
=
$jsoninfo
[
"openid"
];
}
}
app/Services/Api/MobileWeb/OrderListService.php
浏览文件 @
5f4e1cbb
...
...
@@ -38,7 +38,14 @@ class OrderListService extends Model
// 查询列表
$list_data
=
DB
::
table
(
'order_list as ol'
)
->
leftJoin
(
'user as u'
,
'ol.customer_id'
,
'='
,
'u.id'
);
$where
[
'ser_id'
]
=
$session
[
'admin_id'
];
//服务商id
if
(
$session
[
'user_type'
]
==
3
){
$where
[
'agency_id'
]
=
$session
[
'company_id'
];
//服务商id
if
(
isset
(
$request
[
'search_company_id'
])
&&
!
empty
(
$request
[
'search_company_id'
])){
//仅展示本门店
$where
[
'ser_id'
]
=
$request
[
'search_company_id'
];
//服务商id
}
}
else
{
$where
[
'ser_id'
]
=
$session
[
'admin_id'
];
//服务商id
}
$where
[
'is_delete'
]
=
1
;
//是否删除:1正常2删除
if
(
!
empty
(
$session
[
'install_id'
])
&&
$session
[
'user_type'
]
==
1
)
{
$where
[
'install_id'
]
=
$session
[
'install_id'
];
//技师id
...
...
@@ -128,41 +135,50 @@ class OrderListService extends Model
$list_items
[
$key
][
'button'
]
=
[];
if
(
$value
[
'locklist_type'
]
!=
2
){
if
(
in_array
(
$value
[
'stauas'
],[
10
,
20
])){
if
(
$session
[
'user_type'
]
!=
1
)
{
if
(
$session
[
'user_type'
]
==
3
&&
$value
[
'ser_id'
]
!=
$session
[
'admin_id'
]){
}
else
{
if
(
$session
[
'user_type'
]
!=
1
)
{
$list_items
[
$key
][
'button'
]
=
[[
'action'
=>
'receiving'
,
'name'
=>
'接单'
],
[
'action'
=>
'refuse'
,
'name'
=>
'拒单'
]];
}
}
}
elseif
(
$value
[
'stauas'
]
==
30
){
if
(
$request
[
'stauas'
]
==
2
){
if
(
$session
[
'user_type'
]
!=
1
)
{
if
(
$session
[
'user_type'
]
==
3
&&
$value
[
'ser_id'
]
!=
$session
[
'admin_id'
]){
$list_items
[
$key
][
'button'
][]
=
[
'action'
=>
'copyInfo'
,
'name'
=>
'复制信息'
];
}
else
{
if
(
$request
[
'stauas'
]
==
2
)
{
if
(
$session
[
'user_type'
]
!=
1
)
{
$list_items
[
$key
][
'button'
][]
=
[
'action'
=>
'transferOfOrder'
,
'name'
=>
'改派'
];
}
}
if
(
$request
[
'stauas'
]
==
3
){
}
if
(
$request
[
'stauas'
]
==
3
)
{
$list_items
[
$key
][
'line_state'
]
=
1
;
if
(
isset
(
$installLine
[
$value
[
'serial_number'
]][
'line_state'
]))
{
if
(
isset
(
$installLine
[
$value
[
'serial_number'
]][
'line_state'
]))
{
$list_items
[
$key
][
'line_state'
]
=
$installLine
[
$value
[
'serial_number'
]][
'line_state'
];
switch
(
$installLine
[
$value
[
'serial_number'
]][
'line_state'
]
)
{
switch
(
$installLine
[
$value
[
'serial_number'
]][
'line_state'
])
{
case
2
:
$list_items
[
$key
][
'button'
][]
=
[
'action'
=>
'lineStart'
,
'name'
=>
'出发'
];
$list_items
[
$key
][
'button'
][]
=
[
'action'
=>
'lineStart'
,
'name'
=>
'出发'
];
break
;
case
3
:
$list_items
[
$key
][
'button'
][]
=
[
'action'
=>
'lineArrive'
,
'name'
=>
'抵达'
];
$list_items
[
$key
][
'button'
][]
=
[
'action'
=>
'lineArrive'
,
'name'
=>
'抵达'
];
break
;
case
4
:
$list_items
[
$key
][
'button'
][]
=
[
'action'
=>
'startInstall'
,
'name'
=>
'开始安装'
];
$list_items
[
$key
][
'button'
][]
=
[
'action'
=>
'startInstall'
,
'name'
=>
'开始安装'
];
break
;
case
5
:
$list_items
[
$key
][
'button'
][]
=
[
'action'
=>
'installFeedback'
,
'name'
=>
'申请完成'
];
$list_items
[
$key
][
'button'
][]
=
[
'action'
=>
'installFeedback'
,
'name'
=>
'申请完成'
];
break
;
default
:
;
break
;
}
$list_items
[
$key
][
'button'
][]
=
[
'action'
=>
'contact'
,
'name'
=>
'修改预约'
];
}
else
{
$list_items
[
$key
][
'button'
][]
=
[
'action'
=>
'contact'
,
'name'
=>
'预约时间'
];
$list_items
[
$key
][
'button'
][]
=
[
'action'
=>
'contact'
,
'name'
=>
'修改预约'
];
}
else
{
$list_items
[
$key
][
'button'
][]
=
[
'action'
=>
'contact'
,
'name'
=>
'预约时间'
];
}
}
$list_items
[
$key
][
'button'
][]
=
[
'action'
=>
'copyInfo'
,
'name'
=>
'复制信息'
];
}
}
elseif
(
$value
[
'stauas'
]
==
34
||
$value
[
'stauas'
]
==
40
){
$list_items
[
$key
][
'button'
]
=
[[
'action'
=>
'copyInfo'
,
'name'
=>
'复制信息'
]];
}
...
...
@@ -1311,7 +1327,28 @@ class OrderListService extends Model
}
return
[
'ErrorCode'
=>
1
,
'ErrorMessage'
=>
'获取信息成功'
,
'Data'
=>
$order_list
];
}
/**|---------------------------------------------------------------------------------
* @name 获取服务商
* @retrun \Illuminate\Http\JsonResponse /multitype:array
* @author dou 2024/9/18 15:55
* |---------------------------------------------------------------------------------
*/
public
static
function
getService
(
$request
){
$session
=
$request
[
'session'
];
if
(
$session
[
'user_type'
]
==
3
){
$list
=
Admin
::
whereIn
(
'admin_groupnew'
,[
2
,
3
])
->
where
(
"company_id"
,
$session
[
'company_id'
]);
if
(
isset
(
$request
[
'company_name'
])
&&
!
empty
(
$request
[
'company_name'
])){
$list
=
$list
->
where
(
"company_name"
,
'like'
,
'%'
.
$request
[
'company_name'
]
.
'%'
);
}
$list
=
$list
->
orderBy
(
'admin_groupnew'
,
'DESC'
)
->
select
(
'id'
,
'company_name'
)
->
get
();
}
else
{
$list
=
[];
}
return
[
'ErrorCode'
=>
1
,
'ErrorMessage'
=>
'操作成功'
,
'Data'
=>
$list
];
}
// 获取技师
public
static
function
getInstallPerson
(
$request
)
{
...
...
app/Services/Api/MobileWeb/StatementsListService.php
浏览文件 @
5f4e1cbb
...
...
@@ -46,9 +46,19 @@ class StatementsListService extends Model
if
(
$request
[
'status'
]
==
1
)
{
//未出账单
$list_data
=
DB
::
table
(
'settlement_list as s'
)
->
leftJoin
(
'order_list as o'
,
'o.serial_number'
,
'='
,
's.list_id'
)
->
leftJoin
(
'order_msg as om'
,
'om.id'
,
'='
,
'o.order_goods_id'
)
->
where
(
's.ser_id'
,
$session
[
'admin_id'
])
->
where
(
'list_service_type'
,
40
)
->
leftJoin
(
'order_msg as om'
,
'om.id'
,
'='
,
'o.order_goods_id'
);
if
(
$session
[
'user_type'
]
==
3
){
$list_data
=
$list_data
->
where
(
's.agency_id'
,
$session
[
'company_id'
]);
if
(
isset
(
$request
[
'search_company_id'
])
&&
!
empty
(
$request
[
'search_company_id'
])){
//仅展示本门店
$list_data
=
$list_data
->
where
(
's.ser_id'
,
$request
[
'search_company_id'
]);
}
if
(
!
isset
(
$request
[
'search_all'
])
||
$request
[
'search_all'
]
==
1
){
//仅展示本门店
$list_data
=
$list_data
->
where
(
's.ser_id'
,
$session
[
'admin_id'
]);
}
}
else
{
$list_data
=
$list_data
->
where
(
's.ser_id'
,
$session
[
'admin_id'
]);
}
$list_data
=
$list_data
->
where
(
'list_service_type'
,
40
)
->
whereIn
(
'sett_status'
,
[
1
,
60
,
63
])
->
select
(
's.id'
,
's.sys_num'
,
's.create_time'
,
'all_price'
,
'list_id'
,
'om.goods_name'
,
'om.goods_num'
,
'o.id as wor_id'
,
'o.stauas as wor_state'
)
->
paginate
(
$show_count
);
...
...
app/Services/OrderListService.php
浏览文件 @
5f4e1cbb
...
...
@@ -570,9 +570,6 @@ class OrderListService extends Service
if
(
!
in_array
(
$session
[
'admin_groupnew'
],
[
2
,
3
,
7
])){
//管理员可以看全部
$where
[
'gone_order_list.company_id'
]
=
$session
[
'company_id'
];
}
if
(
$session
[
'admin_groupnew'
]
==
3
)
{
$where
[
'gone_order_list.agency_id'
]
=
$session
[
'company_id'
];
}
$where
=
CommonService
::
jointWhere
(
$where
);
$page_size
=
$input
[
'page_size'
]
??
10
;
...
...
@@ -613,7 +610,7 @@ class OrderListService extends Service
$data
[
'button_search'
]
=
$export
[
'button_search'
]
??
[];
//搜索栏按钮
$list
=
CommonService
::
dataToArray
(
$paginate
->
items
());
if
(
$list
){
$list
=
self
::
getButtonDatas
(
$all_button
,
$list
);
$list
=
self
::
getButtonDatas
(
$all_button
,
$list
,
$session
);
$data
[
'list'
]
=
$list
;
$data
[
'page'
]
=
[
'count'
=>
$paginate
->
total
(),
...
...
@@ -637,8 +634,13 @@ class OrderListService extends Service
public
static
function
getCommonWhere
(
$session
){
$where
=
[];
$where
[
'gone_order_list.is_delete'
]
=
1
;
if
(
$session
[
'admin_groupnew'
]
==
2
){
if
(
$session
[
'admin_groupnew'
]
==
2
||
$session
[
'com_type'
]
==
2
){
if
(
$session
[
'com_type'
]
==
2
)
{
$where
[
'gone_order_list.agency_id'
]
=
$session
[
'company_id'
];
}
else
{
$where
[
'gone_order_list.ser_id_searchin'
]
=
$session
[
'id'
];
}
}
else
{
if
(
!
in_array
(
$session
[
'admin_groupnew'
],[
7
,
8
]))
{
$where
[
'p_id_searchin'
]
=
$session
[
'admin_pt_id'
];
...
...
@@ -655,7 +657,7 @@ class OrderListService extends Service
* @return string
* @author du 2021年8月18日下午3:40:48
*/
public
static
function
getButtonDatas
(
$all_button
,
$list
){
public
static
function
getButtonDatas
(
$all_button
,
$list
,
$session
){
$time
=
date
(
"Y-m-d"
,
strtotime
(
"+1 day"
));
$pts
=
PlatformService
::
getAll
(
true
,
'id'
);
$orderStau
=
OrderService
::
getOrderStatusName
();
//获取订单状态名
...
...
@@ -694,6 +696,9 @@ class OrderListService extends Service
}
$button
[]
=
'addNote,sendSmsOrderListModel'
;
if
(
$session
[
'admin_groupnew'
]
==
3
&&
$v
[
'ser_id'
]
!=
$session
[
'search_id'
]){
$button
[]
=
[];
}
$button
=
BmmcService
::
getListButton
(
$button
,
$all_button
);
$list
[
$k
][
'button_one'
]
=
$button
[
'button_one'
]
??
[];
$list
[
$k
][
'button_two'
]
=
$button
[
'button_two'
]
??
[];
...
...
app/Services/OrderService.php
浏览文件 @
5f4e1cbb
routes/api.php
浏览文件 @
5f4e1cbb
...
...
@@ -1441,6 +1441,7 @@ Route::namespace('Api')->group(function () {
Route
::
post
(
'w1/OrderList/getLabel'
,
'MobileWeb\OrderListController@getLabel'
);
//获取标签
Route
::
post
(
'w1/OrderList/operatingRecord'
,
'MobileWeb\OrderListController@operatingRecord'
);
//获取操作记录
Route
::
post
(
'w1/OrderList/getFeedback'
,
'MobileWeb\OrderListController@getFeedback'
);
//获取安装反馈数据
Route
::
post
(
'w1/OrderList/getService'
,
'MobileWeb\OrderListController@getService'
);
//获取系统推荐服务商
Route
::
post
(
'w1/OrderList/imageFeedback'
,
'MobileWeb\OrderListController@imageFeedback'
);
//施工反馈,图片反馈
Route
::
post
(
'w1/OrderList/LicenseFeedback'
,
'MobileWeb\OrderListController@LicenseFeedback'
);
//施工反馈,车牌反馈
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论