소스 검색

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

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;
     protected $fillable=['code','commodity_id','created_at'];
 
+    public function getCodeAttribute($value){
+        return str_replace(array("\r\n","\n","\r","\"","""),' ',$value);
+    }
     public function commodity(){
         return $this->belongsTo('App\Commodity','commodity_id','id');
     }