Sfoglia il codice sorgente

Merge branch 'master' into 商品挂网统计

tangyuanwang 2 mesi fa
parent
commit
8f9436aa22

+ 3 - 0
app/Http/Controllers/Manager/Personnel/Employee.php

@@ -100,6 +100,7 @@ class Employee extends Controller
                 if (count($city_ids) > 0) {
                     $city_info = $CitysModel->whereIn('id', $city_ids)->pluck('name');
                 }
+                $result['data'][$key]['department_ids'] = substr($value['department_ids'], 1, strlen($value['department_ids']) -2);
                 $result['data'][$key]['department_name'] = $department_name;
                 $result['data'][$key]['role_name'] = isset($role_info['name']) ? $role_info['name'] : '';
                 $result['data'][$key]['city_info'] = $city_info;
@@ -207,6 +208,8 @@ class Employee extends Controller
         if (count($city_ids) > 0) {
             $city_info = $CitysModel->whereIn('id', $city_ids)->pluck('name');
         }
+        //截取字符串
+        $data['department_ids'] = substr($data['department_ids'], 1, strlen($data['department_ids']) -2);
         $data['department_name'] = isset($department_info) ? array_column($department_info, 'name') : '';
         $data['role_name'] = isset($role_info['name']) ? $role_info['name'] : '';
         $data['city_info'] = $city_info;

+ 383 - 0
app/Http/Controllers/Manager/Statistics/OverviewPanel.php

