<?php
/**
 * Created by PhpStorm.
 * User: sicilon_IT
 * Date: 2021/5/1
 * Time: 2:04
 */
namespace app\index\logic;
use app\index\model\paydetailmodel;
use app\index\model\uplogmodel;
use app\index\model\gworkermodel;
class paylogic{

    /*
     * 20210501
     */
    public function savepaydetail($arr){
        $t_p=new paydetailmodel();
        $t_p->insinfo($arr);
    }

    /*
     * 20210502
     */
    public function savepayredetaillist($arr){
        $t_p=new paydetailmodel();
        $rcounts=$t_p->insinfolist($arr);
        return $rcounts;
    }

    /*
     * 20210506
     */
    public function savenewuplog($arr){
        $t_ul=new uplogmodel();
        $id=$t_ul->insinfo($arr);
        return $id;

    }

    /*
     * 20210507
     * 查找是否有相同的文件名，来防止重复
     */
     public function getinfobyfname($arr){
         $fname=$arr['upfilename'];
         $t_ul=new uplogmodel();
         $finfo=$t_ul->selinfobyfname($fname);
         return $finfo;
     }

    /*
     * 202100508
     * 获取某人的支款记录
     */
    public function getpayrecordbyuid($arr){
        $wid=$arr['wid'];
        $t_w=new gworkermodel();
        $winfo=$t_w->getinfobyid($wid);
        $t_p=new paydetailmodel();
        $ulist=array();
        if($winfo){
            $sfz=$winfo['shengfengid'];
            $ulist=$t_p->selinfobysfz($sfz);
        }
        return $ulist;

    }

    /*
     * 20210509
     * 获得所有的导入记录
     */
    public function getalluplog(){
        $t_u=new uplogmodel();
        $rlist=$t_u->selalllist();
        return $rlist;
    }

    /*
     * 20230214
     */
    public function getuplogbycid($arr){
        $cid=$arr['companyid'];
        $t_u=new uplogmodel();
        $rlist=$t_u->sellistbycid($cid);
        return $rlist;
    }
}