예제 #1
0
 public function isBarcodeAmongAllProducts()
 {
     //if( strtolower($this->barcodeid) === 'empty'){	return true; }
     if (strtolower($this->barcodeid) === 'empty') {
         $this->barcodeid = '';
         return true;
     }
     $prd = Static::where('barcodeid', $this->barcodeid)->first();
     //dd($prd);
     return $prd === null ? true : false;
 }
예제 #2
0
 function getDescendantAttribute()
 {
     return Static::where($this->getPathField(), 'not like', $this->attributes[$this->getPathField()] . Static::getDelimiter() . '%');
 }
예제 #3
0
 /**
  * Get Files by an array of keywords
  *
  * @param array   $search
  * @param integer $limit
  *
  * @return void
  */
 public static function findByKeywords($search, $limit = 5)
 {
     // first we search folders
     Static::select('name', 'parent_id');
     foreach ($search as $match) {
         $match = trim($match);
         Static::where(function ($query) {
             $query->orWhere('name', 'like', $match);
             $query->orWhere('location', 'like', $match);
             $query->orWhere('remote_container', 'like', $match);
         });
     }
     return static::take($limit)->get();
 }