File tree Expand file tree Collapse file tree 1 file changed +25
-1
lines changed Expand file tree Collapse file tree 1 file changed +25
-1
lines changed Original file line number Diff line number Diff line change @@ -1893,6 +1893,30 @@ function ($query) use ($search_val) {
18931893 );
18941894 }
18951895
1896+ if ($ fieldname == 'jobtitle ' ) {
1897+ $ query ->where (function ($ query ) use ($ search_val ) {
1898+ if (is_array ($ search_val )) {
1899+ $ query ->whereHasMorph (
1900+ 'assignedTo ' ,
1901+ [User::class],
1902+ function ($ query ) use ($ search_val ) {
1903+ $ query ->whereIn ('users.jobtitle ' , $ search_val );
1904+ }
1905+ );
1906+ } else {
1907+ $ query ->whereHasMorph (
1908+ 'assignedTo ' ,
1909+ [User::class],
1910+ function ($ query ) use ($ search_val ) {
1911+ $ query ->where (function ($ query ) use ($ search_val ) {
1912+ $ query ->where ('users.jobtitle ' , 'LIKE ' , '% ' . $ search_val . '% ' );
1913+ });
1914+ }
1915+ );
1916+ }
1917+ });
1918+ }
1919+
18961920
18971921 /**
18981922 * THIS CLUNKY BIT IS VERY IMPORTANT
@@ -1917,7 +1941,7 @@ function ($query) use ($search_val) {
19171941 */
19181942
19191943 if (($ fieldname !='category ' ) && ($ fieldname !='model_number ' ) && ($ fieldname !='rtd_location ' ) && ($ fieldname !='location ' ) && ($ fieldname !='supplier ' )
1920- && ($ fieldname !='status_label ' ) && ($ fieldname !='assigned_to ' ) && ($ fieldname !='model ' ) && ($ fieldname !='company ' ) && ($ fieldname !='manufacturer ' )
1944+ && ($ fieldname !='status_label ' ) && ($ fieldname !='assigned_to ' ) && ($ fieldname !='model ' ) && ( $ fieldname != ' jobtitle ' ) && ($ fieldname !='company ' ) && ($ fieldname !='manufacturer ' )
19211945 ) {
19221946 $ query ->where ('assets. ' .$ fieldname , 'LIKE ' , '% ' . $ search_val . '% ' );
19231947 }
You can’t perform that action at this time.
0 commit comments