Преглед изворни кода

库存盘点,商品条码换行问题

haozi пре 5 година
родитељ
комит
d8174f5ca3
1 измењених фајлова са 3 додато и 0 уклоњено
  1. 3 0
      app/CommodityBarcode.php

+ 3 - 0
app/CommodityBarcode.php

@@ -14,6 +14,9 @@ class CommodityBarcode extends Model
     use ModelTimeFormat;
     use ModelTimeFormat;
     protected $fillable=['code','commodity_id','created_at'];
     protected $fillable=['code','commodity_id','created_at'];
 
 
+    public function getCodeAttribute($value){
+        return str_replace(array("\r\n","\n","\r","\"","""),' ',$value);
+    }
     public function commodity(){
     public function commodity(){
         return $this->belongsTo('App\Commodity','commodity_id','id');
         return $this->belongsTo('App\Commodity','commodity_id','id');
     }
     }