@@ -0,0 +1,383 @@
+<?php
+
+namespace App\Http\Controllers\manager\Statistics;
+
+use App\Http\Controllers\Controller;
+use App\Http\Requests\Manager\Statistics\OverviewPanel as request;
+use App\Models\Manager\Process\LowPriceGoods as LowPriceGoodsModel;
+use App\Models\Manager\Process\ViolationProduct as ViolationProductModel;
+use Illuminate\Support\Facades\DB;
+use PhpOffice\PhpSpreadsheet\Spreadsheet;
+use PhpOffice\PhpSpreadsheet\Writer\Xlsx;
+use PhpOffice\PhpSpreadsheet\Style\Alignment;
+
+/**
+ * 报表统计-概览面板
+ * @author 唐远望
+ * @version   1.0
+ * @date      2025-12-26
+ * 
+ */
+class OverviewPanel extends Controller
+{
+
+    /**
+     * 禁止挂网链接数统计
+     * @author 唐远望
+     * @version   1.0
+     * @date      2025-12-26
+     * 
+     */
+    public function getViolationLinkCount(request $request, ViolationProductModel $violationProductModel)
+    {
+        $request->scene('getViolationLinkCount')->validate();
+        $limit = request('limit', config('page_num', 10));
+        $start_time = request('start_time', '');
+        $end_time = request('end_time', '');
+        // 时间条件
+        $map  = [];
+        if ($start_time) $map[] = ['insert_time', '>=', strtotime($start_time)];
+        if ($end_time) $map[]   = ['insert_time', '<=', strtotime($end_time)];
+        $result = $violationProductModel->where($map)->where('status', 0)
+            ->select(['company_name', DB::raw('count(link_url) as count')])->orderby('count', 'desc')
+            ->groupby('company_name')->paginate($limit);
+        return  json_send(['code' => 'success', 'msg' => '获取成功', 'data' => $result]);
+    }
+
+    /**
+     * 禁止挂网链接数统计-导出
+     * @author 唐远望
+     * @version   1.0
+     * @date      2025-12-26
+     * 
+     */
+    public function Violation_export(request $request, ViolationProductModel $violationProductModel)
+    {
+        $start_time = request('start_time', '');
+        $end_time = request('end_time', '');
+        // 时间条件
+        $map  = [];
+        if ($start_time) $map[] = ['insert_time', '>=', strtotime($start_time)];
+        if ($end_time) $map[]   = ['insert_time', '<=', strtotime($end_time)];
+        $result = $violationProductModel->where($map)->where('status', 0)
+            ->select(['company_name', DB::raw('count(link_url) as count')])->orderby('count', 'desc')
+            ->groupby('company_name')->get()->toarray();
+        //执行下载
+        $this->Violation_export_download($result);
+    }
+
+
+    /**
+     * 禁止挂网链接数统计-导出下载
+     * @author 唐远望
+     * @version 1.0
+     * @date 2025-06-17
+     */
+    public function Violation_export_download($data)
+    {
+        // 创建一个新的 Spreadsheet 对象
+        $spreadsheet = new Spreadsheet();
+        $sheet = $spreadsheet->getActiveSheet();
+
+        //合并单元格
+        $sheet->mergeCells('A1:B1');
+        $sheet->setCellValue('A1', '禁止挂网链接数统计数据(导出时间:' . date('Y-m-d H:i:s', time()) . ')'); // 设置合并后的单元格内容
+        // 获取合并后的单元格样式对象
+        $style = $sheet->getStyle('A1');
+        // 设置水平居中和垂直居中
+        $style->getAlignment()->setHorizontal(Alignment::HORIZONTAL_CENTER)->setVertical(Alignment::VERTICAL_CENTER);
+        // 然后设置行高以适应两行文本
+        $sheet->getRowDimension(1)->setRowHeight(40); // 设置行高,单位是磅(point)
+        // 设置表头
+        $sheet->setCellValue('A2', '公司名称');
+        $sheet->setCellValue('B2', '链接挂网数量');
+
+        // 填充数据
+        $row = 3; // 从第3行开始
+        foreach ($data as $item) {
+            $sheet->setCellValue('A' . $row, $item['company_name']);
+            $sheet->setCellValue('B' . $row, $item['count']);
+            $row++;
+        }
+        // 生成 Excel 文件
+        $writer = new Xlsx($spreadsheet);
+
+        // 直接输出到浏览器(下载)
+        $filename = '禁止挂网链接数统计数据' . date('YmdHis') . '.xlsx';
+        header('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');
+        header('Content-Disposition: attachment;filename="' . $filename . '"');
+        header('Cache-Control: max-age=0');
+        $writer->save('php://output');
+        exit;
+    }
+
+    /**
+     * 禁止挂网公司月度统计
+     * @author 唐远望
+     * @version   1.0
+     * @date      2025-12-26
+     * 
+     */
+    public function get_violation_company_count(request $request, ViolationProductModel $violationProductModel)
+    {
+        $request->scene('get_violation_company_count')->validate();
+        $limit = request('limit', config('page_num', 10));
+        $start_time = request('start_time', '');
+        $end_time = request('end_time', '');
+        // 时间条件
+        $map  = [];
+        if ($start_time) $map[] = ['insert_time', '>=', strtotime($start_time)];
+        if ($end_time) $map[]   = ['insert_time', '<=', strtotime($end_time)];
+        $result = $violationProductModel->where($map)->where('status', 0)
+            ->select(['company_name', DB::raw('count(company_name) as count')])->orderby('count', 'desc')
+            ->groupby('company_name')->paginate($limit);
+        return  json_send(['code' => 'success', 'msg' => '获取成功', 'data' => $result]);
+    }
+
+    /**
+     * 禁止挂网公司月度统计-导出
+     * @author 唐远望
+     * @version   1.0
+     * @date      2025-12-26
+     * 
+     */
+    public function violation_company_export(request $request, ViolationProductModel $violationProductModel)
+    {
+        $start_time = request('start_time', '');
+        $end_time = request('end_time', '');
+        // 时间条件
+        $map  = [];
+        if ($start_time) $map[] = ['insert_time', '>=', strtotime($start_time)];
+        if ($end_time) $map[]   = ['insert_time', '<=', strtotime($end_time)];
+        $result = $violationProductModel->where($map)->where('status', 0)
+            ->select(['company_name', DB::raw('count(company_name) as count')])->orderby('count', 'desc')
+            ->groupby('company_name')->get()->toarray();
+        //执行下载
+        $this->ViolationCompany_export_download($result);
+    }
+
+    /**
+     * 禁止挂网公司月度统计-导出下载
+     * @author 唐远望
+     * @version   1.0
+     * @date      2025-12-26
+     * 
+     */
+    public function ViolationCompany_export_download($data)
+    {
+        // 创建一个新的 Spreadsheet 对象
+        $spreadsheet = new Spreadsheet();
+        $sheet = $spreadsheet->getActiveSheet();
+
+        //合并单元格
+        $sheet->mergeCells('A1:B1');
+        $sheet->setCellValue('A1', '禁止挂网公司月度统计数据(导出时间:' . date('Y-m-d H:i:s', time()) . ')'); // 设置合并后的单元格内容
+        // 获取合并后的单元格样式对象
+        $style = $sheet->getStyle('A1');
+        // 设置水平居中和垂直居中
+        $style->getAlignment()->setHorizontal(Alignment::HORIZONTAL_CENTER)->setVertical(Alignment::VERTICAL_CENTER);
+        // 然后设置行高以适应两行文本
+        $sheet->getRowDimension(1)->setRowHeight(40); // 设置行高,单位是磅(point)
+        // 设置表头
+        $sheet->setCellValue('A2', '公司名称');
+        $sheet->setCellValue('B2', '挂网数量');
+
+        // 填充数据
+        $row = 3; // 从第3行开始
+        foreach ($data as $item) {
+            $sheet->setCellValue('A' . $row, $item['company_name']);
+            $sheet->setCellValue('B' . $row, $item['count']);
+            $row++;
+        }
+        // 生成 Excel 文件
+        $writer = new Xlsx($spreadsheet);
+
+        // 直接输出到浏览器(下载)
+        $filename = '禁止挂网公司月度统计数据' . date('YmdHis') . '.xlsx';
+        header('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');
+        header('Content-Disposition: attachment;filename="' . $filename . '"');
+        header('Cache-Control: max-age=0');
+        $writer->save('php://output');
+        exit;
+    }
+
+
+    /*
+     * 低价违规挂网链接数统计
+     * @author 唐远望
+     * @version   1.0
+     * @date      2025-12-26
+     * 
+     */
+    public function getLowPriceLinkCount(request $request, LowPriceGoodsModel $LowPriceGoodsModel)
+    {
+        $request->scene('getLowPriceLinkCount')->validate();
+        $limit = request('limit', config('page_num', 10));
+        $start_time = request('start_time', '');
+        $end_time = request('end_time', '');
+        // 时间条件
+        $map  = [];
+        if ($start_time) $map[] = ['insert_time', '>=', strtotime($start_time)];
+        if ($end_time) $map[]   = ['insert_time', '<=', strtotime($end_time)];
+        $result = $LowPriceGoodsModel->where($map)->where('status', 0)
+            ->select(['company_name', DB::raw('count(link_url) as count')])->orderby('count', 'desc')
+            ->groupby('company_name')->paginate($limit);
+        return  json_send(['code' => 'success', 'msg' => '获取成功', 'data' => $result]);
+    }
+
+    /**
+     * 低价违规挂网链接数统计-导出
+     * @author 唐远望
+     * @version   1.0
+     * @date      2025-12-26
+     * 
+     */
+    public function low_price_export(request $request, LowPriceGoodsModel $LowPriceGoodsModel)
+    {
+        $start_time = request('start_time', '');
+        $end_time = request('end_time', '');
+        // 时间条件
+        $map  = [];
+        if ($start_time) $map[] = ['insert_time', '>=', strtotime($start_time)];
+        if ($end_time) $map[]   = ['insert_time', '<=', strtotime($end_time)];
+        $result = $LowPriceGoodsModel->where($map)->where('status', 0)
+            ->select(['company_name', DB::raw('count(link_url) as count')])->orderby('count', 'desc')
+            ->groupby('company_name')->get()->toarray();
+        //执行下载
+        $this->LowPrice_export_download($result);
+    }
+
+    /**
+     * 低价违规挂网链接数统计-导出下载
+     * @author 唐远望
+     * @version   1.0
+     * @date      2025-12-26
+     * 
+     */
+    public function LowPrice_export_download($data)
+    {
+        // 创建一个新的 Spreadsheet 对象
+        $spreadsheet = new Spreadsheet();
+        $sheet = $spreadsheet->getActiveSheet();
+
+        //合并单元格
+        $sheet->mergeCells('A1:B1');
+        $sheet->setCellValue('A1', '低价违规挂网链接数统计数据(导出时间:' . date('Y-m-d H:i:s', time()) . ')'); // 设置合并后的单元格内容
+        // 获取合并后的单元格样式对象
+        $style = $sheet->getStyle('A1');
+        // 设置水平居中和垂直居中
+        $style->getAlignment()->setHorizontal(Alignment::HORIZONTAL_CENTER)->setVertical(Alignment::VERTICAL_CENTER);
+        // 然后设置行高以适应两行文本
+        $sheet->getRowDimension(1)->setRowHeight(40); // 设置行高,单位是磅(point)
+        // 设置表头
+        $sheet->setCellValue('A2', '公司名称');
+        $sheet->setCellValue('B2', '链接挂网数量');
+
+        // 填充数据
+        $row = 3; // 从第3行开始
+        foreach ($data as $item) {
+            $sheet->setCellValue('A' . $row, $item['company_name']);
+            $sheet->setCellValue('B' . $row, $item['count']);
+            $row++;
+        }
+        // 生成 Excel 文件
+        $writer = new Xlsx($spreadsheet);
+
+        // 直接输出到浏览器(下载)
+        $filename = '低价违规挂网链接数统计数据' . date('YmdHis') . '.xlsx';
+        header('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');
+        header('Content-Disposition: attachment;filename="' . $filename . '"');
+        header('Cache-Control: max-age=0');
+        $writer->save('php://output');
+        exit;
+    }
+
+    /*
+     * 低价违规挂网公司月度统计
+     * @author 唐远望
+     * @version   1.0
+     * @date      2025-12-26
+     * 
+     */
+    public function getLowPriceCompanyCount(request $request, LowPriceGoodsModel $LowPriceGoodsModel)
+    {
+        $request->scene('getLowPriceCompanyCount')->validate();
+        $limit = request('limit', config('page_num', 10));
+        $start_time = request('start_time', '');
+        $end_time = request('end_time', '');
+        // 时间条件
+        $map  = [];
+        if ($start_time) $map[] = ['insert_time', '>=', strtotime($start_time)];
+        if ($end_time) $map[]   = ['insert_time', '<=', strtotime($end_time)];
+        $result = $LowPriceGoodsModel->where($map)->where('status', 0)
+            ->select(['company_name', DB::raw('count(company_name) as count')])->orderby('count', 'desc')
+            ->groupby('company_name')->paginate($limit);
+        return  json_send(['code' => 'success', 'msg' => '获取成功', 'data' => $result]);
+    }
+
+    /**
+     * 低价违规挂网公司月度统计-导出
+     * @author 唐远望
+     * @version   1.0
+     * @date      2025-12-26
+     * 
+     */
+    public function low_price_company_export(request $request, LowPriceGoodsModel $LowPriceGoodsModel)
+    {
+        $start_time = request('start_time', '');
+        $end_time = request('end_time', '');
+        // 时间条件
+        $map  = [];
+        if ($start_time) $map[] = ['insert_time', '>=', strtotime($start_time)];
+        if ($end_time) $map[]   = ['insert_time', '<=', strtotime($end_time)];
+        $result = $LowPriceGoodsModel->where($map)->where('status', 0)
+            ->select(['company_name', DB::raw('count(company_name) as count')])->orderby('count', 'desc')
+            ->groupby('company_name')->get()->toarray();
+        //执行下载
+        $this->LowPriceCompany_export_download($result);
+    }
+    /**
+     * 低价违规挂网公司月度统计-导出下载
+     * @author 唐远望
+     * @version   1.0
+     * @date      2025-12-26
+     * 
+     */
+    public function LowPriceCompany_export_download($data)
+    {
+        // 创建一个新的 Spreadsheet 对象
+        $spreadsheet = new Spreadsheet();
+        $sheet = $spreadsheet->getActiveSheet();
+
+        //合并单元格
+        $sheet->mergeCells('A1:B1');
+        $sheet->setCellValue('A1', '低价违规挂网公司月度统计数据(导出时间:' . date('Y-m-d H:i:s', time()) . ')'); // 设置合并后的单元格内容
+        // 获取合并后的单元格样式对象
+        $style = $sheet->getStyle('A1');
+        // 设置水平居中和垂直居中
+        $style->getAlignment()->setHorizontal(Alignment::HORIZONTAL_CENTER)->setVertical(Alignment::VERTICAL_CENTER);
+        // 然后设置行高以适应两行文本
+        $sheet->getRowDimension(1)->setRowHeight(40); // 设置行高,单位是磅(point)
+        // 设置表头
+        $sheet->setCellValue('A2', '公司名称');
+        $sheet->setCellValue('B2', '挂网数量');
+
+        // 填充数据
+        $row = 3; // 从第3行开始
+        foreach ($data as $item) {
+            $sheet->setCellValue('A' . $row, $item['company_name']);
+            $sheet->setCellValue('B' . $row, $item['count']);
+            $row++;
+        }
+        // 生成 Excel 文件
+        $writer = new Xlsx($spreadsheet);
+
+        // 直接输出到浏览器(下载)
+        $filename = '低价违规挂网公司月度统计数据' . date('YmdHis') . '.xlsx';
+        header('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');
+        header('Content-Disposition: attachment;filename="' . $filename . '"');
+        header('Cache-Control: max-age=0');
+        $writer->save('php://output');
+        exit;
+    }
+}

