StoreGoodsSku.php 430 B

12345678910111213141516171819
  1. <?php
  2. namespace App\Models;
  3. use Illuminate\Database\Eloquent\Model;
  4. use Illuminate\Database\Eloquent\SoftDeletes;
  5. class StoreGoodsSku extends Model{
  6. use SoftDeletes;
  7. protected $connection = 'mysql_w';
  8. protected $table='goods_sku';
  9. public function goods(){
  10. return $this->belongsTo(StoreGoods::class,'goods_id');
  11. }
  12. public function getPriceAttribute($value){
  13. return round($value);
  14. }
  15. }