调整备货单pdf
This commit is contained in:
@@ -27,14 +27,21 @@ class PurchaseOrdersController extends BaseController
|
||||
{
|
||||
if (isset($data['records']) && count($data['records']) > 0) {
|
||||
foreach ($data['records'] as &$record) {
|
||||
$contractFile = $record['contract_file'] ? explode(',', $record['contract_file']) : [];
|
||||
$contractFileUrl = [];
|
||||
if (count($contractFile) > 0) {
|
||||
foreach ($contractFile as $file) {
|
||||
$contractFileUrl[] = (new \app\common\service\OssService)->generatePrivateUrl($file);
|
||||
}
|
||||
}
|
||||
$result = [
|
||||
'id' => $record['id'],
|
||||
'po_no' => $record['po_no'],
|
||||
'pi_no' => $record['pi_no'],
|
||||
'buyer_id' => $record['buyer_id'],
|
||||
'buyer_name' => $record['buyer_name'],
|
||||
'contract_file' => $record['contract_file'],
|
||||
'contract_file_url' => $record['contract_file'] ? (new \app\common\service\OssService)->generatePrivateUrl($data['contract_file']) : '',
|
||||
'contract_file' => $contractFile,
|
||||
'contract_file_url' => $contractFileUrl,
|
||||
'status' => $record['status'],
|
||||
'remark' => $record['remark'],
|
||||
'created_at' => date('Y-m-d H:i:s', strtotime($record['created_at'])),
|
||||
@@ -55,14 +62,21 @@ class PurchaseOrdersController extends BaseController
|
||||
*/
|
||||
protected function showFormat($data)
|
||||
{
|
||||
$contractFile = $data['contract_file'] ? explode(',', $data['contract_file']) : [];
|
||||
$contractFileUrl = [];
|
||||
if (count($contractFile) > 0) {
|
||||
foreach ($contractFile as $file) {
|
||||
$contractFileUrl[] = (new \app\common\service\OssService)->generatePrivateUrl($file);
|
||||
}
|
||||
}
|
||||
$result = [
|
||||
'id' => $data['id'],
|
||||
'po_no' => $data['po_no'],
|
||||
'pi_no' => $data['pi_no'],
|
||||
'buyer_id' => $data['buyer_id'],
|
||||
'buyer_name' => $data['buyer_name'],
|
||||
'contract_file' => $data['contract_file'],
|
||||
'contract_file_url' => $data['contract_file'] ? (new \app\common\service\OssService)->generatePrivateUrl($data['contract_file']) : '',
|
||||
'contract_file' => $contractFile,
|
||||
'contract_file_url' => $contractFileUrl,
|
||||
'status' => $data['status'],
|
||||
'remark' => $data['remark']
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user