<?php
/** 退货退款
 * @Copyright (C) 2017 汉潮 All rights reserved.
 * @License http://www.hanchao9999.com
 * @Author zhaoh <zhaoh@qq.com>
 */

namespace Supplier\Model;
use Think\Model;
class ReturnGoodsModel extends Model{
	/**
	 * 退货列表
	 * @param $postdata mixed
	 * @return  mixed  
	*/
    public function return_list($page_num){
		$supplier_info=session('suppliers_info');
		$map['shop_id']=$supplier_info['id'];
		$map['type']=1;
		$page_num=$page_num?$page_num:10;
		$list=page_list('ReturnGoods',$map,'id desc',true,$page_num,'',1);
		if($list['list']){
			foreach($list['list'] as $k=>$v){
				$goods_info=unserialize($v['goods_info']);
				foreach($goods_info as $ke=>$vo){
					$goods_info[$ke]['img']=idtoname($vo['goods_id'],'Goods','img');
					$goods_info[$ke]['name']=idtoname($vo['goods_id'],'Goods','goods_name');
				}
				$list['list'][$k]['goods_info']=$goods_info;
			}
		}
		return $list;
    }
	/**
	 * 退款列表
	 * @param $postdata mixed
	 * @return  mixed  
	*/
    public function refund_list($page_num){
		$supplier_info=session('suppliers_info');
		$map['shop_id']=$supplier_info['id'];
		$map['type']=1;
		$page_num=$page_num?$page_num:10;
		$list=page_list('refund_order',$map,'id desc',true,$page_num,'',1);
		return $list;
    }
	
}

?>