1234567891011121314151617181920212223242526272829303132333435 |
- <?php
- namespace App\Models;
- use Illuminate\Database\Eloquent\Model;
- class StoreGoods extends Model{
- protected $connection = 'mysql_w';
- protected $table='goods';
- protected $guarded = [];
- public function goodSku(){
- return $this->hasMany(StoreGoodsSku::class,'goods_id');
- }
- public function orderDetails(){
- return $this->hasMany(OrderDetailW::class,'goods_id');
- }
- public function getVipPriceAttribute($value){
- return round($value);
- }
- public function getPriceAttribute($value){
- return round($value);
- }
- public function getSuperPriceAttribute($value){
- return round($value);
- }
- public function getTopPriceAttribute($value){
- return round($value);
- }
- public function getCrownPriceAttribute($value){
- return round($value);
- }
- }
|