예제 #1
0
 /**
  * [policyDutyDel description]
  * @param  [type] $id [description]
  * @return [type]     [description]
  */
 public function policyDutyDel($id)
 {
     PolicyDuty::where('id', '=', $id)->delete();
     return Redirect::to('policyduty/list')->with('success', 'ลบทิ้งสำเร็จ');
 }
예제 #2
0
 /**
  * [policyDutySearch description]
  * @param  [type] $keyword [description]
  * @param  [type] $perPage [description]
  * @return [type]          [description]
  */
 public function policyDutySearch($keyword, $perPage)
 {
     $duty_list = PolicyDuty::where('fname', 'LIKE', '%' . $keyword . '%')->orWhere('lastname', 'LIKE', '%' . $keyword . '%')->orWhere('position', 'LIKE', '%' . $keyword . '%')->orWhere('email', 'LIKE', '%' . $keyword . '%')->orderBy('id', 'DESC')->paginate($perPage);
     //var_dump($duty_list);
     return $duty_list;
 }