MoneyLog.php 677 B

1234567891011121314151617181920212223242526272829303132
  1. <?php
  2. declare(strict_types=1);
  3. namespace app\common\model;
  4. use think\Model;
  5. class MoneyLog Extends Model
  6. {
  7. // 自动写入时间戳字段
  8. protected $autoWriteTimestamp = true;
  9. protected $createTime = 'createtime';
  10. protected $updateTime = 'updatetime';
  11. protected $type = [
  12. 'createtime' => 'timestamp:Y-m-d H:i',
  13. 'updatetime' => 'timestamp:Y-m-d H:i',
  14. ];
  15. //
  16. public function users()
  17. {
  18. return $this->hasOne(User::class,'id','user_id')->field('id,nickname');
  19. }
  20. public function stockconfig()
  21. {
  22. return $this->hasOne(StockConfig::class,'id','variety_id')->field('id,title');
  23. }
  24. }