<?php
// +----------------------------------------------------------------------
// | Yershop 开源网店系统
// +----------------------------------------------------------------------
// | Copyright (c) 2014 http://www.yershop.com All rights reserved.
// +----------------------------------------------------------------------
namespace app\seller\controller;
use think\Controller;
use think\Db;

class CashLog extends Home{
    public function index(){     
        if(isset($_GET['title'])){
            $map['username']  = array('like', '%'.(string)input('title').'%');
        }	
		$map["shop_id"]=get_shop_id();
		$map["status"]=array("egt",0);
        $res=getLists('money',$map,10,'id desc',"");;
	    $this->assign('res', $res);
		$this->meta_title="提现管理";
		$this->assign('meta_title', $this->meta_title);
	    return $this->fetch("CashLog/index"); 
	}
	 public function del(){   
	   $id=input("id");
	    $map[]=['id',"in",$id];
		if(!$map){
			 $this->error("未选择数据！");
		}
		$model= request()->controller();
		$res=db($model)->where($map)->delete();
		
		if($res){
		   addUserLog("del_cart",session_uid());
		   $this->success("删除成功！");
		}else{
	           $this->error("删除失败！");
		}
	}
	
}
