|
@@ -21,6 +21,38 @@ class ApiService{
|
|
|
|
|
|
}
|
|
|
|
|
|
+ public static function getQueryConitions($date = '')
|
|
|
+ {
|
|
|
+ if (!$date) {
|
|
|
+ $date = date('Y-m-d', time());
|
|
|
+ }
|
|
|
+
|
|
|
+ $depart = DB::connection('mysql_fwview')->table('hrmdepartment')
|
|
|
+ ->where('subcompanyid1', 49)
|
|
|
+ ->where('departmentname', 'like', '%' . '洗煤厂')
|
|
|
+ ->where('id', '!=', 1602)->get();
|
|
|
+
|
|
|
+ $depart_arr = [];
|
|
|
+ foreach ($depart as $key => $val) {
|
|
|
+ $query = DB::connection('mysql_fwview')->table('uf_wghgl_new')
|
|
|
+ ->join('hrmresource', 'uf_wghgl_new.lrr', '=', 'hrmresource.id')
|
|
|
+ ->where('xjdw1', $val->departmentname)
|
|
|
+ ->where('lrsj', 'like', '%' . $date . '%')
|
|
|
+ ->groupBy('lrr')
|
|
|
+ ->orderBy('lrsj', 'asc')->select(
|
|
|
+ [
|
|
|
+ 'hrmresource.lastname as person_name',
|
|
|
+ 'uf_wghgl_new.lrr as person_id '
|
|
|
+ ]
|
|
|
+ )->get();
|
|
|
+ dd($query);
|
|
|
+ $depart_arr[] = [
|
|
|
+ 'name' => $val->departmentname,
|
|
|
+
|
|
|
+ ];
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
public static function getPersonTravel($person_id, $date = '')
|
|
|
{
|
|
|
$result['status'] = true;
|