feat: email gửi tay/nhắc gia hạn, gói hosting, sửa dữ liệu sản phẩm
- Gửi email theo template cho 1 khách, tab lịch sử email, nhắc gia hạn dịch vụ hàng loạt - Mail lưu from/bcc/sent_by; mẫu MARKETING và mẫu cũ trong TemplateSeeder - Gói hosting: giới hạn, trạng thái, lấy plan Plesk qua CLI gateway - Backfill payment_method và ngày đơn hàng còn thiếu - Bổ sung field CPU/RAM/Disk/Băng thông cho loại sản phẩm vps và cloud Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
8651dde6b1
commit
30898ea46f
@@ -5,12 +5,24 @@ namespace App\Http\Controllers\Api\Admin\Product;
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Http\Resources\Api\Admin\ProductCategoryResource;
|
||||
use App\Models\ProductCategories;
|
||||
use App\Services\Product\ProductCategorySampleService;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
class ProductCategoryController extends Controller
|
||||
{
|
||||
public function seedSample(ProductCategorySampleService $service): JsonResponse
|
||||
{
|
||||
$result = $service->seed();
|
||||
|
||||
return response()->json([
|
||||
'error' => false,
|
||||
'message' => "Đã tạo {$result['created']} và bổ sung thông tin cho {$result['updated']} nhóm dịch vụ.",
|
||||
'data' => $result,
|
||||
]);
|
||||
}
|
||||
|
||||
public function index(Request $request): JsonResponse
|
||||
{
|
||||
$perPage = min((int) $request->get('per_page', 15), 100);
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Http\Controllers\Api\Admin\Product;
|
||||
|
||||
use App\Exports\ProductsExport;
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Http\Resources\Api\Admin\ProductResource;
|
||||
use App\Http\Services\NextjsRevalidationService;
|
||||
@@ -12,6 +13,9 @@ use App\Models\Os;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Str;
|
||||
use Maatwebsite\Excel\Excel as ExcelWriter;
|
||||
use Maatwebsite\Excel\Facades\Excel;
|
||||
use Symfony\Component\HttpFoundation\BinaryFileResponse;
|
||||
|
||||
class ProductController extends Controller
|
||||
{
|
||||
@@ -40,6 +44,13 @@ class ProductController extends Controller
|
||||
]);
|
||||
}
|
||||
|
||||
public function export(): BinaryFileResponse
|
||||
{
|
||||
$filename = 'danh-sach-san-pham-' . now()->format('Y-m-d-His') . '.xlsx';
|
||||
|
||||
return Excel::download(new ProductsExport(), $filename, ExcelWriter::XLSX);
|
||||
}
|
||||
|
||||
public function show(int $id): JsonResponse
|
||||
{
|
||||
$product = $this->products->findWithPricings($id);
|
||||
|
||||
Reference in New Issue
Block a user