|
@@ -239,9 +239,6 @@ function setword($type,$id){
|
|
|
->with(['merchant','items','ppoffer','ppoffer.user'])
|
|
|
->lock(true)
|
|
|
->findOrEmpty($id);
|
|
|
- dump($info->toArray());
|
|
|
- echo count($info['items']);die;
|
|
|
- die;
|
|
|
$array = [
|
|
|
'order_no'=>$info['order_no'],
|
|
|
'date'=>date('Y-m-d',strtotime($info['post_time'])),
|
|
@@ -250,16 +247,20 @@ function setword($type,$id){
|
|
|
'mfphone'=>$info['merchant']['contact_phone'],
|
|
|
'mmfname'=>$info['ppoffer']['user']['nickname'],
|
|
|
'mmfphone'=>$info['ppoffer']['user']['phone'],
|
|
|
- 'id'=>1,
|
|
|
- 'name'=>$info['name'],
|
|
|
- 'gg'=>$info['spec'],
|
|
|
- 'num'=>$info['number'],
|
|
|
- 'price'=>$info['price'],
|
|
|
- 'allprice'=>$allprice,
|
|
|
- 'dxprice'=>num_to_rmb($allprice),
|
|
|
- 'toprice'=>$allprice,
|
|
|
- 'sprice'=>$info['ppoffer']['amount']
|
|
|
+ 'price'=>$info['ppoffer']['amount']
|
|
|
];
|
|
|
+ $templateProcessor->setValues($array);
|
|
|
+ $count = count($info['items']);
|
|
|
+ $templateProcessor->cloneRow('id',$count);
|
|
|
+ foreach ($info['items'] as $k=>$v){
|
|
|
+ $templateProcessor->setValue('id#'.($k+1), ($k+1));
|
|
|
+ $templateProcessor->setValue('name#'.($k+1),$v['name']);
|
|
|
+ $templateProcessor->setValue('gg#'.($k+1), $v['spec']);
|
|
|
+ $templateProcessor->setValue('num#'.($k+1), $v['number']);
|
|
|
+ }
|
|
|
+ $name = 'scdd-'.$id.'-'.time().'.docx';
|
|
|
+ $url = 'http://'.$_SERVER['SERVER_NAME']."/down/".$name;
|
|
|
+ $templateProcessor->saveAs($dir2.$name);
|
|
|
break;
|
|
|
case 4: //外协订单
|
|
|
break;
|