+ 6 - 6
app/Http/Controllers/Manager/WashConfig/LowPriceGoods.php

@@ -156,10 +156,10 @@ class LowPriceGoods extends Controller
         $sampling_start_time = request('sampling_start_time', '');
         $sampling_end_time = request('sampling_end_time', '');
         $all_data['sampling_cycle'] = $sampling_cycle;
-        $all_data['sampling_start_time'] = strtotime($sampling_start_time . '00:00:00');
-        $all_data['sampling_end_time'] = strtotime($sampling_end_time . '23:59:59');
+        $all_data['sampling_start_time'] = $sampling_start_time ? strtotime($sampling_start_time . '00:00:00'):'0';
+        $all_data['sampling_end_time'] = $sampling_end_time ? strtotime($sampling_end_time . '23:59:59'):'0';
         $allow_sampling_time = Carbon::tomorrow()->startOfDay()->getTimestamp();// 明天的开始时间(允许开始采集时间校验)
-        if ($all_data['sampling_start_time'] < $allow_sampling_time) return json_send(['code' => 'error', 'msg' => '采集最早开始时间为明天']);
+        if ($all_data['sampling_start_time'] && $all_data['sampling_start_time'] < $allow_sampling_time) return json_send(['code' => 'error', 'msg' => '采集最早开始时间为明天']);
         //查询是否存在
         $map = ['product_name' => $all_data['product_name'], 'product_specs' => $all_data['product_specs'], 'platform' => $all_data['platform']];
         $data = $LowPriceGoodsModel->where($map)->first();
