protected function getResult() { $re = array(); $record = new QdProduct(); $products = $record->SETRANGE('name', $this->key_word, 'CONTAINS')->SETRANGE('model', $this->key_word, 'CONTAINS')->SETRANGE('xuatxu', $this->key_word, 'CONTAINS')->SETFILTERRELATION('OR')->SETLIMIT($this->limit)->GETLIST(); foreach ($products as $item) { array_push($re, array('name' => $item->name, 'url' => $item->getPermalink())); } return json_encode($re); }
public function fn_validate_all_struct_level($location, $params) { $tmp = new QdProduct(); $re = $tmp->GETLIST(); $count = 0; foreach ($re as $item) { if ($item->save()) { $count++; } } $this->pushValidateError('', 'Total items validated: ' . $count, 'info'); }
public function getProducts() { $obj = new QdProduct(); $obj->SETFILTERDEFAULT(array(array('field' => 'product_cat_id', 'value' => $this->id, 'exact' => true, 'operator' => '='))); return $obj; }