|
@@ -31,8 +31,9 @@ class WorkPointController extends BaseController
|
|
|
|
|
|
public function index()
|
|
public function index()
|
|
{
|
|
{
|
|
|
|
+ $project_id = Project::getOptions();
|
|
list($model, $model_name, $pre_uri) = array($this->model, $this->model_name, $this->pre_uri);
|
|
list($model, $model_name, $pre_uri) = array($this->model, $this->model_name, $this->pre_uri);
|
|
- return view($this->view_path . 'index', compact('model', 'model_name','pre_uri'));
|
|
|
|
|
|
+ return view($this->view_path . 'index', compact('model', 'model_name','pre_uri','project_id'));
|
|
}
|
|
}
|
|
|
|
|
|
public function innerDevices()
|
|
public function innerDevices()
|
|
@@ -43,7 +44,7 @@ class WorkPointController extends BaseController
|
|
|
|
|
|
public function get(Request $request)
|
|
public function get(Request $request)
|
|
{
|
|
{
|
|
- $items = $this->model->orderBy('created_at', 'desc');
|
|
|
|
|
|
+ $items = $this->model->orderBy('id', 'desc')->orderBy('created_at', 'desc');
|
|
|
|
|
|
$tmp_items = collect(['name']);
|
|
$tmp_items = collect(['name']);
|
|
foreach($tmp_items as $tmp_item) {
|
|
foreach($tmp_items as $tmp_item) {
|
|
@@ -58,7 +59,12 @@ class WorkPointController extends BaseController
|
|
$items = $items->where($select_item, '=', $request->input($select_item));
|
|
$items = $items->where($select_item, '=', $request->input($select_item));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+ if ($request->input('project_id'))
|
|
|
|
+ {
|
|
|
|
+ $items->whereHas('project',function ($query){
|
|
|
|
+ $query->where('id','=',request('project_id'));
|
|
|
|
+ });
|
|
|
|
+ }
|
|
$items = $items->paginate();
|
|
$items = $items->paginate();
|
|
|
|
|
|
foreach ($items as $item) {
|
|
foreach ($items as $item) {
|