HtmlToText
invalid parameter – yii\base\invalidparamexception operator 'like' requires two operands. 1. in /home/wwwblueu/public_html/vendor/yiisoft/yii2/db/querybuilder.php at line 1206 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 * should be applied. note that when using an escape mapping (or the third operand is not provided), * the values will be automatically enclosed within a pair of percentage characters. * @param array $params the binding parameters to be populated * @return string the generated sql expression * @throws invalidparamexception if wrong number of operands have been given. */ public function buildlikecondition($operator, $operands, &$params) { if (!isset($operands[0], $operands[1])) { throw new invalidparamexception("operator '$operator' requires two operands."); } $escape = isset($operands[2]) ? $operands[2] : ['%' => '\%', '_' => '\_', '\\' => '\\\\']; unset($operands[2]); if (!preg_match('/^(and |or |)(((not |))i?like)/', $operator, $matches)) { throw new invalidparamexception("invalid operator '$operator'."); } $andor = ' ' . (!empty($matches[1]) ? $matches[1] : 'and '); 2. in /home/wwwblueu/public_html/vendor/yiisoft/yii2/db/querybuilder.php at line 924 – yii\db\querybuilder::buildlikecondition ( 'like' , [ 'name' , null ], []) 918 919 920 921 922 923 924 925 926 927 928 929 930 if (isset($this->conditionbuilders[$operator])) { $method = $this->conditionbuilders[$operator]; } else { $method = 'buildsimplecondition'; } array_shift($condition); return $this->$method($operator, $condition, $params); } else { // hash format: 'column1' => 'value1', 'column2' => 'value2', ... return $this->buildhashcondition($condition, $params); } } /** 3. in /home/wwwblueu/public_html/vendor/yiisoft/yii2/db/querybuilder.php at line 743 – yii\db\querybuilder::buildcondition ([ 'like' , 'name' , null ], '[]' ) 737 738 739 740 741 742 743 744 745 746 747 748 749 * @param string|array $condition * @param array $params the binding parameters to be populated * @return string the where clause built from [[query::$where]]. */ public function buildwhere($condition, &$params) { $where = $this->buildcondition($condition, $params); return $where === '' ? '' : 'where ' . $where; } /** * @param array $columns 4. in /home/wwwblueu/public_html/vendor/yiisoft/yii2/db/querybuilder.php at line 96 – yii\db\querybuilder::buildwhere ([ 'like' , 'name' , null ], '<span class="string">'[]'</span>' ) 90 91 92 93 94 95 96 97 98 99 100 101 102 $params = empty($params) ? $query->params : array_merge($params, $query->params); $clauses = [ $this->buildselect($query->select, $params, $query->distinct, $query->selectoption), $this->buildfrom($query->from, $params), $this->buildjoin($query->join, $params), $this->buildwhere($query->where, $params), $this->buildgroupby($query->groupby), $this->buildhaving($query->having, $params), ]; $sql = implode($this->separator, array_filter($clauses)); $sql = $this->buildorderbyandlimit($sql, $query->orderby, $query->limit, $query->offset); 5. in /home/wwwblueu/public_html/vendor/yiisoft/yii2/db/activequery.php at line 324 – yii\db\querybuilder::build ( yii\db\activequery ) 318 319 320 321 322 323 324 325 326 327 328 329 330 $modelclass = $this->modelclass; if ($db === null) { $db = $modelclass::getdb(); } if ($this->sql === null) { list ($sql, $params) = $db->getquerybuilder()->build($this); } else { $sql = $this->sql; $params = $this->params; } return $db->createcommand($sql, $params); 6. in /home/wwwblueu/public_html/vendor/yiisoft/yii2/db/query.php at line 243 – yii\db\activequery::createcommand ( null ) 237 238 239 240 241 242 243 244 245 246 247 248 249 * if this parameter is not given, the `db` application component will be used. * @return array|boolean the first row (in terms of an array) of the query result. false is returned if the query * results in nothing. */ public function one($db = null) { return $this->createcommand($db)->queryone(); } /** * returns the query result as a scalar value. * the value returned will be the first column in the first row of the query results. * @param connection $db the database connection used to generate the sql statement. 7. in /home/wwwblueu/public_html/vendor/yiisoft/yii2/db/activequery.php at line 300 – yii\db\query::one ( null ) 294 295 296 297 298 299 300 301 302 303 304 305 306 * @return activerecord|array|null a single row of query result. depending on the setting of [[asarray]], * the query result may be either an array or an activerecord object. null will be returned * if the query results in nothing. */ public function one($db = null) { $row = parent::one($db); if ($row !== false) { $models = $this->populate([$row]); return reset($models) ?: null; } else { return null; } 8. in /home/wwwblueu/public_html/frontend/controllers/sitecontroller.php at line 222 – yii\db\activequery::one () 216 217 218 219 220 221 222 223 224 225 226 227 228 //find product $products = orderdetail::findall($product); //find promotion if ($promotion != null && !isset($giamgia)) { $giamgia = promotion::find()->where(['code' => $promotion])->one(); } else { $giamgia = product::find()->where(['like','name', $product])->one(); } if ($model->load($post) && model::loadmultiple($products, $post)) { $model->sdt = preg_replace('/[^0-9]/', '', $model->sdt); $session = yii::$app->session; $session->open(); 9. frontend\controllers\sitecontroller::actionview( null , null , null , null ) 10. in /home/wwwblueu/public_html/vendor/yiisoft/yii2/base/inlineaction.php at line 55 – call_user_func_array([ frontend\controllers\sitecontroller , 'actionview' ], [ null , null , null , null ]) 49 50 51 52 53 54 55 56 57 $args = $this->controller->bindactionparams($this, $params); yii::trace('running action: ' . get_class($this->controller) . '::' . $this->actionmethod . '()', __method__); if (yii::$app->requestedparams === null) { yii::$app->requestedparams = $args; } return call_user_func_array([$this->controller, $this->actionmethod], $args); } } 11. in /home/wwwblueu/public_html/vendor/yiisoft/yii2/base/controller.php at line 151 – yii\base\inlineaction::runwithparams ([]) 145 146 147 148 149 150 151 152 153 154 155 156 157 } $result = null; if ($runaction && $this->beforeaction($action)) { // run the action $result = $action->runwithparams($params); $result = $this->afteraction($action, $result); // call afteraction on modules foreach ($modules as $module) { /* @var $module module */ 12. in /home/wwwblueu/public_html/vendor/yiisoft/yii2/base/module.php at line 455 – yii\base\controller::runaction ( 'view' , []) 449 450 451 452 453 454 455 456 457 458 459 460 461 $parts = $this->createcontroller($route); if (is_array($parts)) { /* @var $controller controller */ list($controller, $actionid) = $parts; $oldcontroller = yii::$app->controller; yii::$app->controller = $controller; $result = $controller->runaction($actionid, $params); yii::$app->controller = $oldcontroller; return $result; } else { $id = $this->getuniqueid(); throw new invalidrouteexception('unable to resolve the request "' . ($id === '' ? $route : $id . '/' . $route) . '".'); 13. in /home/wwwblueu/public_html/vendor/yiisoft/yii2/web/application.php at line 84 – yii\base\module::runaction ( 'site/view' , []) 78 79 80 81 82 83 84 85 86 87 88 89 90 $params = $this->catchall; unset($params[0]); } try { yii::trace("route requested: '$route'", __method__); $this->requestedroute = $route; $result = $this->runaction($route, $params); if ($result instanceof response) { return $result; } else { $response = $this->getresponse(); if ($result !== null) { $response->data = $result; 14. in /home/wwwblueu/public_html/vendor/yiisoft/yii2/base/application.php at line 375 – yii\web\application::