|
@@ -405,15 +405,31 @@ class OaService extends Service
|
|
|
$type = isset($data['opt_case']) ? $data['opt_case'] : 0;
|
|
|
// $this->returnOa($order_no,1,$type);
|
|
|
// return [200,''];
|
|
|
+
|
|
|
+ //特殊的审批
|
|
|
$list = Oa::from('oa as o')
|
|
|
->leftJoin('oa_sub as os', 'os.oa_id', 'o.id')
|
|
|
->select('os.sort', 'os.type', 'os.sub_id')
|
|
|
->where('o.del_time', 0)
|
|
|
- ->where('o.channel', $this->user['depart_top'][0]['depart_id'])
|
|
|
+ ->where('o.sub_type', 2)
|
|
|
+ ->where('os.del_time', 0)
|
|
|
->where('o.menu_id', $menu_id);
|
|
|
if (!empty($type)) $list = $list->where('os.sort', 1);
|
|
|
- $list = $list->orderBy('os.sort')
|
|
|
- ->get()->toArray();
|
|
|
+ $list = $list->orderBy('os.sort')->get()->toArray();
|
|
|
+ if(empty($list)){
|
|
|
+ $list = Oa::from('oa as o')
|
|
|
+ ->leftJoin('oa_sub as os', 'os.oa_id', 'o.id')
|
|
|
+ ->select('os.sort', 'os.type', 'os.sub_id')
|
|
|
+ ->where('o.del_time', 0)
|
|
|
+ ->where('os.del_time', 0)
|
|
|
+ ->where('o.channel', $this->user['depart_top'][0]['depart_id'])
|
|
|
+ ->where('o.menu_id', $menu_id);
|
|
|
+ if (!empty($type)) $list = $list->where('os.sort', 1);
|
|
|
+ $list = $list->orderBy('os.sort')->get()->toArray();
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
if (empty($list)) {
|
|
|
$this->returnOa($order_no, 1, $type);
|
|
|
return [200, ''];
|