diff --git a/app/admin/service/BrandSeriesService.php b/app/admin/service/BrandSeriesService.php index 21760c3..bc9d11b 100644 --- a/app/admin/service/BrandSeriesService.php +++ b/app/admin/service/BrandSeriesService.php @@ -3,6 +3,7 @@ namespace app\admin\service; use app\admin\validate\BrandSeriesValidate; +use app\common\model\Brand; use app\common\traits\crud\CrudServiceTrait; use app\common\model\BrandSeries; use support\Request; @@ -77,4 +78,49 @@ class BrandSeriesService return $config; } + + /** + * 生成唯一的7位颜色编码 + * 格式:C + (O/I) + 5位字母数字组合 + * + * @param int $type 类型 + * @return string 7位唯一编码 + */ + public function generateUniqueModificationCode($brand_id) + { + $chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ'; + $maxAttempts = 10; // 防止无限循环 + + $brand_code = Brand::where('id', $brand_id)->value('brand_code'); + $brand_code = $brand_code??'BS'; + for ($attempt = 0; $attempt < $maxAttempts; $attempt++) { + // 生成后5位随机字符 + $suffix = ''; + for ($i = 0; $i < 6; $i++) { + $suffix .= $chars[rand(0, strlen($chars) - 1)]; + } + + $code = $brand_code . $suffix; + + // 检查是否已存在 + $existing = BrandSeries::where('series_code', $code)->first(); + if (!$existing) { + return $code; + } + } + + // 如果1000次尝试后仍然重复,使用时间戳确保唯一性 + $timestamp = substr(time(), -6); + return $brand_code . $timestamp; + } + + /** + * 添加前置处理 + */ + public function beforeServiceStore($data, Request $request) + { + $brand_id = $data['brand_id'] ?? 0; + $data['series_code'] = $this->generateUniqueModificationCode($brand_id); + return $data; + } } \ No newline at end of file diff --git a/app/admin/service/BrandService.php b/app/admin/service/BrandService.php index c35df96..61e1e65 100644 --- a/app/admin/service/BrandService.php +++ b/app/admin/service/BrandService.php @@ -43,6 +43,7 @@ class BrandService switch ($scene) { case 'index': // ====== ====== 排序 ====== ====== + $config['order']['hot'] = 'desc'; $config['order']['sort'] = 'desc'; $config['order']['id'] = 'desc'; diff --git a/app/admin/targets/controller/SalesAnnualTargetsController.php b/app/admin/targets/controller/SalesAnnualTargetsController.php new file mode 100644 index 0000000..6a51d08 --- /dev/null +++ b/app/admin/targets/controller/SalesAnnualTargetsController.php @@ -0,0 +1,45 @@ +service = new SalesAnnualTargetsService(); + } + + /** + * 列表页数据格式化 + * + * @param array $data + * @return array + */ + protected function indexFormat($data) + { + if (isset($data['created_at'])) + $data['created_at'] = date('Y-m-d H:i:s', $data['created_at']); + if (isset($data['updated_at'])) + $data['updated_at'] = date('Y-m-d H:i:s', $data['updated_at']); + if (isset($data['corp_id'])){ + $data['corp_name'] = Corp::where('id', $data['corp_id'])->value('name'); +// $data['corp_name'] = $data['corp_name']??'合塑集团'; + } + if (isset($data['user_id'])) + $data['user_name'] = User::where('id', $data['user_id'])->value('name'); + + if (empty($data['corp_id']) || empty($data['user_id'])){ + $data['user_name'] = '合塑集团'; + } + return $data; + } +} \ No newline at end of file diff --git a/app/admin/targets/controller/SalesMonthlyTargetsController.php b/app/admin/targets/controller/SalesMonthlyTargetsController.php new file mode 100644 index 0000000..461d503 --- /dev/null +++ b/app/admin/targets/controller/SalesMonthlyTargetsController.php @@ -0,0 +1,40 @@ +service = new SalesMonthlyTargetsService(); + } + + /** + * 列表页数据格式化 + * + * @param array $data + * @return array + */ + protected function indexFormat($data) + { + if (isset($data['created_at'])) + $data['created_at'] = date('Y-m-d H:i:s', $data['created_at']); + if (isset($data['updated_at'])) + $data['updated_at'] = date('Y-m-d H:i:s', $data['updated_at']); + if (isset($data['corp_id'])) + $data['corp_name'] = Corp::where('id', $data['corp_id'])->value('name'); + if (isset($data['user_id'])) + $data['user_name'] = User::where('id', $data['user_id'])->value('name'); + + return $data; + } +} \ No newline at end of file diff --git a/app/admin/targets/controller/StatisticsController.php b/app/admin/targets/controller/StatisticsController.php new file mode 100644 index 0000000..950f247 --- /dev/null +++ b/app/admin/targets/controller/StatisticsController.php @@ -0,0 +1,156 @@ +service = new SalesAnnualTargetsService(); + } + + public function total(Request $request) + { + $param = $request->all(); + if (empty($param['year'])) { + return $this->error('year不能为空'); + } + + $data = SalesAnnualTargets::select('annual_target','corp_id') + ->whereNull('user_id') + ->where('year',$param['year']) + ->orderBy('corp_id') + ->get() + ->toArray(); + + foreach ($data as &$value) { + $where = []; + $where[] = ['year', '=', $param['year']]; + if (!empty($value['corp_id'])) { + $where[] = ['corp_id', '=', $value['corp_id']]; + } + $value['achieved'] = SalesMonthlyTargets::where($where)->sum('achieved'); + $value['progress'] = empty($value['annual_target'])?'100%':number_format(($value['achieved']/$value['annual_target']*100),2) . '%'; + $value['corp_name'] = empty($value['corp_id'])?'集团':Corp::where(['id' => $value['corp_id']])->value('name'); + } + return $this->success($data); + } + + public function ranking(Request $request){ + $param = $request->all(); + $year = empty($param['year']) ? date('Y') : $param['year']; + $where = []; + $where[] = ['year', '=', $year]; + $ranking = SalesMonthlyTargets::select('corp_id', 'user_id', Db::raw('SUM(achieved) AS achieved')) + ->where($where) + ->groupBy('corp_id', 'user_id') + ->orderBy('achieved', 'desc') + ->get(); + foreach ($ranking as $key => $value) { + $ranking[$key]['corp_name'] = Corp::where(['id' => $value['corp_id']])->value('name'); + $ranking[$key]['user_name'] = User::where(['id' => $value['user_id']])->value('name'); + } + return $this->success($ranking); + } + + public function achievedUserByMonth(Request $request){ + $param = $request->all(); + $year = empty($param['year']) ? date('Y') : $param['year']; + $where = []; + $where[] = ['year', '=', $year]; + $ranking = SalesMonthlyTargets::select('corp_id', 'user_id', 'month', Db::raw('SUM(achieved) AS achieved')) + ->where($where) + ->groupBy('corp_id', 'user_id', 'month') + ->orderBy('user_id', 'asc') + ->orderBy('month', 'asc') + ->get(); + $result = []; + foreach ($ranking as $key => $value) { + $result[$value['user_id']]['month'][$value['month']] = $value['achieved']; + $result[$value['user_id']]['user_id'] = $value['user_id']; + $result[$value['user_id']]['corp_id'] = $value['corp_id']; + } + foreach ($result as $key => $value) { + for($i = 1; $i <= 12; $i++){ + $result[$key]['month'][$i] = $result[$key]['month'][$i]??0; + } + $result[$key]['month'] = array_values($result[$key]['month']); + $result[$key]['corp_name'] = Corp::where(['id' => $value['corp_id']])->value('name'); + $result[$key]['user_name'] = User::where(['id' => $value['user_id']])->value('name'); + } + $result = array_values($result); + return $this->success($result); + } + + /** + * 个人年度目标完成度(百分比) + * @param Request $request + * @return \support\Response + */ + public function userProgressh(Request $request){ + $param = $request->all(); + $year = empty($param['year']) ? date('Y') : $param['year']; + $where = []; + $where[] = ['year', '=', $year]; + $achieved = SalesMonthlyTargets::select('corp_id', 'user_id', Db::raw('SUM(achieved) AS achieved')) + ->where($where) + ->groupBy('corp_id', 'user_id') + ->orderBy('achieved', 'desc') + ->get() + ->toArray(); + $sort = []; + foreach ($achieved as $key => $value) { + $achieved[$key]['corp_name'] = Corp::where(['id' => $value['corp_id']])->value('name'); + $achieved[$key]['user_name'] = User::where(['id' => $value['user_id']])->value('name'); + $target = SalesAnnualTargets::where(['user_id' => $value['user_id']])->value('annual_target'); + $achieved[$key]['progressh'] = empty($target) ? 0 : round(($value['achieved'] / $target) * 100, 2); + $sort[] = $achieved[$key]['progressh']; + } + array_multisort($sort, SORT_DESC, SORT_NUMERIC, $achieved); + + foreach ($achieved as $key => $value) { + $achieved[$key]['progressh'] = $value['progressh']; + } + return $this->success($achieved); + } + + /** + * 个人累积完成数量(辆) + * @param Request $request + * @return \support\Response + */ + public function userAchieved(Request $request){ + $param = $request->all(); + $year = empty($param['year']) ? date('Y') : $param['year']; + $where = []; + $where[] = ['year', '=', $year]; + $achieved = SalesMonthlyTargets::select('corp_id', 'user_id', Db::raw('SUM(achieved) AS achieved')) + ->where($where) + ->groupBy('corp_id', 'user_id') + ->orderBy('achieved', 'desc') + ->get() + ->toArray(); + foreach ($achieved as $key => $value) { + $achieved[$key]['corp_name'] = Corp::where(['id' => $value['corp_id']])->value('name'); + $achieved[$key]['user_name'] = User::where(['id' => $value['user_id']])->value('name'); + $target = SalesAnnualTargets::where(['user_id' => $value['user_id']])->value('annual_target'); + $achieved[$key]['annual_target'] = empty($target) ? 0 : $target; + $achieved[$key]['total'] = [intval($value['achieved']), $achieved[$key]['annual_target']]; + } + return $this->success($achieved); + } + +} \ No newline at end of file diff --git a/app/admin/targets/logic/SalesAnnualTargetsLogic.php b/app/admin/targets/logic/SalesAnnualTargetsLogic.php new file mode 100644 index 0000000..e184e42 --- /dev/null +++ b/app/admin/targets/logic/SalesAnnualTargetsLogic.php @@ -0,0 +1,17 @@ +validator; + } + + /** + * 构建查询条件 + */ + protected function buildQueryConfig(Request $request, string $scene = 'index'): array + { + $p = $request->all(); + + $config = []; + $config['model'] = $this->modelClass; + switch ($scene) { + case 'index': + if (isset($p['year']) && $p['year']) { + $config['where']['year'] = $p['year']; + } + $config['order']['id'] = 'desc'; + break; + case 'show': + case 'update': + case 'destroy': + $config['where']['id'] = $p['id']; + break; + case 'store': + break; + } + + return $config; + } + // ====== 前置处理 ====== + /** + * 添加前置处理 + */ + public function beforeServiceStore($data, Request $request) + { + if(isset($data['user_id']) && $data['user_id'] && empty($data['corp_id'])){ + $data['corp_id'] = User::where('id', $data['user_id'])->value('corp_id'); + } + if(isset($data['corp_id']) && empty($data['corp_id'])){ + unset($data['corp_id']); + } + if(isset($data['user_id']) && empty($data['user_id'])){ + unset($data['user_id']); + } + if(isset($data['user_id']) && isset($data['user_id'])){ + $annualTargets = SalesAnnualTargets::where('year',$data['year'])->where('corp_id',$data['corp_id'])->where('user_id', $data['user_id'])->first(); + }else{ + $annualTargets = SalesAnnualTargets::where('year',$data['year'])->whereNull('corp_id')->whereNull('user_id')->first(); + } + + if($annualTargets){ + throw new BusinessException('目标重复添加'); + } + + return $data; + } +} \ No newline at end of file diff --git a/app/admin/targets/service/SalesMonthlyTargetsService.php b/app/admin/targets/service/SalesMonthlyTargetsService.php new file mode 100644 index 0000000..a093fc5 --- /dev/null +++ b/app/admin/targets/service/SalesMonthlyTargetsService.php @@ -0,0 +1,75 @@ +validator; + } + + /** + * 构建查询条件 + */ + protected function buildQueryConfig(Request $request, string $scene = 'index'): array + { + $p = $request->all(); + + $config = []; + $config['model'] = $this->modelClass; + switch ($scene) { + case 'index': + if (isset($p['year']) && $p['year']) { + $config['where']['year'] = $p['year']; + } + $config['order']['year'] = 'desc'; + $config['order']['user_id'] = 'desc'; + $config['order']['month'] = 'asc'; + $config['order']['id'] = 'desc'; + break; + case 'show': + case 'update': + case 'destroy': + $config['where']['id'] = $p['id']; + break; + case 'store': + break; + } + + return $config; + } + + // ====== 前置处理 ====== + /** + * 添加前置处理 + */ + public function beforeServiceStore($data, Request $request) + { + $data['corp_id'] = User::where('id', $data['user_id'])->value('corp_id'); + + return $data; + } +} \ No newline at end of file diff --git a/app/admin/targets/validate/SalesAnnualTargetsValidate.php b/app/admin/targets/validate/SalesAnnualTargetsValidate.php new file mode 100644 index 0000000..4a32545 --- /dev/null +++ b/app/admin/targets/validate/SalesAnnualTargetsValidate.php @@ -0,0 +1,29 @@ + [ + + ], + + 'update' => [ + + ] + ]; +} \ No newline at end of file diff --git a/app/admin/targets/validate/SalesMonthlyTargetsValidate.php b/app/admin/targets/validate/SalesMonthlyTargetsValidate.php new file mode 100644 index 0000000..955adbb --- /dev/null +++ b/app/admin/targets/validate/SalesMonthlyTargetsValidate.php @@ -0,0 +1,29 @@ + [ + + ], + + 'update' => [ + + ] + ]; +} \ No newline at end of file diff --git a/app/common/controller/VehModificationController.php b/app/common/controller/VehModificationController.php new file mode 100644 index 0000000..314ca40 --- /dev/null +++ b/app/common/controller/VehModificationController.php @@ -0,0 +1,47 @@ +service = new VehModificationService(); + } + + /** + * 列表页数据格式化 + * + * @param array $data + * @return array + */ + protected function indexFormat($data) + { + if (isset($data['created_at'])) + $data['created_at'] = date('Y-m-d H:i:s', $data['created_at']); + if (isset($data['updated_at'])) + $data['updated_at'] = date('Y-m-d H:i:s', $data['updated_at']); + return $data; + } + + /** + * 数据格式化 + * + * @param array $data + * @return array + */ + protected function showFormat($data) + { + if (isset($data['created_at'])) + $data['created_at'] = date('Y-m-d H:i:s', $data['created_at']); + if (isset($data['updated_at'])) + $data['updated_at'] = date('Y-m-d H:i:s', $data['updated_at']); + return $data; + } +} \ No newline at end of file diff --git a/app/common/logic/BrandLogic.php b/app/common/logic/BrandLogic.php index 3040572..ef46a5a 100644 --- a/app/common/logic/BrandLogic.php +++ b/app/common/logic/BrandLogic.php @@ -16,7 +16,7 @@ class BrandLogic public function getList() { - return Brand::where('status', 1)->orderBy('sort','desc')->get(['id', 'brand_code', 'brand_name', 'logo', 'description']); + return Brand::where('status', 1)->orderBy('hot','desc')->orderBy('sort','desc')->get(['id', 'brand_code', 'brand_name', 'logo', 'description']); } } \ No newline at end of file diff --git a/app/common/logic/SysAccountLogic.php b/app/common/logic/SysAccountLogic.php index 2f43410..44a81b6 100644 --- a/app/common/logic/SysAccountLogic.php +++ b/app/common/logic/SysAccountLogic.php @@ -16,7 +16,7 @@ class SysAccountLogic public function getList() { - return SysAccount::where('status', 1)->orderBy('sort','desc')->get(['id', 'account_name', 'currency_id', 'account_number', 'bank_name', 'bank_branch', 'description']); + return SysAccount::where('status', 1)->orderBy('sort','desc')->get(['id', 'account_name', 'currency_id', 'account_number', 'bank_name', 'bank_branch', 'description', 'short_desc']); } } \ No newline at end of file diff --git a/app/common/logic/SysPortLogic.php b/app/common/logic/SysPortLogic.php index e12c260..4de5cdf 100644 --- a/app/common/logic/SysPortLogic.php +++ b/app/common/logic/SysPortLogic.php @@ -16,7 +16,7 @@ class SysPortLogic public function getList($where) { - return SysPort::where('status', 1)->where($where)->orderBy('sort','desc')->get(['id', 'port_code', 'port_name', 'country_id', 'description']); + return SysPort::where('status', 1)->where($where)->orderBy('sort','desc')->get(['id', 'port_code', 'port_name', 'port_name_en', 'country_id', 'description']); } } \ No newline at end of file diff --git a/app/common/model/SalesAnnualTargets.php b/app/common/model/SalesAnnualTargets.php new file mode 100644 index 0000000..387ceaf --- /dev/null +++ b/app/common/model/SalesAnnualTargets.php @@ -0,0 +1,49 @@ + Util::getParam($request, 'address', ''), 'sex' => Util::getParam($request, 'sex', 0), 'obtain' => time(), - 'company' => Util::getParam($request, 'company', 0), + 'company' => Util::getParam($request, 'company', ''), ]; if (Util::isEmpty($id)) { diff --git a/app/crm/model/Customer.php b/app/crm/model/Customer.php index 326eb72..92c070d 100644 --- a/app/crm/model/Customer.php +++ b/app/crm/model/Customer.php @@ -3,6 +3,7 @@ namespace app\crm\model; +use app\common\model\Country; use app\crm\utils\Util; use config\constants\Constants; use DateTimeInterface; @@ -106,4 +107,9 @@ class Customer extends Model return $this->save($options); }); } + + public function countryInfo() + { + return $this->hasOne(Country::class, 'id', 'country_id'); + } } \ No newline at end of file diff --git a/app/crmAdmin/controller/StatisticsController.php b/app/crmAdmin/controller/StatisticsController.php new file mode 100644 index 0000000..77db8a0 --- /dev/null +++ b/app/crmAdmin/controller/StatisticsController.php @@ -0,0 +1,188 @@ +service = new CountryService(); + } + + public function whole() + { + $totals = Customer::count('id'); + $channelCount = InquiryChannel::count('id'); + $todayCount = Customer::where('created_at', '>=', strtotime(date('Y-m-d')))->count('id'); + $releaseCount = Customer::distinct('enter_user_id')->count('id'); + $countryCount = Country::count('id'); + $trackCount = Customer::distinct('user_id')->count(); + + $data = [ + 'totals' => $totals, + 'channelCount' => $channelCount, + 'todayCount' => $todayCount, + 'releaseCount' => $releaseCount, + 'countryCount' => $countryCount, + 'trackCount' => $trackCount + ]; + return $this->success($data); + } + + // 各渠道计数 + public function channelCount() + { + $inquiryChannelList = InquiryChannel::all(['id', 'name']); + $channels = []; + foreach ($inquiryChannelList as $key => $val) { + $channels[$val->id] = $val->name; + } + + $list = Customer::select('channel_id', Db::raw('COUNT(*) as totals')) + ->groupBy('channel_id') + ->get()->toArray(); + + $channelCounts = []; + foreach ($list as $vo) { + $channelCounts[] = [ + "name" => $channels[$vo["channel_id"]], + "value" => $vo["totals"] + ]; + } + return $this->success($channelCounts); + } + + // 各国家计数 + public function countryCount() + { + $list = Customer::with("countryInfo") + ->select('country_id', Db::raw('COUNT(*) as totals')) + ->where('country_id','<>',0) + ->groupBy('country_id') + ->get(); + $arr = []; + foreach ($list as $val) { + $arr[] = [ + "value" => $val->totals, + "name" => $val->countryInfo->cn_addr + ]; + } + return $this->success($arr); + } + + // 跟单人计数 + public function trackCount() + { + $list = Customer::with(["user"]) + ->where("user_id", ">", 0) + ->whereNotIn('user_id', [1,5,10,11,13,155,16,17,19,74,75,78,141,147]) + ->select('user_id', Db::raw('COUNT(*) as totals')) + ->groupBy('user_id') + ->get(); + $optionType = []; + $counts = []; + foreach ($list as $val) { + if (isset($val->user) && $val->user) { + $optionType[] = $val->user->name; + $counts[] = $val->totals; + } + } + $arr = [ + "optionType" => $optionType, + "counts" => $counts + ]; + return $this->success($arr); + } + + // 每日录单数 + public function dayCount() + { + $list = Db::table('crm_customer') + ->where('created_at', '>=', Carbon::now()->subDay(7)->timestamp) + ->select( + Db::raw('DATE(FROM_UNIXTIME(created_at)) as date'), + Db::raw('COUNT(*) as order_count') + ) + ->groupBy('date') + ->pluck('order_count', 'date')->toArray(); + $optionType = []; + $counts = []; + foreach ($list as $key=>$val) { + $optionType[] = $key; + $counts[] = $val; + } + $arr = [ + "optionType" => $optionType, + "counts" => $counts + ]; + return $this->success($arr); + } + + public function customerCount(Request $request) + { + $companyId = $request->get('company_id') ?? 0; + + // 1. 计算时间范围 + $now = Carbon::now(); + $sixMonthsAgo = $now->copy()->subMonths(5)->startOfMonth(); // 包含6个月 + var_dump($sixMonthsAgo->timestamp); + + // 2. 获取关联渠道ID + $channelIds = $this->getChannelIdsByCompany($companyId); + + if (empty($channelIds)) { + return collect(); + } + + // 3. 执行查询 + $list = Customer::select([ + DB::raw("DATE_FORMAT(FROM_UNIXTIME(created_at), '%Y-%m') AS month"), + DB::raw('COUNT(*) AS total_count') + ]) + ->whereIn('channel_id', $channelIds) + ->where('created_at', '>', 0) + ->where('created_at', '>=', $sixMonthsAgo->timestamp) // 添加时间限制 + ->groupBy('month') + ->orderBy('month') + ->get(); + + $optionType = []; + $counts = []; + foreach ($list as $item) { + $optionType[] = $item->month; + $counts[] = $item->total_count; + } + $arr = [ + "optionType" => $optionType, + "counts" => $counts + ]; + return $this->success($arr); + } + + /** + * 获取公司与渠道的映射 + */ + private function getChannelIdsByCompany($companyId) + { + $data = [ + 0 => [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11], + 1 => [1, 2, 3, 4, 5, 6, 7, 8], + 3 => [9, 10, 11] + ]; + return $data[$companyId] ?? []; + } +} \ No newline at end of file diff --git a/config/route.php b/config/route.php index d44e903..887c683 100644 --- a/config/route.php +++ b/config/route.php @@ -194,6 +194,15 @@ Route::group('/admin', function () { Route::any('/follow', [app\crmAdmin\controller\CustomerController::class, 'follow']); Route::any('/allocation', [app\crmAdmin\controller\CustomerController::class, 'allocation']); }); + // 统计 + Route::group('/statistics', function () { + Route::any('/whole', [app\crmAdmin\controller\StatisticsController::class, 'whole']); + Route::any('/channel/count', [app\crmAdmin\controller\StatisticsController::class, 'channelCount']); + Route::any('/country/count', [app\crmAdmin\controller\StatisticsController::class, 'countryCount']); + Route::any('/track/count', [app\crmAdmin\controller\StatisticsController::class, 'trackCount']); + Route::any('/day/count', [app\crmAdmin\controller\StatisticsController::class, 'dayCount']); + Route::any('/customer/count', [app\crmAdmin\controller\StatisticsController::class, 'customerCount']); + }); }); // 车辆 @@ -244,6 +253,7 @@ Route::group('/admin', function () { Route::any('/show', [app\admin\controller\BrandController::class, 'show']); Route::any('/store', [app\admin\controller\BrandController::class, 'store']); Route::any('/update', [app\admin\controller\BrandController::class, 'update']); + Route::any('/hot', [app\admin\controller\BrandController::class, 'update']); Route::any('/destroy', [app\admin\controller\BrandController::class, 'destroy']); // 车系 Route::group('/series', function () { @@ -316,6 +326,31 @@ Route::group('/admin', function () { Route::any('/print', [app\admin\controller\StockOrdersController::class, 'print']); Route::any('/detail', [app\admin\controller\StockOrdersController::class, 'detail']); }); + + // crm + Route::group('/targets', function () { + Route::group('/monthly', function () { + Route::any('/list', [app\admin\targets\controller\SalesMonthlyTargetsController::class, 'index']); + Route::any('/store', [app\admin\targets\controller\SalesMonthlyTargetsController::class, 'store']); + Route::any('/update', [app\admin\targets\controller\SalesMonthlyTargetsController::class, 'update']); + Route::any('/destroy', [app\admin\targets\controller\SalesMonthlyTargetsController::class, 'destroy']); + Route::any('/show', [app\admin\targets\controller\SalesMonthlyTargetsController::class, 'show']); + }); + Route::group('/annual', function () { + Route::any('/list', [app\admin\targets\controller\SalesAnnualTargetsController::class, 'index']); + Route::any('/store', [app\admin\targets\controller\SalesAnnualTargetsController::class, 'store']); + Route::any('/update', [app\admin\targets\controller\SalesAnnualTargetsController::class, 'update']); + Route::any('/destroy', [app\admin\targets\controller\SalesAnnualTargetsController::class, 'destroy']); + Route::any('/show', [app\admin\targets\controller\SalesAnnualTargetsController::class, 'show']); + }); + Route::group('/statistics', function () { + Route::any('/total', [app\admin\targets\controller\StatisticsController::class, 'total']); + Route::any('/ranking', [app\admin\targets\controller\StatisticsController::class, 'ranking']); + Route::any('/user/month', [app\admin\targets\controller\StatisticsController::class, 'achievedUserByMonth']); + Route::any('/user/progressh', [app\admin\targets\controller\StatisticsController::class, 'userProgressh']); + Route::any('/user/achieved', [app\admin\targets\controller\StatisticsController::class, 'userAchieved']); + }); + }); }); @@ -421,4 +456,13 @@ Route::group('/crm', function () { Route::any('/destroy', [app\common\controller\VehVehicleSkuController::class, 'destroy']); }); }); + + // 汽车改装项目 + Route::group('/modification', function () { + Route::any('/list', [app\common\controller\VehModificationController::class, 'index']); + Route::any('/show', [app\common\controller\VehModificationController::class, 'show']); + Route::any('/store', [app\common\controller\VehModificationController::class, 'store']); + Route::any('/update', [app\common\controller\VehModificationController::class, 'update']); + Route::any('/destroy', [app\common\controller\VehModificationController::class, 'destroy']); + }); }); \ No newline at end of file