<item>
<value1='c4ca4238a0b923820dcc509a6f75849b'/>
<value2='c81e728d9d4c2f636f067f89cc14862c'/>
<value3='eccbc87e4b5ce2fe28308fd9f2a7baf3'/>
<value4='a87ff679a2f3e71d9181a67b7542122c'/>
<value5='e4da3b7fbbce2345d7772b0674a318d5'/>
<value6='1679091c5a880faf6fb5e6087eb1b2dc'/>
</item>
public function actionP($category, $brand, $product) {
$model = Product::getBolleanProduct($category, $brand, $product);
if($model['product_id'] &&
$model['category_id'] &&
$model['manufacturer_id'] &&
$product === strtolower($product) &&
$brand === strtolower($brand) &&
$category === strtolower($category)) {
return $this->getProduct($model['product_id'], $category, $brand, $product);
} else {
throw new \yii\web\HttpException(404, '404! Товар не найден');
}
}
$g=$mysqli->query("SELECT authors.f_name, authors.s_name,books.b_name FROM authors
JOIN author_books ON authors.id=author_books.author_id JOIN
books ON books.id=author_books.book_id WHERE authors.f_name='Дмитрий' OR authors.s_name LIKE 'А%' GROUP BY authors.f_name,authors.s_name");
$g=$mysqli->query("SELECT CONCAT(authors.f_name,' ',authors.s_name) as name, books.b_name FROM authors
JOIN author_books ON authors.id=author_books.author_id JOIN
books ON books.id=author_books.book_id WHERE authors.f_name='Дмитрий' OR authors.s_name LIKE 'А%' GROUP BY name");
foreach($result as $v){
echo '<tr>
<td>'.$v['b_name'].'</td>
<td>'.$v["name"].'</td>
</tr> ';
}
SELECT a.*, b.count_book
FROM authors a,
(SELECT author_id, COUNT(book_id) as count_book
FROM author_books GROUP BY author_id
HAVING COUNT(book_id) > 1) b
WHERE a.id = b.author_id
$sql = "SELECT a.*, b.count_book FROM authors a, (SELECT author_id, COUNT(book_id) as count_book FROM author_books GROUP BY author_id HAVING COUNT(book_id) > 1) b WHERE a.id = b.author_id";
$results = $mysqli->query($sql);
foreach($results as $result) {
echo $result['f_name'] . " " . $result['s_name'] . " - " . $result['count_book'] . " книг";
}
//$_POST[POST_NAME][ROW][NAME];
$_POST[POST_NAME][0][NAME];
$_POST[POST_NAME][1][NAME];
$_POST[POST_NAME][2][NAME];
//Далее расфасовуешь
foreach($_POST[POST_NAME] as $query) {
if($model->load($query)) {
$model->save();
}
}
$model->updateAll($model->atributes, 'status = 1');
SELECT
IF(p.price_noch > 0,
IF(TIME(NOW()) > TIME('13:00:00'),
IF(p.price_uah > 0, IF((p.price_noch/k.kurs) < p.price_in, (p.price_in+(p.price_in*0.1))*k.kurs, p.price_noch), p.price_noch*k.kurs),
IF(TIME(NOW()) > TIME('08:00:00'), IF(p.price_uah > 0, IF((p.price_noch/k.kurs) < p.price_in, (p.price_in+(p.price_in*0.1))*k.kurs, p.price_noch) ,p.price_noch*k.kurs),'NULL')
)
, 'NULL') AS price, TIME(NOW()) AS date
FROM `product` p, (SELECT value AS kurs FROM kurs ORDER BY kurs_id DESC LIMIT 1) AS k WHERE 1