| xqd
@@ -2,7 +2,6 @@
|
|
|
|
|
|
namespace App\Admin\Controllers;
|
|
|
|
|
|
-use App\Admin\Metrics\Examples;
|
|
|
use App\Http\Controllers\Controller;
|
|
|
use App\Models\Account;
|
|
|
use App\Models\ProductCategory;
|
| xqd
@@ -45,6 +44,7 @@ class DashBoardController extends Controller
|
|
|
|
|
|
public function download(Content $content)
|
|
|
{
|
|
|
+ $this->reload();
|
|
|
if(request()->isMethod('post')){
|
|
|
return $this->queryData('download');
|
|
|
}
|
| xqd
@@ -59,6 +59,7 @@ class DashBoardController extends Controller
|
|
|
|
|
|
private function viewerShowroom()
|
|
|
{
|
|
|
+ $this->reload();
|
|
|
if(request()->isMethod('post')){
|
|
|
return $this->queryData('product');
|
|
|
}
|
| xqd
@@ -72,13 +73,14 @@ class DashBoardController extends Controller
|
|
|
|
|
|
private function viewerProduct()
|
|
|
{
|
|
|
+ $this->reload();
|
|
|
if(request()->isMethod('post')){
|
|
|
return $this->queryData('product');
|
|
|
}
|
|
|
static::loadJS('product');
|
|
|
$categories = ProductCategory::with(['products:id,name,cate_id'])->get();
|
|
|
$data = [
|
|
|
- 'categories' => $categories
|
|
|
+ 'categories' => $categories,
|
|
|
];
|
|
|
return view('admin.dashboard.product', $data);
|
|
|
}
|
| xqd
@@ -158,6 +160,15 @@ class DashBoardController extends Controller
|
|
|
|
|
|
}
|
|
|
|
|
|
+ private function reload()
|
|
|
+ {
|
|
|
+ $pjax = request()->input('_pjax', 0);
|
|
|
+ if($pjax){
|
|
|
+ header('location:'.request()->url());
|
|
|
+ exit;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
private static function getDays($startAt, $endAt): array
|
|
|
{
|
|
|
$startAt = $startAt ?: Carbon::today()->subDays(30)->toDateString();
|