|
@@ -61,7 +61,7 @@ class ApiService{
|
|
|
return $result;
|
|
|
}
|
|
|
|
|
|
- public static function getPersonTravel($person_id, $date = '')
|
|
|
+ public static function getPersonTravel($person_id, $depart, $date = '')
|
|
|
{
|
|
|
$result['status'] = true;
|
|
|
$result['msg'] = ApiEnum::RETURN_SUCCESS;
|
|
@@ -75,29 +75,36 @@ class ApiService{
|
|
|
$area_arr = [];
|
|
|
|
|
|
$query = DB::connection('mysql_fwview')->table('uf_wghgl_new')
|
|
|
- ->where('lrr', $person_id)->where('lrsj', 'like', '%' . $date . '%')
|
|
|
+ ->where('lrr', $person_id)
|
|
|
+ ->where('lrsj', 'like', '%' . $date . '%')
|
|
|
+ ->where('xjdw1', $depart)
|
|
|
->orderBy('lrsj', 'asc')->get();
|
|
|
- foreach ($query as $key => $val) {
|
|
|
- $area_arr[] = $val->jcqy;
|
|
|
- $res[] = [
|
|
|
- 'area' => $val->jcqy,
|
|
|
- 'date' => $val->lrsj,
|
|
|
- 'data_id' => $val->id,
|
|
|
- 'url' => '/mobilemode/formbasebrowserview.jsp?billid=' . $val->id . '&modeId=580&formId=-976',
|
|
|
- ];
|
|
|
- }
|
|
|
- $area_list = DB::connection('mysql_fwview')->table('formtable_main_974')
|
|
|
- ->whereNotIn('qymc', $area_arr)->orderBy('areaid', 'asc')->get();
|
|
|
- foreach ($area_list as $area) {
|
|
|
- $res[] = [
|
|
|
- 'area' => $area->qymc,
|
|
|
- 'date' => '',
|
|
|
- 'data_id' => '',
|
|
|
- 'url' => '',
|
|
|
- ];
|
|
|
+ $query = json_decode($query);
|
|
|
+ if ($query) {
|
|
|
+ foreach ($query as $key => $val) {
|
|
|
+ $area_arr[] = $val['jcqy'];
|
|
|
+ $res[] = [
|
|
|
+ 'area' => $val['jcqy'],
|
|
|
+ 'date' => $val['lrsj'],
|
|
|
+ 'data_id' => $val['id'],
|
|
|
+ 'url' => '/mobilemode/formbasebrowserview.jsp?billid=' . $val['id'] . '&modeId=580&formId=-976',
|
|
|
+ ];
|
|
|
+ }
|
|
|
+ $area_list = DB::connection('mysql_fwview')->table('formtable_main_974')
|
|
|
+ ->whereNotIn('qymc', $area_arr)
|
|
|
+ ->where('ssxmc', $depart)->orderBy('areaid', 'asc')->get();
|
|
|
+ foreach ($area_list as $area) {
|
|
|
+ $res[] = [
|
|
|
+ 'area' => $area->qymc,
|
|
|
+ 'date' => '',
|
|
|
+ 'data_id' => '',
|
|
|
+ 'url' => '',
|
|
|
+ ];
|
|
|
+ }
|
|
|
+
|
|
|
+ $result['data'] = $res;
|
|
|
}
|
|
|
|
|
|
- $result['data'] = $res;
|
|
|
|
|
|
return $result;
|
|
|
}
|