...
|
...
|
@@ -86,6 +86,7 @@ class Index extends Api |
|
|
$list[$k]['status'] = $v['status']; //审核状态
|
|
|
$list[$k]['time'] = date('Y-m-d H:i:s', $v['createtime']); //报修时间
|
|
|
// $list[$k]['time'] = $v['createtime']; //报修时间
|
|
|
$list[$k]['BankRed'] = $this->SizeRed($user_id, $v['id']); //标红
|
|
|
}
|
|
|
if ($param['ids'] == 1) {
|
|
|
array_multisort(array_column($list, 'id'), SORT_ASC, $list);
|
...
|
...
|
@@ -285,7 +286,8 @@ class Index extends Api |
|
|
'repair_type' => 0,
|
|
|
'price' => 0,
|
|
|
'status' => 0,
|
|
|
'is_genghuan' => 2
|
|
|
'is_genghuan' => 2,
|
|
|
'fenpei_type' => 0,
|
|
|
];
|
|
|
$res = Db::name('baoxiudan')->insert($data);
|
|
|
if ($res) {
|
...
|
...
|
@@ -422,11 +424,34 @@ class Index extends Api |
|
|
}
|
|
|
if (empty($arr['yuji']) || $arr['yuji'] == null || $arr['yuji'] == '' || $arr['yuji'] == "") {
|
|
|
$yuji = '';
|
|
|
|
|
|
} else {
|
|
|
$yuji = date('Y-m-d H:i:s', $arr['yuji']);
|
|
|
}
|
|
|
//是否是维修总负责人 是否可以分配给维修负责人
|
|
|
if ($level == 7) {
|
|
|
if ($arr['fenpei_type'] == 0) {
|
|
|
$WXZFZR = 1;
|
|
|
} else {
|
|
|
$WXZFZR = 0;
|
|
|
}
|
|
|
} else {
|
|
|
$WXZFZR = 0;
|
|
|
}
|
|
|
//是否是维修负责人 是否可以进行分配给维修成员
|
|
|
if ($level == 3) {
|
|
|
if ($arr['wx_user_id'] == $user_id) {
|
|
|
if ($arr['fenpei_type'] == 1) {
|
|
|
$FPWXCY = 1;
|
|
|
}
|
|
|
} else {
|
|
|
$FPWXCY = 0;
|
|
|
}
|
|
|
} else {
|
|
|
$FPWXCY = 0;
|
|
|
}
|
|
|
$list = [
|
|
|
'allocation' => $WXZFZR, //是否可以进行维修总负责人分配权限 1=是,0=否
|
|
|
'fpwxcy' => $FPWXCY, //是否可以进行维修负责人分配维修成员 1=是,0=否
|
|
|
'level' => $level, //用户等级
|
|
|
'repair_type' => $arr['repair_type'], //维修状态:0=未接收,1=进行中,2=已完成
|
|
|
'type' => $arr['type'], //报修单状态:1=进行中,2=已完成
|
...
|
...
|
@@ -494,6 +519,39 @@ class Index extends Api |
|
|
|
|
|
|
|
|
/**
|
|
|
* @ApiTitle (首页-维修负责人列表)
|
|
|
* @ApiSummary (维修负责人列表)
|
|
|
* @ApiMethod (POST)
|
|
|
* @ApiRoute (/api/Index/FuZePeopleList)
|
|
|
* @ApiReturnParams (name="code", type="integer", required=true, sample="0")
|
|
|
* @ApiReturnParams (name="msg", type="string", required=true, sample="返回成功")
|
|
|
* @ApiReturn ({
|
|
|
"code":"1",
|
|
|
"msg": "返回成功",
|
|
|
"data": [
|
|
|
{
|
|
|
"id": 用户ID,
|
|
|
"name": "姓名"
|
|
|
}
|
|
|
]
|
|
|
})
|
|
|
*/
|
|
|
public function FuZePeopleList()
|
|
|
{
|
|
|
$arr = Db::name('user')->where(['level' => 3])->order('id desc')->select();
|
|
|
if (empty($arr)) {
|
|
|
$list = [];
|
|
|
} else {
|
|
|
foreach ($arr as $k => $v) {
|
|
|
$list[$k]['id'] = $v['id'];
|
|
|
$list[$k]['name'] = $v['name'];
|
|
|
}
|
|
|
}
|
|
|
$this->success('成功', $list);
|
|
|
}
|
|
|
|
|
|
|
|
|
/**
|
|
|
* @ApiTitle (首页-再次提交审核)
|
|
|
* @ApiSummary (再次提交审核)
|
|
|
* @ApiMethod (POST)
|
...
|
...
|
@@ -564,6 +622,39 @@ class Index extends Api |
|
|
|
|
|
|
|
|
/**
|
|
|
* @ApiTitle (首页-分配维修负责人)
|
|
|
* @ApiSummary (分配维修负责人)
|
|
|
* @ApiMethod (POST)
|
|
|
* @ApiRoute (/api/Index/FenPeiWxFzr)
|
|
|
* @ApiHeaders (name="authorization", type=string, required=true, description="请求的Token")
|
|
|
* @ApiHeaders (name="id", type=int, required=true, description="报修单ID")
|
|
|
* @ApiHeaders (name="user_id", type=int, required=true, description="维修负责人用户ID")
|
|
|
* @ApiReturnParams (name="msg", type="string", required=true, sample="返回成功")
|
|
|
* @ApiReturn ({
|
|
|
"code":"1",
|
|
|
"msg": "返回成功",
|
|
|
"data":{
|
|
|
}
|
|
|
})
|
|
|
*/
|
|
|
public function FenPeiWxFzr()
|
|
|
{
|
|
|
$user_id = $this->is_token($this->request->header());
|
|
|
$param = $this->request->param();
|
|
|
$data = [
|
|
|
'wx_user_id' => $param['user_id'],
|
|
|
'wxfzr_user_id' => $user_id,
|
|
|
];
|
|
|
$res = Db::name('baoxiudan')->where(['id' => $param['id']])->update($data);
|
|
|
if ($res) {
|
|
|
$this->success('分配成功', 1);
|
|
|
} else {
|
|
|
$this->error('分配失败', 0);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
/**
|
|
|
* @ApiTitle (首页-维修成员报修单操作)
|
|
|
* @ApiSummary (维修成员报修单操作)
|
|
|
* @ApiMethod (POST)
|
...
|
...
|
|