|
@@ -0,0 +1,64 @@
|
|
|
+<?php
|
|
|
+/**
|
|
|
+ * Created by PhpStorm.
|
|
|
+ * User: qiuzijian
|
|
|
+ * Date: 6/22/24
|
|
|
+ * Time: 12:34 PM
|
|
|
+ */
|
|
|
+
|
|
|
+namespace Modules\Admin\Services;
|
|
|
+
|
|
|
+use App\Enum\ApiEnum;
|
|
|
+use Illuminate\Support\Facades\Cache;
|
|
|
+use Illuminate\Support\Facades\DB;
|
|
|
+use Illuminate\Support\Facades\Log;
|
|
|
+use Modules\Admin\Entities\Menu;
|
|
|
+
|
|
|
+class ApiService{
|
|
|
+
|
|
|
+ public function __construct()
|
|
|
+ {
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ public static function getPersonTravel($person_id, $date = '')
|
|
|
+ {
|
|
|
+ $result['status'] = true;
|
|
|
+ $result['msg'] = ApiEnum::RETURN_SUCCESS;
|
|
|
+ $result['data'] = [];
|
|
|
+
|
|
|
+ if (!$date) {
|
|
|
+ $date = date('Y-m-d', time());
|
|
|
+ }
|
|
|
+
|
|
|
+ $res = [];
|
|
|
+ $area_arr = [];
|
|
|
+
|
|
|
+ $query = DB::connection('mysql_fwview')->table('uf_wghgl_new')
|
|
|
+ ->where('lrr', $person_id)->where('lrsj', 'like', '%' . $date . '%')
|
|
|
+ ->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,
|
|
|
+ 'date' => '',
|
|
|
+ 'data_id' => '',
|
|
|
+ 'url' => '',
|
|
|
+ ];
|
|
|
+ }
|
|
|
+
|
|
|
+ $result['data'] = $res;
|
|
|
+
|
|
|
+ return $result;
|
|
|
+ }
|
|
|
+}
|