12345678910111213141516171819202122232425262728 |
- <?php
- namespace app\admin\model;
- use think\Model;
- /**
- * SupplierGrossprofit
- */
- class SupplierGrossprofit extends Model
- {
- // 表名
- protected $name = 'supplier_grossprofit';
- // 自动写入时间戳字段
- protected $autoWriteTimestamp = true;
- public function getRatioAttr($value): float
- {
- return (float)$value;
- }
- public function supplier()
- {
- return $this->belongsTo(\app\admin\model\Supplier::class, 'supplier_id', 'id');
- }
- }
|