@@ -204,8 +204,8 @@ class LowPriceGoods extends Controller
         $sampling_start_time = request('sampling_start_time', '');
         $sampling_end_time = request('sampling_end_time', '');
         $all_data['sampling_cycle'] = $sampling_cycle;
-        $all_data['sampling_start_time'] = strtotime($sampling_start_time . '00:00:00');
-        $all_data['sampling_end_time'] = strtotime($sampling_end_time . '23:59:59');
+        $all_data['sampling_start_time'] = $sampling_start_time ? strtotime($sampling_start_time . '00:00:00'):'0';
+        $all_data['sampling_end_time'] = $sampling_end_time ? strtotime($sampling_end_time . '23:59:59'):'0';
         //查询是否存在
         $map = ['product_name' => $all_data['product_name'], 'product_specs' => $all_data['product_specs'], 'platform' => $all_data['platform']];
         $data = $LowPriceGoodsModel->where($map)->where('id', '!=', $id)->first();
@@ -217,7 +217,7 @@ class LowPriceGoods extends Controller
         //如果修改采集周期,则校验采集时间是否在明天以后
         if ($sampling_cycle != $LowProduct->sampling_cycle) {
             $allow_sampling_time = Carbon::tomorrow()->startOfDay()->getTimestamp(); // 明天的开始时间(允许开始采集时间校验)
-            if ($all_data['sampling_start_time'] < $allow_sampling_time) return json_send(['code' => 'error', 'msg' => '采集最早开始时间为明天']);
+            if ($all_data['sampling_start_time'] && $all_data['sampling_start_time'] < $allow_sampling_time) return json_send(['code' => 'error', 'msg' => '采集最早开始时间为明天']);
         }
         $result =  $LowPriceGoodsModel->editLowProduct_content($LowProduct, $all_data);
         // 如果操作失败

