...
|
...
|
@@ -48,26 +48,37 @@ class Order extends Backend |
|
|
$id = $this->request->param('ids');
|
|
|
$time = Db::name('order')
|
|
|
->where('id',$id)
|
|
|
->field('createtime')
|
|
|
->field('pic_id,video_id,createtime,num')
|
|
|
->find();
|
|
|
$createtime = date('Y-m-d H:i:s',$time['createtime']);
|
|
|
$shou = Db::name('shou')
|
|
|
->whereLike('order_id',"%$id%")
|
|
|
->select();
|
|
|
foreach ($shou as &$v){
|
|
|
$v['order_id'] = explode(',',$v['order_id']);
|
|
|
if(in_array($id,$v['order_id'])){
|
|
|
|
|
|
}
|
|
|
}
|
|
|
$num = Db::name('order')->where('id',$data['order_id'])->field('num')->find();
|
|
|
if(!empty($data['pic_id'])){
|
|
|
$number = Db::name('pic')->where('id',$data['pic_id'])->field('number')->find();
|
|
|
$this->test_pdf($data['name'],$data['use'],$data['tel'],$number['number'],$num['num'],$createtime);
|
|
|
if(!empty($time['pic_id'])){
|
|
|
$pic_id = explode(',',$time['pic_id']);
|
|
|
$v['pic_num'] = Db::name('pic')
|
|
|
->whereIn('id',$pic_id)
|
|
|
->column('number');
|
|
|
//拼接所有素材的唯一编号
|
|
|
$str = '';
|
|
|
$pic_str = implode(',',$v['pic_num']);
|
|
|
$str .= $pic_str.',';
|
|
|
$this->test_pdf($shou[0]['name'],$shou[0]['use'],$shou[0]['tel'],$str,$time['num'],$createtime);
|
|
|
}
|
|
|
if(!empty($data['video_id'])){
|
|
|
$number = Db::name('video')->where('id',$data['video_id'])->field('number')->find();
|
|
|
$this->test_pdf($data['name'],$data['use'],$data['tel'],$number['number'],$num['num'],$createtime);
|
|
|
if(!empty($time['video_id'])){
|
|
|
$video_id = unserialize($time['video_id']);
|
|
|
$v_id = array_column($video_id,'id');
|
|
|
$v['video_num'] = Db::name('video')
|
|
|
->whereIn('id',$v_id)
|
|
|
->column('number');
|
|
|
//拼接所有素材的唯一编号
|
|
|
$str = '';
|
|
|
$video_str = implode(',',$v['video_num']);
|
|
|
$str .= $video_str.',';
|
|
|
$this->test_pdf($shou['name'],$shou['use'],$shou['tel'],$str,$time['num'],$createtime);
|
|
|
}
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
public function test_pdf($name='',$use='',$tel='',$number='',$order_num='',$time='') {
|
...
|
...
|
|