123456789101112131415161718192021222324252627282930313233343536373839 |
- <?php
- declare (strict_types = 1);
- namespace app\admin\model;
- use think\Model;
- /**
- * @mixin \think\Model
- */
- class PayInfo extends Model
- {
- protected $createTime='addtime';
- protected $updateTime='updatetime';
- public function Comon(){
- return $this->belongsTo(ComonOrder::class,"cgdNo","cgdNo");
- }
- 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];
- }
- }
- }
- }
- }
|