+ 6 - 6
app/Http/Controllers/Manager/WashConfig/ViolationProduct.php

@@ -156,10 +156,10 @@ class ViolationProduct extends Controller
         $sampling_start_time = request('sampling_start_time', '');
         $sampling_end_time = request('sampling_end_time', '');
         $all_data['sampling_cycle'] = $sampling_cycle;
-        $all_data['sampling_start_time'] = strtotime($sampling_start_time . '00:00:00');
-        $all_data['sampling_end_time'] = strtotime($sampling_end_time . '23:59:59');
+        $all_data['sampling_start_time'] = $sampling_start_time ? strtotime($sampling_start_time . '00:00:00'):'0';
+        $all_data['sampling_end_time'] = $sampling_end_time ? strtotime($sampling_end_time . '23:59:59'):'0';
         $allow_sampling_time = Carbon::tomorrow()->startOfDay()->getTimestamp();// 明天的开始时间(允许开始采集时间校验)
-        if ($all_data['sampling_start_time'] < $allow_sampling_time) return json_send(['code' => 'error', 'msg' => '采集最早开始时间为明天']);
+        if ($all_data['sampling_start_time']  && $all_data['sampling_start_time'] < $allow_sampling_time) return json_send(['code' => 'error', 'msg' => '采集最早开始时间为明天']);
         //查询是否存在
         $map = ['product_name' => $all_data['product_name'], 'product_specs' => $all_data['product_specs'], 'platform' => $all_data['platform']];
         $data = $ViolationProductModel->where($map)->first();
