更新若干功能
Some checks failed
Tests / PHP 8.2 (push) Has been cancelled
Tests / PHP 8.3 (push) Has been cancelled
Tests / PHP 8.4 (push) Has been cancelled

This commit is contained in:
2026-08-20 19:16:49 +08:00
parent 72bc6502eb
commit 4ddf5e3c5f
48 changed files with 1908 additions and 18 deletions

View File

@@ -0,0 +1,38 @@
<?php
namespace App\Http\Controllers\Api;
use App\BaseApp\BaseController;
use App\Service\business\AfterSaleService;
use Illuminate\Http\JsonResponse;
/**
* 后台售后
*/
class AfterSaleController extends BaseController
{
protected array $exceptRoute = ['option', 'create'];
public function __construct()
{
parent::__construct();
$this->service = AfterSaleService::getInstance();
}
/**
* 审核售后
* @Method POST
*/
public function audit(): JsonResponse
{
$pass = (int) request()->post('status', 1) === 1;
return jok(
$this->service->audit(
(int) request()->post('id', 0),
$pass,
(string) request()->post('admin_remark', '')
),
$pass ? '已通过' : '已拒绝'
);
}
}

View File

@@ -18,7 +18,7 @@ class CatalogueController extends BaseController
$this->service = CatalogueService::getInstance();
$this->insertField = ['title', 'category_id', 'cover', 'identifier'];
$this->updateField = ['id', 'title', 'category_id', 'cover', 'identifier'];
$this->notRequest = ['alias', 'pdf', 'price', 'status'];
$this->notRequest = ['alias', 'pdf', 'video', 'price', 'status'];
}
/**
@@ -32,4 +32,27 @@ class CatalogueController extends BaseController
$params = $this->checkRequiredFields(request()->post());
return jok($this->service->status($params['id'], $params['status']), '操作成功');
}
/**
* 导出商品表(结构化数据,前端 ExcelJS xlsx
* @Method GET
*/
public function export(): JsonResponse
{
return jok($this->service->exportExcel());
}
/**
* 导入商品表:前端已把 xlsx 拆成 rows
* @Method POST
*/
public function import(): JsonResponse
{
$rows = request()->post('rows', []);
$priceSheets = request()->post('price_sheets', []);
return jok($this->service->importRows(
is_array($rows) ? $rows : [],
is_array($priceSheets) ? $priceSheets : [],
), '导入完成');
}
}

View File

@@ -32,4 +32,23 @@ class FactoryInfoController extends BaseController
$params = $this->checkRequiredFields(request()->post());
return jok($this->service->status($params['id'], $params['status']), '操作成功');
}
/**
* 导出工厂表(结构化数据,前端 ExcelJS xlsx
* @Method GET
*/
public function export(): JsonResponse
{
return jok($this->service->exportExcel());
}
/**
* 导入工厂表:前端已把 xlsx 拆成 rows
* @Method POST
*/
public function import(): JsonResponse
{
$rows = request()->post('rows', []);
return jok($this->service->importRows(is_array($rows) ? $rows : []), '导入完成');
}
}

View File

@@ -0,0 +1,34 @@
<?php
namespace App\Http\Controllers\Api;
use App\BaseApp\BaseController;
use App\Service\business\FeedbackService;
use Illuminate\Http\JsonResponse;
/**
* 后台用户反馈
*/
class FeedbackController extends BaseController
{
protected array $exceptRoute = ['option', 'create'];
public function __construct()
{
parent::__construct();
$this->service = FeedbackService::getInstance();
$this->updateField = ['id', 'reply'];
}
/**
* 回复
* @Method POST
*/
public function reply(): JsonResponse
{
return jok(
$this->service->reply((int) request()->post('id', 0), (string) request()->post('reply', '')),
'已回复'
);
}
}

View File

@@ -58,4 +58,13 @@ class ListController extends BaseController
{
return jok($this->service->deleteItem(request()->post('ids', [])), '删除成功');
}
/**
* 导出清单报价(结构化数据 + 分享文本)
* @Method GET
*/
public function exportQuote(): JsonResponse
{
return jok($this->service->exportQuote((int) request()->get('id', 0)));
}
}

View File

@@ -18,7 +18,7 @@ class PriceSheetController extends BaseController
$this->service = PriceSheetService::getInstance();
$this->insertField = ['catalogue_id'];
$this->updateField = ['id'];
$this->notRequest = ['specification', 'dimension', 'routine', 'rows', 'status'];
$this->notRequest = ['specification', 'dimension', 'routine', 'stock', 'rows', 'status'];
}
/**

View File

@@ -19,7 +19,8 @@ class WxAppController extends BaseController
$this->updateField = ['id'];
$this->notRequest = [
'app_secret', 'mch_id', 'mch_key', 'mch_serial_no', 'mch_private_key',
'platform_public_key', 'notify_url', 'template_code', 'package_enabled', 'remark', 'name', 'app_id',
'platform_public_key', 'notify_url', 'template_code', 'package_enabled',
'subscribe_pay_tpl', 'subscribe_ship_tpl', 'remark', 'name', 'app_id',
];
}