更新若干功能
This commit is contained in:
38
app/Http/Controllers/Api/AfterSaleController.php
Normal file
38
app/Http/Controllers/Api/AfterSaleController.php
Normal 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 ? '已通过' : '已拒绝'
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -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 : [],
|
||||
), '导入完成');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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 : []), '导入完成');
|
||||
}
|
||||
}
|
||||
|
||||
34
app/Http/Controllers/Api/FeedbackController.php
Normal file
34
app/Http/Controllers/Api/FeedbackController.php
Normal 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', '')),
|
||||
'已回复'
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -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)));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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'];
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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',
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user