@@ -204,8 +204,8 @@ class ViolationProduct extends Controller
         $sampling_start_time = request('sampling_start_time', '');
         $sampling_end_time = request('sampling_end_time', '');
         $all_data['sampling_cycle'] = $sampling_cycle;
-        $all_data['sampling_start_time'] = strtotime($sampling_start_time . '00:00:00');
-        $all_data['sampling_end_time'] = strtotime($sampling_end_time . '23:59:59');
+        $all_data['sampling_start_time'] = $sampling_start_time ? strtotime($sampling_start_time . '00:00:00'):'0';
+        $all_data['sampling_end_time'] = $sampling_end_time ? strtotime($sampling_end_time . '23:59:59'):'0';
         //查询是否存在
         $map = ['product_name' => $all_data['product_name'], 'product_specs' => $all_data['product_specs'], 'platform' => $all_data['platform']];
         $data = $ViolationProductModel->where($map)->where('id', '!=', $id)->first();
@@ -217,7 +217,7 @@ class ViolationProduct extends Controller
         //如果修改采集周期,则校验采集时间是否在明天以后
         if ($sampling_cycle != $ViolationProduct->sampling_cycle) {
             $allow_sampling_time = Carbon::tomorrow()->startOfDay()->getTimestamp(); // 明天的开始时间(允许开始采集时间校验)
-            if ($all_data['sampling_start_time'] < $allow_sampling_time) return json_send(['code' => 'error', 'msg' => '采集最早开始时间为明天']);
+            if ($all_data['sampling_start_time']  && $all_data['sampling_start_time'] < $allow_sampling_time) return json_send(['code' => 'error', 'msg' => '采集最早开始时间为明天']);
         }
         $result =  $ViolationProductModel->editViolationProduct_content($ViolationProduct, $all_data);
         // 如果操作失败

+ 78 - 0
app/Http/Requests/Manager/Statistics/OverviewPanel.php

