ProductOnlog.php 1.0 KB

123456789101112131415161718192021222324252627282930
  1. <?php
  2. namespace app\cxinv\model;
  3. class ProductOnlog extends Base
  4. {
  5. //设置字段信息
  6. protected $schema = [
  7. 'id' =>'bigint',//
  8. "type"=>'tinyint',// 1入账 2 出账 3 盘盈 4盘亏 5计提入库 6计提出库 7 取消数据入库 8 取消数据出库
  9. 'order_item_id' =>'bigint',//关联明细采购单id 盘点id
  10. 'product_id' =>'bigint',//商品id
  11. 'first_on_time' =>'datetime',//第一次入账
  12. 'on_time' =>'datetime',//入账时间
  13. "fz_date"=>'varchar',
  14. 'num' =>'decimal',//入账数量
  15. 'unit_price' =>'decimal',//单价
  16. 'rate' =>'varchar',//税率
  17. 'apply_id' =>'int',//
  18. 'apply_name' =>'varchar',//
  19. 'create_time' =>'datetime',//
  20. ];
  21. protected $createTime = 'create_time';
  22. public function Product(){
  23. return $this->belongsTo(FinancialProducts::class,'product_id','id')->bind(['goodName','skuCode']);
  24. }
  25. public function OrderItem(){
  26. return $this->belongsTo(FinancialManager::class,'order_item_id','id');
  27. }
  28. }