|
@@ -738,28 +738,28 @@ class AdminController extends Controller
|
|
->where('category', '!=', 'REVIEW')
|
|
->where('category', '!=', 'REVIEW')
|
|
->where('category', '!=', 'PLAN');
|
|
->where('category', '!=', 'PLAN');
|
|
|
|
|
|
|
|
+ $intentions = DB::select("SELECT intention, COUNT(intention) as count FROM point WHERE intention is not null and is_removed is not true and category != 'REVIEW' and category != 'PLAN' GROUP BY intention ORDER BY intention ASC");
|
|
$categories = [];
|
|
$categories = [];
|
|
$names = [];
|
|
$names = [];
|
|
|
|
|
|
-
|
|
|
|
-
|
|
|
|
if ($request->input('mcp')) {
|
|
if ($request->input('mcp')) {
|
|
$mcp = Pro::where('uid', trim($request->input('mcp')))->first();
|
|
$mcp = Pro::where('uid', trim($request->input('mcp')))->first();
|
|
if ($mcp) {
|
|
if ($mcp) {
|
|
- $points = $points->where('created_by_pro_id', $mcp->id);
|
|
|
|
|
|
+ // $points = $points->where('created_by_pro_id', $mcp->id);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ $implodedIntentions = null;
|
|
if ($request->input('intentions')) {
|
|
if ($request->input('intentions')) {
|
|
$points = $points->whereIn('intention', $request->input('intentions'));
|
|
$points = $points->whereIn('intention', $request->input('intentions'));
|
|
$implodedIntentions = join("','", $request->input('intentions'));
|
|
$implodedIntentions = join("','", $request->input('intentions'));
|
|
- $categories = DB::select("SELECT category, COUNT(category) as count FROM point WHERE intention in ('" . $implodedIntentions . "') GROUP BY category ORDER BY category ASC");
|
|
|
|
|
|
+ $categories = DB::select("SELECT category, COUNT(id) as count FROM point WHERE intention in ('" . $implodedIntentions . "') and is_removed is not true and category != 'REVIEW' and category != 'PLAN' GROUP BY category ORDER BY category ASC");
|
|
}
|
|
}
|
|
|
|
|
|
if ($request->input('categories')) {
|
|
if ($request->input('categories')) {
|
|
$points = $points->whereIn('category', $request->input('categories'));
|
|
$points = $points->whereIn('category', $request->input('categories'));
|
|
$implodedCategories = join("','", $request->input('categories'));
|
|
$implodedCategories = join("','", $request->input('categories'));
|
|
- $names = DB::select("select (data::json)->>'name' as name, count(id) as count from point where category in ('".$implodedCategories."') group by 1 order by 1 asc");
|
|
|
|
|
|
+ $names = DB::select("select (data::json)->>'name' as name, count(id) as count from point where category in ('".$implodedCategories."') and is_removed is not true and intention in ('".$implodedIntentions."') and category != 'REVIEW' and category != 'PLAN' group by 1 order by 1 asc");
|
|
}
|
|
}
|
|
|
|
|
|
if ($request->input('names')){
|
|
if ($request->input('names')){
|
|
@@ -773,11 +773,17 @@ class AdminController extends Controller
|
|
$tableName = $_point->getTable();
|
|
$tableName = $_point->getTable();
|
|
$columns = Schema::getColumnListing($tableName);
|
|
$columns = Schema::getColumnListing($tableName);
|
|
|
|
|
|
- $intentions = DB::select("SELECT intention, COUNT(intention) as count FROM point WHERE intention is not null GROUP BY intention ORDER BY intention ASC");
|
|
|
|
|
|
|
|
return view('app.admin.points.index', compact('points', 'filters', 'columns', 'intentions', 'categories', 'names'));
|
|
return view('app.admin.points.index', compact('points', 'filters', 'columns', 'intentions', 'categories', 'names'));
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ public function pointDetails(Request $request, $uid){
|
|
|
|
+ $point = Point::where('uid', $uid)->first();
|
|
|
|
+ $tableName = $point->getTable();
|
|
|
|
+ $columns = Schema::getColumnListing($tableName);
|
|
|
|
+ return view('app.admin.points.record-details', compact('point', 'columns'));
|
|
|
|
+ }
|
|
|
|
+
|
|
public function messages(Request $request)
|
|
public function messages(Request $request)
|
|
{
|
|
{
|
|
$messages = InternalMessage::orderBy('created_at', 'desc')->paginate(50);
|
|
$messages = InternalMessage::orderBy('created_at', 'desc')->paginate(50);
|