Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
Z
zptz-sass-kelaidian
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
李大见
zptz-sass-kelaidian
Commits
c517044a
提交
c517044a
authored
9月 13, 2024
作者:
李大见
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'master' of
http://gitlab.bluearp.com/ldj/zptz-sass-kelaidian
上级
11c8acba
b14fb582
隐藏空白字符变更
内嵌
并排
正在显示
9 个修改的文件
包含
128 行增加
和
45 行删除
+128
-45
LoginController.php
app/Http/Controllers/Api/MobileWeb/LoginController.php
+16
-0
TechnicianController.php
app/Http/Controllers/Api/MobileWeb/TechnicianController.php
+1
-1
LoginValidator.php
...Http/Requests/Validators/Api/MobileWeb/LoginValidator.php
+21
-1
OrderListValidator.php
.../Requests/Validators/Api/MobileWeb/OrderListValidator.php
+2
-2
TechnicianValidator.php
...Requests/Validators/Api/MobileWeb/TechnicianValidator.php
+0
-8
LoginService.php
app/Services/Api/MobileWeb/LoginService.php
+32
-10
OrderListService.php
app/Services/Api/MobileWeb/OrderListService.php
+14
-9
TechnicianService.php
app/Services/Api/MobileWeb/TechnicianService.php
+41
-13
api.php
routes/api.php
+1
-1
没有找到文件。
app/Http/Controllers/Api/MobileWeb/LoginController.php
浏览文件 @
c517044a
...
...
@@ -2,6 +2,7 @@
namespace
App\Http\Controllers\Api\MobileWeb
;
use
App\Services\CommonService
;
use
Illuminate\Http\Request
;
use
App\Http\Controllers\Controller
;
use
App\Http\Requests\Validators\Api\MobileWeb\LoginValidator
;
...
...
@@ -46,4 +47,19 @@ class LoginController extends Controller
$return_data
=
LoginService
::
updatePassword
(
$request
->
all
(),
$request
->
ip
());
return
$return_data
;
}
//修改密码
public
function
getOpenid
(
Request
$request
){
// 验证数据
$error_message
=
$this
->
dataValidator
->
getOpenidValidator
(
$request
->
all
());
if
(
$error_message
)
{
return
response
()
->
json
([
'ErrorCode'
=>
ErrorInc
::
INVALID_PARAM
,
'ErrorMessage'
=>
$error_message
->
first
(),
'data'
=>
[]]);
}
$url
=
"https://api.weixin.qq.com/sns/oauth2/access_token?appid=wxf457f42f874c3545&secret=62c5530f13e8b88204818c8b98d3a5b6&code="
.
$request
->
input
(
'code'
)
.
"&grant_type=authorization_code"
;
$result
=
CommonService
::
requestGet
(
$url
);
$jsoninfo
=
json_decode
(
$result
,
true
);
$openid
=
$jsoninfo
[
"openid"
];
return
$return_data
;
}
}
app/Http/Controllers/Api/MobileWeb/TechnicianController.php
浏览文件 @
c517044a
...
...
@@ -49,7 +49,7 @@ class TechnicianController extends Controller
return
response
()
->
json
([
'ErrorCode'
=>
ErrorInc
::
INVALID_PARAM
,
'ErrorMessage'
=>
$error_message
->
first
(),
'data'
=>
[
$error_message
]]);
}
if
(
$request
[
'type'
]
==
1
)
{
$return_data
=
TechnicianService
::
editShow
(
$request
);
$return_data
=
TechnicianService
::
editShow
(
$request
->
all
()
);
return
response
()
->
json
(
$return_data
);
}
...
...
app/Http/Requests/Validators/Api/MobileWeb/LoginValidator.php
浏览文件 @
c517044a
...
...
@@ -56,7 +56,7 @@ class LoginValidator extends FormRequest
{
// 自定义错误消息
$messages
=
[
'new_password.required'
=>
'请输入
账号
'
,
'new_password.required'
=>
'请输入
新密码
'
,
'new_password.max'
=>
'参数错误'
,
'old_password.required'
=>
'请输入密码'
,
'old_password.max'
=>
'参数错误'
,
...
...
@@ -73,4 +73,24 @@ class LoginValidator extends FormRequest
return
$validator
->
errors
();
}
}
// 获取openid
public
function
getOpenidValidator
(
$data
)
{
// 自定义错误消息
$messages
=
[
'code.required'
=>
'请添加code'
,
'code.max'
=>
'参数错误'
,
];
// 数据验证
$validator
=
Validator
::
make
(
$data
,
[
'code'
=>
'required|string'
,
],
$messages
);
// 判断数据验证是否成功
if
(
$validator
->
fails
())
{
return
$validator
->
errors
();
}
}
}
app/Http/Requests/Validators/Api/MobileWeb/OrderListValidator.php
浏览文件 @
c517044a
...
...
@@ -235,13 +235,13 @@ class OrderListValidator extends FormRequest
'id.integer'
=>
'参数错误'
,
'type.required'
=>
'请输入图片类型'
,
'type.in'
=>
'参数错误'
,
'file'
=>
'请上传图片'
,
'file
.required
'
=>
'请上传图片'
,
];
// 数据验证
$validator
=
Validator
::
make
(
$data
,
[
'id'
=>
'required|integer|min:1'
,
'file'
=>
'required|
file
'
,
'file'
=>
'required|
string
'
,
'type'
=>
[
//1获取技师2改派
'required'
,
Rule
::
in
([
'1'
,
'2'
,
'3'
,
'4'
,
'5'
,
'6'
]),
...
...
app/Http/Requests/Validators/Api/MobileWeb/TechnicianValidator.php
浏览文件 @
c517044a
...
...
@@ -104,12 +104,6 @@ class TechnicianValidator extends FormRequest
{
// 自定义错误消息
$messages
=
[
'install_id.required'
=>
'参数错误'
,
'install_id.integer'
=>
'参数错误'
,
'install_id.min'
=>
'参数错误'
,
'admin_id.required'
=>
'参数错误'
,
'admin_id.integer'
=>
'参数错误'
,
'admin_id.min'
=>
'参数错误'
,
'edit_install_id.required'
=>
'请输入技师id'
,
'edit_install_id.integer'
=>
'参数错误'
,
'edit_install_id.min'
=>
'参数错误'
,
...
...
@@ -119,8 +113,6 @@ class TechnicianValidator extends FormRequest
// 数据验证
$validator
=
Validator
::
make
(
$data
,
[
'install_id'
=>
'required|integer|min:1'
,
'admin_id'
=>
'required|integer|min:1'
,
'edit_install_id'
=>
'required|integer|min:1'
,
'type'
=>
[
'required'
,
...
...
app/Services/Api/MobileWeb/LoginService.php
浏览文件 @
c517044a
...
...
@@ -118,12 +118,30 @@ class LoginService
if
(
empty
(
$lote_res
))
{
return
[
"ErrorCode"
=>
500
,
'ErrorMessage'
=>
'登录失败!2'
,
'data'
=>
''
];
}
if
(
$request
[
'user_type'
]
>
1
)
{
$button
=
[
'接单'
,
'安装'
,
'账单'
];
$button_more
=
[
'售后'
,
'修改密码'
,
'技师'
,
'退出'
];
$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
=
[
'安装'
];
$button_more
=
[
'售后'
,
'修改密码'
,
'退出'
];
$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
=
[
...
...
@@ -135,6 +153,7 @@ class LoginService
'admin_id'
=>
$find_person
[
'admin_id'
],
'company_id'
=>
$find_person
[
'company_id'
],
'button'
=>
$button
,
'user_type'
=>
$request
[
'user_type'
],
'button_more'
=>
$button_more
,
];
return
[
'ErrorCode'
=>
1
,
'ErrorMessage'
=>
'登录成功'
,
'data'
=>
$return_data
];
...
...
@@ -174,16 +193,11 @@ class LoginService
// 退出
public
static
function
quit
(
$request
)
{
try
{
$api_token
=
Crypt
::
decrypt
(
$request
[
'api_token'
]);
}
catch
(
\Exception
$e
)
{
return
[
'ErrorCode'
=>
ErrorInc
::
BUSINESS_FORBID
,
'ErrorMessage'
=>
'api_token失效'
,
'data'
=>
''
];
}
// 更改最后登录时间
$lote_data
[
'lowe_last_login'
]
=
0
;
//最后登陆时间
$res
=
DB
::
table
(
'login_web'
)
->
where
(
'api_token'
,
$
api_token
)
->
where
(
'api_token'
,
$
request
[
'api_token'
]
)
->
update
(
$lote_data
);
if
(
$res
)
{
return
[
'ErrorCode'
=>
1
,
'ErrorMessage'
=>
'退出成功'
,
'data'
=>
''
];
...
...
@@ -212,6 +226,10 @@ class LoginService
$password
[
'install_password1'
]
=
$request
[
'new_password'
];
$result
=
InstallPerson
::
where
(
'id'
,
$session
[
'install_id'
])
->
update
(
$password
);
if
(
$result
)
{
$lote_data
[
'lowe_last_login'
]
=
0
;
//最后登陆时间
$res
=
DB
::
table
(
'login_web'
)
->
where
(
'api_token'
,
$request
[
'api_token'
])
->
update
(
$lote_data
);
return
[
'ErrorCode'
=>
1
,
'ErrorMessage'
=>
'操作成功'
,
'data'
=>
''
];
}
else
{
return
[
"ErrorCode"
=>
ErrorInc
::
MYSQL_FAILED
,
'ErrorMessage'
=>
'操作失败'
,
'data'
=>
''
];
...
...
@@ -232,6 +250,10 @@ class LoginService
if
(
$result
){
$data
[
'back_pass'
]
=
$_POST
[
'new_password'
];
AdminInfor
::
where
(
'admin_id'
,
$session
[
'install_id'
])
->
update
(
$data
);
$lote_data
[
'lowe_last_login'
]
=
0
;
//最后登陆时间
$res
=
DB
::
table
(
'login_web'
)
->
where
(
'api_token'
,
$request
[
'api_token'
])
->
update
(
$lote_data
);
return
[
'ErrorCode'
=>
1
,
'ErrorMessage'
=>
'操作成功'
,
'data'
=>
''
];
}
else
{
return
[
"ErrorCode"
=>
ErrorInc
::
MYSQL_FAILED
,
'ErrorMessage'
=>
'操作失败'
,
'data'
=>
''
];
...
...
app/Services/Api/MobileWeb/OrderListService.php
浏览文件 @
c517044a
...
...
@@ -137,7 +137,6 @@ class OrderListService extends Model
}
}
if
(
$request
[
'stauas'
]
==
3
){
$list_items
[
$key
][
'line_state'
]
=
1
;
$list_items
[
$key
][
'button'
][]
=
[
'action'
=>
'contact'
,
'name'
=>
'预约时间'
];
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'
]
){
...
...
@@ -157,6 +156,9 @@ class OrderListService extends Model
;
break
;
}
$list_items
[
$key
][
'button'
][]
=
[
'action'
=>
'contact'
,
'name'
=>
'修改预约'
];
}
else
{
$list_items
[
$key
][
'button'
][]
=
[
'action'
=>
'contact'
,
'name'
=>
'预约时间'
];
}
}
$list_items
[
$key
][
'button'
][]
=
[
'action'
=>
'copyInfo'
,
'name'
=>
'复制信息'
];
...
...
@@ -790,7 +792,6 @@ class OrderListService extends Model
}
}
if
(
$request
[
'stauas'
]
==
3
)
{
$data
[
'button'
][]
=
[
'action'
=>
'contact'
,
'name'
=>
'预约时间'
];
if
(
isset
(
$installLine
))
{
switch
(
$installLine
)
{
case
2
:
...
...
@@ -809,6 +810,9 @@ class OrderListService extends Model
;
break
;
}
$data
[
'button'
][]
=
[
'action'
=>
'contact'
,
'name'
=>
'修改预约'
];
}
else
{
$data
[
'button'
][]
=
[
'action'
=>
'contact'
,
'name'
=>
'预约时间'
];
}
}
$data
[
'button'
][]
=
[
'action'
=>
'copyInfo'
,
'name'
=>
'复制信息'
];
...
...
@@ -955,8 +959,9 @@ class OrderListService extends Model
->
first
();
if
(
$orderListArr
)
{
$request
[
'path'
]
=
'./FeekBack/'
.
date
(
'Ym'
);
$rea
=
DealPicService
::
upload
(
$request
);
if
(
$rea
[
'code'
]
==
'200'
){
// $rea = DealPicService::upload($request);
$rea
=
DealPicService
::
addPic
(
$request
[
'file'
],
$request
[
'path'
],
$request
[
'type'
]);
if
(
$rea
){
$feedback
=
Feedback
::
where
(
'type'
,
$request
[
'type'
])
->
where
(
'gl_id'
,
$orderListArr
[
'id'
])
->
where
(
'is_delect'
,
1
)
...
...
@@ -964,7 +969,7 @@ class OrderListService extends Model
if
(
$feedback
){
$arr
[
'install_name'
]
=
$orderListArr
[
'intall_person'
];
$arr
[
'install_phone'
]
=
$orderListArr
[
'intall_phone'
];
$streamFilename
=
self
::
picurl
(
$rea
[
'data'
]
);
$streamFilename
=
self
::
picurl
(
$rea
);
$arr
[
'feedback_pic'
]
=
$streamFilename
;
$arr
[
'install_time'
]
=
date
(
"Y-m-d H:i:s"
);
$arr
[
'type_name'
]
=
self
::
getPicName
(
$request
[
'type'
]);
//'1';
...
...
@@ -979,7 +984,7 @@ class OrderListService extends Model
$arr
[
'admin_id'
]
=
$orderListArr
[
'ser_id'
];
$arr
[
'company_name'
]
=
$resu
[
'company_name'
];
$arr
[
'feedback_status'
]
=
'2'
;
$streamFilename
=
self
::
picurl
(
$rea
[
'data'
]
);
$streamFilename
=
self
::
picurl
(
$rea
);
$arr
[
'feedback_pic'
]
=
$streamFilename
;
$arr
[
'sys_num'
]
=
"rwfk"
.
$orderListArr
[
'id'
];
$arr
[
'install_time'
]
=
date
(
"Y-m-d H:i:s"
);
...
...
@@ -992,12 +997,12 @@ class OrderListService extends Model
$typename
=
$typename
.
$arr
[
'type_name'
]
.
'图'
;
unset
(
$arr
);
CommonService
::
inserting_log
(
$typename
,
$orderListArr
[
'sys_num'
],
'订单('
.
$orderListArr
[
'serial_number'
]
.
')'
,
'派工单web'
,
$session
,
$ip
);
//日志
return
[
'ErrorCode'
=>
1
,
'ErrorMessage'
=>
'操作成功'
,
'Data'
=>
$rea
[
'data'
]
];
return
[
'ErrorCode'
=>
1
,
'ErrorMessage'
=>
'操作成功'
,
'Data'
=>
$rea
];
}
else
{
return
[
'ErrorCode'
=>
ErrorInc
::
DATA_EMPTY
,
'ErrorMessage'
=>
'操作失败'
,
'Data'
=>
$rea
[
'data'
]
];
return
[
'ErrorCode'
=>
ErrorInc
::
DATA_EMPTY
,
'ErrorMessage'
=>
'操作失败'
,
'Data'
=>
$rea
];
}
}
else
{
return
[
'ErrorCode'
=>
ErrorInc
::
DATA_EMPTY
,
'ErrorMessage'
=>
'操作失败'
,
'Data'
=>
$rea
[
'data'
]
];
return
[
'ErrorCode'
=>
ErrorInc
::
DATA_EMPTY
,
'ErrorMessage'
=>
'操作失败'
,
'Data'
=>
$rea
];
}
}
else
{
return
[
'ErrorCode'
=>
ErrorInc
::
DATA_EMPTY
,
'ErrorMessage'
=>
'未查询到订单'
,
'Data'
=>
[]];
...
...
app/Services/Api/MobileWeb/TechnicianService.php
浏览文件 @
c517044a
...
...
@@ -17,6 +17,9 @@ class TechnicianService
public
static
function
index
(
$request
,
$show_count
=
10
)
{
$session
=
$request
[
'session'
];
if
(
$session
[
'user_type'
]
==
1
){
return
[
'ErrorCode'
=>
1
,
'ErrorMessage'
=>
'暂无数据'
,
'data'
=>
[]];
}
// 查询技师信息
$list_data
=
DB
::
table
(
'install_person'
)
->
where
(
'admin_id'
,
$session
[
'admin_id'
])
//所属服务商
...
...
@@ -48,6 +51,16 @@ class TechnicianService
$list_items
=
$list_data
->
items
();
if
(
$list_items
)
{
foreach
(
$list_items
as
$k
=>
$v
){
switch
(
$v
[
'install_is_type'
]
){
case
1
:
$list_items
[
$k
][
'is_type_name'
]
=
'启用中'
;
break
;
default
:
$list_items
[
$k
][
'is_type_name'
]
=
'已停用'
;
break
;
}
}
$page
[
'count'
]
=
$list_data
->
total
();
//总数据个数
$page
[
'page'
]
=
$list_data
->
currentPage
();
//当前页面页码
$page
[
'page_size'
]
=
$show_count
;
//一页显示多少个
...
...
@@ -111,6 +124,9 @@ class TechnicianService
public
static
function
add
(
$request
,
$ip
)
{
$session
=
$request
[
'session'
];
if
(
$session
[
'user_type'
]
==
1
){
return
[
'ErrorCode'
=>
ErrorInc
::
REQUEST_FORBIDDEN
,
'ErrorMessage'
=>
'无操作权限'
,
'Data'
=>
[]];
}
$admin_id
=
$session
[
'admin_id'
];
// 判断当前技师是否存在
$find_id
=
InstallPerson
::
where
(
'admin_id'
,
$session
[
'admin_id'
])
...
...
@@ -146,16 +162,15 @@ class TechnicianService
if
(
isset
(
$request
[
'install_pic'
]))
{
$arr
[
'install_pic'
]
=
$request
[
'install_pic'
];
}
$arr
[
'install_year'
]
=
$request
[
'install_year'
];
$arr
[
'admin_id'
]
=
$admin_id
;
$arr
[
'is_shman'
]
=
$is_shman
;
$arr
[
'install_remark'
]
=
$request
[
'install_remark'
]
??
''
;
$arr
[
'install_password1'
]
=
$arr
[
'check_code'
];
$arr
[
'install_password'
]
=
md5
(
$arr
[
'check_code'
]);
$arr
[
'install_province'
]
=
$request
[
'
shr
_province'
];
$arr
[
'install_city'
]
=
$request
[
'
shr
_city'
];
$arr
[
'install_cuntry'
]
=
$request
[
'
shr
_cuntry'
];
$arr
[
'install_address'
]
=
$request
[
'address'
];
$arr
[
'install_province'
]
=
$request
[
'
install
_province'
];
$arr
[
'install_city'
]
=
$request
[
'
install
_city'
];
$arr
[
'install_cuntry'
]
=
$request
[
'
install
_cuntry'
];
$arr
[
'install_address'
]
=
$request
[
'
install_
address'
];
if
(
empty
(
$request
[
'address'
])){
$arr
[
'longitude'
]
=
''
;
$arr
[
'latitude'
]
=
''
;
...
...
@@ -177,19 +192,28 @@ class TechnicianService
$return_data
[
'install_name'
]
=
$arr
[
'install_name'
];
$return_data
[
'install_phone'
]
=
$arr
[
'install_phone'
];
$return_data
[
'install_is_type'
]
=
$arr
[
'install_is_type'
];
switch
(
$arr
[
'install_is_type'
]
){
case
1
:
$return_data
[
'is_type_name'
]
=
'启用中'
;
break
;
default
:
$return_data
[
'is_type_name'
]
=
'已停用'
;
break
;
}
$return_data
[
'check_code'
]
=
$arr
[
'check_code'
];
$return_data
[
'install_password'
]
=
$arr
[
'check_code'
];
return
[
'ErrorCode'
=>
1
,
'ErrorMessage'
=>
'成功'
,
'Data'
=>
$return_data
];
}
else
{
return
[
'ErrorCode'
=>
500
,
'ErrorMessage'
=>
'失败'
,
'Data'
=>
[]];
return
[
'ErrorCode'
=>
ErrorInc
::
MYSQL_FAILED
,
'ErrorMessage'
=>
'失败'
,
'Data'
=>
[]];
}
}
// 编辑显示
public
static
function
editShow
(
$request
)
{
$session
=
$request
[
'session'
];
// 判断当前技师是否存在
$find_data
=
InstallPerson
::
where
(
'admin_id'
,
$
request
[
'admin_id'
])
$find_data
=
InstallPerson
::
where
(
'admin_id'
,
$
session
[
'admin_id'
])
->
where
(
'id'
,
$request
[
'edit_install_id'
])
->
where
(
'delet_y'
,
1
)
->
select
(
'id'
,
'check_code'
,
'install_name'
,
'install_phone'
,
'install_year'
,
'install_pic'
,
'install_is_type'
,
'install_remark'
,
'install_province'
,
'install_city'
,
'install_cuntry'
,
'install_address'
)
...
...
@@ -204,6 +228,9 @@ class TechnicianService
public
static
function
edit
(
$request
,
$ip
)
{
$session
=
$request
[
'session'
];
if
(
$session
[
'user_type'
]
==
1
){
return
[
'ErrorCode'
=>
ErrorInc
::
REQUEST_FORBIDDEN
,
'ErrorMessage'
=>
'无操作权限'
,
'Data'
=>
[]];
}
$admin_id
=
$session
[
'admin_id'
];
// 判断当前技师是否存在
$find_id
=
InstallPerson
::
where
(
'admin_id'
,
$session
[
'admin_id'
])
...
...
@@ -223,13 +250,14 @@ class TechnicianService
}
$arr
[
'install_year'
]
=
$request
[
'install_year'
];
$arr
[
'install_remark'
]
=
$request
[
'install_remark'
]
??
''
;
$arr
[
'updata_time'
]
=
date
(
"Y-m-d H:i:s"
);
$ins_res
=
InstallPerson
::
where
(
'id'
,
$request
[
'edit_install_id'
])
->
update
(
$arr
);
if
(
$ins_res
)
{
$content
=
"编辑技师:"
.
$request
[
'install_name'
];
CommonService
::
inserting_log
(
'编辑技师'
,
$check_code
,
$content
,
'移动端-技师管理'
,
$session
,
$ip
);
//日志
return
[
'ErrorCode'
=>
1
,
'ErrorMessage'
=>
'成功'
,
'Data'
=>
[]];
return
[
'ErrorCode'
=>
1
,
'ErrorMessage'
=>
'
操作
成功'
,
'Data'
=>
[]];
}
else
{
return
[
'ErrorCode'
=>
500
,
'ErrorMessage'
=>
'
失败'
,
'Data'
=>
[]];
return
[
'ErrorCode'
=>
ErrorInc
::
MYSQL_FAILED
,
'ErrorMessage'
=>
'操作
失败'
,
'Data'
=>
[]];
}
}
...
...
@@ -251,10 +279,10 @@ class TechnicianService
$info
[
'install_password'
]
=
md5
(
$request
[
'new_password'
]);
$info
[
'install_password1'
]
=
$request
[
'new_password'
];
$info
[
'updata_time'
]
=
date
(
'Y-m-d H:i:s'
);
$info
[
'install_province'
]
=
$request
[
'
shr
_province'
];
$info
[
'install_city'
]
=
$request
[
'
shr
_city'
];
$info
[
'install_cuntry'
]
=
$request
[
'
shr
_cuntry'
];
$info
[
'install_address'
]
=
$request
[
'address'
];
$info
[
'install_province'
]
=
$request
[
'
install
_province'
];
$info
[
'install_city'
]
=
$request
[
'
install
_city'
];
$info
[
'install_cuntry'
]
=
$request
[
'
install
_cuntry'
];
$info
[
'install_address'
]
=
$request
[
'
install_
address'
];
if
(
empty
(
$request
[
'address'
])){
$info
[
'longitude'
]
=
''
;
$info
[
'latitude'
]
=
''
;
...
...
routes/api.php
浏览文件 @
c517044a
...
...
@@ -1416,7 +1416,7 @@ Route::group(['prefix' => 'Dou', 'namespace' => 'Dou'], function () {
Route
::
namespace
(
'Api'
)
->
group
(
function
()
{
// 技师登录
Route
::
post
(
'w1/login'
,
'MobileWeb\LoginController@login'
);
//登录
Route
::
post
(
'w1/getOpenid'
,
'MobileWeb\LoginController@getOpenid'
);
//登录
// 需要验证
Route
::
group
([
'middleware'
=>
[
'WebLogin'
]],
function
()
{
Route
::
post
(
'w1/quit'
,
'MobileWeb\LoginController@quit'
);
//退出
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论