@@ -0,0 +1,78 @@
+<?php
+
+namespace App\Http\Requests\Manager\Statistics;
+
+use App\Http\Requests\BaseRequest;
+
+/**
+ * 报表统计-概览面板
+ * @author 唐远望
+ * @version 1.0
+ * @date 2025-12-26
+ * 
+ */
+class OverviewPanel extends BaseRequest
+{
+    /**
+     * 获取应用于请求的规则
+     *
+     * @return array
+     */
+    public function rules()
+    {
+        // 返回结果
+        return      [
+            'name'                 => 'required',
+            'id'                => 'required|integer|gt:0',
+            'status'            => 'required|integer|in:0,1',
+            'page'              => 'integer|min:1',
+            'limit'             => 'integer|min:1',
+            'image_url'         => 'required',
+            'link_url'          => 'required',
+            'sort'              => 'required|integer|min:0',
+        ];
+    }
+
+
+    // 场景列表
+    protected   $scenes         = [
+        'detail'             => ['id'],
+        'list'               => ['page', 'limit'],
+        'add'                      => [''],
+        'edit'                      => [''],
+        'set_status'              => ['id', 'status'],
+        'delete'                  => ['id'],
+        'data_cleaning'           => [''],
+        'export_excel'            => [''],
+        'getViolationLinkCount'   => ['page','limit'],
+        'getLowPriceLinkCount'   => ['page','limit'],
+        'get_violation_company_count'   => ['page','limit'],
+    ];
+
+    /**
+     * 获取已定义验证规则的错误消息
+     *
+     * @return array
+     */
+    public function messages()
+    {
+        return [
+            'name.required'     => '名称必填',
+            'id.required'       => 'ID未知',
+            'id.integer'        => 'ID格式错误',
+            'id.gt'               => 'ID格式错误',
+            'status.required'   => '状态未知',
+            'status.integer'    => '状态格式错误',
+            'status.in'         => '状态格式错误',
+            'page.integer'      => '页码格式错误',
+            'page.min'          => '页码格式错误',
+            'limit.integer'     => '每页数量格式错误',
+            'limit.min'         => '每页数量格式错误',
+            'image_url.required'    => '图片链接未知',
+            'link_url.required'     => '链接地址未知',
+            'sort.required'         => '排序未知',
+            'sort.integer'          => '排序格式错误',
+            'sort.min'              => '排序格式错误',
+        ];
+    }
+}

+ 18 - 1
routes/manager.php

@@ -241,4 +241,21 @@ Route::any('upload/get_sign_url',[App\Http\Controllers\Manager\Upload::class,'ge
 Route::any('upload/uploadimg',[App\Http\Controllers\Manager\Upload::class,'uploadimg']);
 
 // 操作日志-列表
-Route::any('operation_log/list', [App\Http\Controllers\Manager\AdminHistory::class, 'list']);
+Route::any('operation_log/list', [App\Http\Controllers\Manager\AdminHistory::class, 'list']);
+
+//报表统计-禁止挂网链接数统计
+Route::any('statistics/overview_panel/get_violation_link_count', [App\Http\Controllers\Manager\Statistics\OverviewPanel::class, 'getViolationLinkCount']);
+//报表统计-禁止挂网链接数统计-导出
+Route::any('statistics/overview_panel/violation_export', [App\Http\Controllers\Manager\Statistics\OverviewPanel::class, 'Violation_export']);
+//报表统计-禁止挂网公司月度统计
+Route::any('statistics/overview_panel/get_violation_company_count', [App\Http\Controllers\Manager\Statistics\OverviewPanel::class, 'get_violation_company_count']);
+//报表统计-禁止挂网公司月度统计-导出
+Route::any('statistics/overview_panel/violation_company_export', [App\Http\Controllers\Manager\Statistics\OverviewPanel::class, 'violation_company_export']);
+//报表统计-低价违规挂网链接数统计
+Route::any('statistics/overview_panel/get_low_price_link_count', [App\Http\Controllers\Manager\Statistics\OverviewPanel::class, 'getLowPriceLinkCount']);
+//报表统计-低价违规挂网链接数统计-导出
+Route::any('statistics/overview_panel/low_price_export', [App\Http\Controllers\Manager\Statistics\OverviewPanel::class, 'low_price_export']);
+//报表统计-低价违规挂网公司月度统计
+Route::any('statistics/overview_panel/get_low_price_company_count', [App\Http\Controllers\Manager\Statistics\OverviewPanel::class, 'getLowPriceCompanyCount']);
+//报表统计-低价违规挂网公司月度统计-导出
+Route::any('statistics/overview_panel/low_price_company_export', [App\Http\Controllers\Manager\Statistics\OverviewPanel::class, 'low_price_company_export']);