feat : rank

This commit is contained in:
2025-04-09 16:29:33 +08:00
parent 6b774b8509
commit 4ecb5d2084
4 changed files with 105 additions and 35 deletions

View File

@@ -24,6 +24,7 @@ use App\Model\User;
use App\Service\Admin\Catering\CateringBaseService;
use App\Service\Admin\Catering\Print\PrintOrderFactory;
use App\Service\ServiceTrait\Admin\Catering\PrintTrait;
use App\Service\ServiceTrait\Common\PickupCodeTrait;
use Exception;
use Hyperf\DbConnection\Db;
use Hyperf\Di\Annotation\Inject;
@@ -33,6 +34,7 @@ use Psr\Container\NotFoundExceptionInterface;
class CateringService extends CateringBaseService
{
use PrintTrait;
use PickupCodeTrait;
/**
* @var OrderOptionCateringLog
@@ -418,35 +420,35 @@ class CateringService extends CateringBaseService
return $result;
}
/**
* @param array $data
* @return array
*/
private function buildPickupCodeListData(array $data): array
{
$result = [];
foreach ($data as $item) {
// 提取关键字段
$orderId = $item["order_id"];
$copies = $item["copies"];
$pickupCode = $item["pickup_code"];
$heapsort = $item["heapsort"];
// 按层级构建数组结构
if (!isset($result[$orderId])) {
$result[$orderId] = [];
}
if (!isset($result[$orderId][$copies])) {
$result[$orderId][$copies] = [
'pickup_code' => $pickupCode,
'heapsort' => $heapsort,
];
}
}
return $result;
}
// /**
// * @param array $data
// * @return array
// */
// private function buildPickupCodeListData(array $data): array
// {
// $result = [];
// foreach ($data as $item) {
// // 提取关键字段
// $orderId = $item["order_id"];
// $copies = $item["copies"];
// $pickupCode = $item["pickup_code"];
// $heapsort = $item["heapsort"];
//
// // 按层级构建数组结构
// if (!isset($result[$orderId])) {
// $result[$orderId] = [];
// }
//
// if (!isset($result[$orderId][$copies])) {
// $result[$orderId][$copies] = [
// 'pickup_code' => $pickupCode,
// 'heapsort' => $heapsort,
// ];
// }
// }
//
// return $result;
// }
/**
* 打印置灰和截单