发货方式优化及消息功能优化

This commit is contained in:
Dev
2026-10-08 20:34:08 +08:00
parent f21b010ced
commit 7e3e999b74
23 changed files with 371 additions and 455 deletions
@@ -37,24 +37,28 @@ class OrderShipService
}
/**
* 需求交付发货单(开发者发货:凭证截图+交付附件+备注)
* 多图/多文件统一存英文逗号分隔的 URL 字符串:
* 需求交付发货单(开发者发货:凭证截图 + 交付附件/链接 + 备注)
* 多图/多文件/多链接统一存英文逗号分隔的 URL 字符串:
* http://xxx/a.jpg,http://xxx/b.pdf
* 说明:源码通常在企业微信沟通群直接交付,平台只登记发货状态,
* 故附件与链接均为选填,仅凭证截图必填
* @param $order_no
* @param $order_goods_spu_id
* @param $demand_id
* @param array $images URL 数组
* @param array $files URL 数组
* @param array $files URL 数组(选填)
* @param string $remark
* @param array $links 交付链接数组(选填:Git仓库/网盘等持久获取方式)
* @return mixed
* @throws \Exception
*/
public static function createDemandDelivery($order_no, $order_goods_spu_id, $demand_id, array $images, array $files, $remark = '')
public static function createDemandDelivery($order_no, $order_goods_spu_id, $demand_id, array $images, array $files, $remark = '', array $links = [])
{
// 复用模型的规范化方法,统一为英文逗号分隔字符串
$imagesStr = OrderShips::toUrlString($images);
$filesStr = OrderShips::toUrlString($files);
if (mb_strlen($imagesStr) > 1000 || mb_strlen($filesStr) > 1000) {
$linksStr = OrderShips::toUrlString($links);
if (mb_strlen($imagesStr) > 1000 || mb_strlen($filesStr) > 1000 || mb_strlen($linksStr) > 1000) {
exception('附件数量过多或链接过长,请精简后重新发货');
}
$data = [
@@ -63,6 +67,7 @@ class OrderShipService
'demand_id' => $demand_id,
'images' => $imagesStr,
'files' => $filesStr,
'deliver_links' => $linksStr,
'remark' => $remark,
];
$res = self::create($data);
@@ -99,6 +104,7 @@ class OrderShipService
return [
'images' => $ship->images_list,
'files' => $ship->files_list,
'links' => $ship->deliver_links_list,
'remark' => $ship->remark,
'delivery_time' => $ship->createtime,
];