添加开发者发货功能

This commit is contained in:
Dev
2026-09-30 14:56:56 +08:00
parent f13a5e682a
commit bc17810445
14 changed files with 768 additions and 4 deletions
@@ -35,4 +35,38 @@ class OrderShipService
return $res;
}
/**
* 需求交付发货单(开发者发货:凭证截图+交付附件+备注)
* @param $order_no
* @param $order_goods_spu_id
* @param $demand_id
* @param array $images
* @param array $files
* @param string $remark
* @return mixed
* @throws \Exception
*/
public static function createDemandDelivery($order_no, $order_goods_spu_id, $demand_id, array $images, array $files, $remark = '')
{
$imagesStr = json_encode($images, JSON_UNESCAPED_UNICODE);
$filesStr = json_encode($files, JSON_UNESCAPED_UNICODE);
if (mb_strlen($imagesStr) > 1000 || mb_strlen($filesStr) > 1000) {
exception('附件内容过多,请精简后重新发货');
}
$data = [
'order_no' => $order_no,
'order_goods_spu_id' => $order_goods_spu_id,
'demand_id' => $demand_id,
'images' => $imagesStr,
'files' => $filesStr,
'remark' => $remark,
];
$res = self::create($data);
if (!$res) {
exception('创建发货单数据失败');
}
return $res;
}
}