123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- <?php
- namespace app\cxinv\model;
- class PayInfo extends Base
- {
- //设置字段信息
- protected $schema = [
- 'id' =>'bigint',//
- 'cgdNo' =>'varchar',//采购单单号
- 'total_fee' =>'decimal',//采购单总金额
- 'apay_fee' =>'decimal',//已付金额
- 'wpay_fee' =>'decimal',//未付金额
- 'winv_fee' =>'decimal',//未开票金额
- 'ainv_fee' =>'decimal',//已开票金额
- 'payNo' =>'varchar',//付款编号
- 'status' =>'tinyint',//状态 正常1 解除0
- 'is_del' =>'tinyint',//是否删除
- 'addtime' =>'datetime',//
- 'updatetime' =>'datetime',//
- ];
- protected $createTime = 'addtime';
- protected $updateTime = 'updatetime';
- public static function CheckCgd($cgdNo,&$data){
- $payinfo=self::where(['cgdNo'=>$cgdNo,'status'=>1,'is_del'=>0])->findOrEmpty();
- if(!$payinfo->isEmpty()){
- $pay = Pay::where('payNo', $payinfo->payNo)->findOrEmpty();
- $data[]=['type'=>'采购对账单','username'=>$pay->apply_name,'orderCode'=>$pay->payNo,'companyName'=>$pay->companyName];
- $hp = PayInvoice::where(['payNo'=>$pay->payNo,'is_del'=>0,'status'=>[1,2,3,4]])
- ->column('hpNo,apply_name');
- if(!empty($hp)){
- foreach ($hp as $item){
- $data[]=['type'=>'采购对账单回票','username'=> $item['apply_name'],'orderCode'=>$item['hpNo'],'companyName'=>$pay->companyName];
- }
- }
- $paydz = PayPayment::where(['payNo'=>$pay->payNo,'is_del'=>0,'status'=>[1,2,3,4]])
- ->column('dzNo,apply_name');
- if(!empty($paydz)){
- foreach ($paydz as $item){
- $data[]=['type'=>'采购对账单付款','username'=> $item['apply_name'],'orderCode'=>$item['dzNo'],'companyName'=>$pay->companyName];
- }
- }
- }
- }
- }
|