InvoicePool.php 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. <?php
  2. namespace app\cxinv\model;
  3. class InvoicePool extends Base
  4. {
  5. //设置字段信息
  6. protected $schema = [
  7. 'id' =>'bigint',//
  8. 'invNo' =>'varchar',//发票编码
  9. 'inv_value' =>'decimal',//发票面值
  10. 'inv_out' =>'varchar',//发票售方
  11. 'inv_company' =>'varchar',//发票售方名称
  12. 'apply_id' =>'bigint',//申请人id
  13. 'apply_name' =>'varchar',//申请人名称
  14. 'inv_type' =>'varchar',//发票类型
  15. // "special"=>"增值税专用发票",
  16. // "normal"=>"增值税普通发票",
  17. // "roll"=>"增值税普通发票(卷式)",
  18. // "special_electronic"=>"增值税电子专用发票",
  19. // "electronic"=>"增值税电子普通发票",
  20. // "toll"=>"增值税电子普通发票(通行费)",
  21. // "fully_digitalized_special_electronic"=>"全电专用发票",
  22. // "fully_digitalized_normal_electronic"=>"全电普通发票",
  23. 'open_type' =>'tinyint',//开票类型 1金税开票 2金税线下 3纯线下
  24. 'company_type' =>'varchar',//买方账户类型01 企业,02 机关事业单位,03 个人, 04 其他
  25. 'platform_type' =>'tinyint',//0 无属性 1 ToB 2 ToC
  26. 'is_ticket' =>'tinyint',//是否支持金税开票
  27. 'is_comon' =>'tinyint',//是否通用订单0/11
  28. 'seller_check' =>'tinyint',//销售方验证
  29. 'buyer_check' =>'tinyint',//购买方验证
  30. 'exam_remark' =>'varchar',//审核备注
  31. 'remark' =>'varchar',//备注
  32. 'check_remark' =>'varchar',//校验备注
  33. 'email' =>'varchar',//邮箱
  34. 'winv_fee' =>'decimal',//未核销
  35. 'ainv_fee' =>'decimal',//已核销
  36. 'post_fee' =>'decimal',//物流费用
  37. 'post_code' =>'varchar',//物流编号
  38. 'post_company' =>'varchar',//物流公司
  39. 'tag_id' =>'int',//标签id
  40. 'status' =>'int',//1财务审核通过 2 待财务上传发票 3 金税开票中/验票中 4 开票成功 5 开票失败 6发票退票/废弃 7取消申请 8 财务驳回 9验票失败
  41. 'is_del' =>'tinyint',//
  42. 'addtime' =>'datetime',//
  43. 'updatetime' =>'datetime',//
  44. ];
  45. protected $createTime = 'addtime';
  46. protected $updateTime = 'updatetime';
  47. public function PoolInfo()
  48. {
  49. return $this->hasOne(InvoicePoolInfo::class,'invNo','invNo');
  50. }
  51. public function InvoiceGood()
  52. {
  53. return $this->hasMany(InvoiceGood::class,'invNo','invNo')->where([['is_del','=',0],['goodNum','>',0]])->order('id asc');
  54. }
  55. public function Assoc(){
  56. return $this->hasMany(Assoc::class,'viceCode','invNo')->where([['is_del','=',0]])->order('id asc');
  57. }
  58. }