作者 何书鹏
1 个管道 的构建 通过 耗费 25 秒

bug修改

... ... @@ -61,8 +61,16 @@ class Contract extends Controller
}
}));
// 销售代表
$tmp->setValue('saler_realname', $contract->saler->realname);
$tmp->setValue('saler_mobile', $contract->saler->mobile);
if(!empty($order['saler_realname'])){
$saler_realname = $order['saler_realname'];
$saler_mobile = $order['saler_mobile'];
}else{
$saler = $contract->saler;
$saler_realname = $saler['realname'];
$saler_mobile = $saler['mobile'];
}
$tmp->setValue('saler_realname', $saler_realname);
$tmp->setValue('saler_mobile', $saler_mobile);
// 生成文件
$dir = 'uploads/contract';
if (!file_exists($dir)) {
... ... @@ -136,8 +144,16 @@ class Contract extends Controller
}
}));
// 销售代表
$tmp->setValue('saler_realname', $contract->saler->realname);
$tmp->setValue('saler_mobile', $contract->saler->mobile);
if(!empty($order['saler_realname'])){
$saler_realname = $order['saler_realname'];
$saler_mobile = $order['saler_mobile'];
}else{
$saler = $contract->saler;
$saler_realname = $saler['realname'];
$saler_mobile = $saler['mobile'];
}
$tmp->setValue('saler_realname', $saler_realname);
$tmp->setValue('saler_mobile', $saler_mobile);
// 生成文件
$url = 'uploads/contract/download_contract.docx';
$tmp->saveAs($url);//另存为
... ...