<?php
/** 账号中心
 * @Copyright (C) 2016 汉潮 All rights reserved.
 * @License http://www.hanchao9999.com
 * @Author zhaoh <zhaoh@qq.com>
 */

namespace Supplier\Model;
use Think\Model;
class AccountModel extends Model{
	protected $tableName = 'supplierbalance_log';
	/**
	 * 供货商日志
	 * @param $postdata mixed
	 * @return  mixed  
	*/
    public function action_list($post){
		$suppliers_info=session('suppliers_info');
		$map['user_id']=$suppliers_info['id'];
		$map['model']='Supplier';
		$field=true;
		$page_num=$post['page_num']?$post['page_num']:10;
		
		//搜索条件
		if(!empty($post['time_form'])){$map['create_time'][]=array('egt',strtotime($post['time_form']));}
		if(!empty($post['time_to'])){$map['create_time'][]=array('elt',strtotime($post['time_to']));}
		if(!empty($post['action_id'])){$map['action_id']=$post['action_id'];}
		
		$list=page_list('ActionLog',$map,'id desc',$field,$page_num,'',1);
		return $list;
    }
	/**
	 * 结算信息列表
	 * @param $postdata mixed
	 * @return  mixed  
	*/
    public function account_list($post){
		/*$supplier_info=session('suppliers_info');
		$map['suppliers_id']=$supplier_info['id'];
		$field=true;
		$page_num=$post['page_num']?$post['page_num']:10;
		
		//搜索条件
		if(!empty($post['time_form'])){$map['change_time'][]=array('egt',strtotime($post['time_form']));}
		if(!empty($post['time_to'])){$map['change_time'][]=array('elt',strtotime($post['time_to']));}
		if(!empty($post['order_sn'])){$map['order_id']=idtoname($post['order_sn'],'OrderInfo','id','order_sn');}
		if(!empty($post['type'])){$map['type']=$post['type'];}
		$list=page_list('SupplierbalanceLog',$map,'id desc',$field,$page_num,'',1);
		return $list;*/
    }
}

?>