footer .check-selectors, footer .radio-selectors{
display: block;
margin-top: 2%;
}
footer .check-selectors .title-form, footer .radio-selectors .title-form{
font-size: 70%;
}
footer .check-selectors div, footer .radio-selectors div{
font-size: 90%;
margin-top: 2px;
}
footer .check-selectors div input, footer .radio-selectors div input{
top: 13%;
position: relative;
}
footer .check-selectors div span, .objects-adding-search > footer .radio-selectors div span{
padding-left: 2px;
}
footer .check-selectors div input,
footer .radio-selectors div input {
position: absolute;
left: -9999px;
}
footer .check-selectors div input + span,
footer .radio-selectors div input + span {
display: inline-block;
position: relative;
padding-left: 28px;
line-height: 20px;
cursor: pointer;
}
footer .check-selectors div input + span:before,
footer .radio-selectors div input + span:before {
content: "";
position: absolute;
left: 0px;
top: 0px;
width: 18px;
height: 18px;
border: 1px solid darkgray;
background-color: darkgray;
}
footer .check-selectors div input + span:before {
border-radius: 2px;
}
footer .radio-selectors div input + span:before {
border-radius: 100%;
}
footer .check-selectors div input + span:after,
footer .radio-selectors div input + span:after {
content: "";
position: absolute;
-webkit-transition: all 0.2s ease;
-moz-transition: all 0.2s ease;
-o-transition: all 0.2s ease;
transition: all 0.2s ease;
}
footer .check-selectors div input:checked + span:after{
left: 3px;
top: 4px;
width: 10px;
height: 5px;
border-radius: 1px;
border-left: 4px solid dodgerblue;
border-bottom: 4px solid dodgerblue;
-webkit-transform: rotate(-45deg);
-moz-transform: rotate(-45deg);
-o-transform: rotate(-45deg);
-ms-transform: rotate(-45deg);
transform: rotate(-45deg);
}
footer .radio-selectors div input:checked + span:after{
left: 5px;
top: 5px;
width: 10px;
height: 10px;
border-radius: 100%;
background-color: dodgerblue;
}
footer .check-selectors div input + span:after,
footer .radio-selectors div input + span:after {
opacity: 0;
}
footer .check-selectors div input:checked + span:after,
footer .radio-selectors div input:checked + span:after {
opacity: 1;
}
@media all and (min-width: 320px) and (max-width: 1280px){
.channels{
float:right;
}
.channels > span{
display:none;
}
}
@media all and (min-width: 320px) and (min-width: 400px){
section.right{
width:106%;
margin-right:-16%;
}
#update-action{
padding-right:16%;
}
section.left{
margin-left:-7%;
}
#Action_bar .wpml-languages{
margin-left:-3px;
}
.channels{
margin-right:6%;
}
}
@media all and (min-width: 400px) and (min-width: 480px){
section.right{
width:106%;
margin-right:-35%;
}
#update-action{
padding-right:30%;
}
section.left{
margin-left:-23%;
}
#Action_bar .wpml-languages{
margin-left:-3px;
}
.channels{
margin-right:29%;
}
}
@media all and (min-width: 480px) and (min-width: 540px){
section.right{
width:106%;
margin-right:-28%;
}
#update-action{
padding-right:30%;
}
section.left{
margin-left:-15%;
}
#Action_bar .wpml-languages{
margin-left:-3px;
}
.channels{
margin-right:6%;
}
}
@media all and (min-width: 540px) and (min-width: 720px){
section.right{
width:106%;
margin-right:-26%;
}
#update-action{
padding-right:30%;
}
section.left{
margin-left:-15%;
}
#Action_bar .wpml-languages{
margin-left:-3px;
}
.channels{
margin-right:6%;
}
}
@media all and (min-width: 720px) and (min-width: 960px){
section.right{
width:106%;
margin-right:-48%;
}
#update-action{
padding-right:45%;
}
section.left{
margin-left:-41%;
}
#Action_bar .wpml-languages{
margin-left:-3px;
}
.channels{
margin-right:6%;
}
}
@media all and (min-width: 960px) and (min-width: 1280px){
section.right{
width:106%;
margin-right:-7%;
}
#update-action{
padding-right:45%;
}
section.left{
margin-left:1%;
}
#Action_bar .wpml-languages{
margin-left:-3px;
}
.channels{
margin-right:6%;
}
}
@media all and (min-width: 320px) and (max-width: 720px){
.desktop-menu{
margin-left:0;
text-align:center;
}
}
@media all and (min-width: 720px) and (max-width: 960px){
.desktop-menu{
margin-left:1%;
width:100%;
margin-top:13%;
text-align:center;
}
.information-right{
width:62%;
margin-top:2%;
}
}
@media all and (min-width:960px) and (max-width: 1280px){
.desktop-menu{
margin-left:1%;
width:77%;
margin-top:8%;
}
.information-right{
width:22%;
margin-top:2%;
position:realtive;
left:5%;
}
}
@media all and (min-width: 320px) and (max-width: 400px){
.information-right{
padding-bottom:10%;
margin-right:-3%;
font-size:133%;
}
.information-right > form{
margin-top:5%;
}
.information-right > form #findquery{
font-size:155%;
background-size:12%;
text-indent:16%;
}
}
@media all and (min-width: 400px) and (max-width: 480px){
.information-right{
padding-bottom:10%;
margin-top:5%;
margin-right:-11%;
font-size:145%;
}
.information-right > .contacts .phone{
padding-bottom:5%;
}
.information-right > form{
margin-top:5%;
}
.information-right > form #findquery{
font-size:155%;
background-size:10%;
text-indent:12%;
}
}
@media all and (min-width: 480px) and (max-width: 540px){
.information-right{
padding-bottom:10%;
margin-top:5%;
margin-right:3%;
font-size:145%;
}
.information-right > .contacts .phone{
padding-bottom:5%;
}
.information-right > form{
margin-top:5%;
}
.information-right > form #findquery{
font-size:155%;
background-size:7%;
text-indent:10%;
}
}
@media all and (min-width: 540px) and (max-width: 720px){
.information-right{
padding-bottom:10%;
margin-top:5%;
margin-right:-4%;
font-size:145%;
}
.information-right > .contacts .phone{
padding-bottom:5%;
}
.information-right > form{
margin-top:5%;
}
.information-right > form #findquery{
font-size:155%;
background-size:7%;
text-indent:10%;
}
}
@media all and (min-width: 720px) and (max-width: 960px){
.information-right{
padding-bottom:10%;
margin-top:5%;
margin-right:-25%;
font-size:160%;
}
.information-right > .contacts .phone{
padding-bottom:5%;
}
.information-right > form{
margin-top:5%;
}
.information-right > form #findquery{
font-size:155%;
background-size:7%;
text-indent:10%;
}
}
@media all and (min-width: 960px) and (max-width: 1280px){
.information-right{
padding-bottom:10%;
margin-top:5%;
margin-right:3%;
font-size:145%;
}
.information-right > .contacts .phone{
padding-bottom:5%;
}
.information-right > form{
margin-top:5%;
}
.information-right > form #findquery{
font-size:155%;
background-size:7%;
text-indent:10%;
}
}
@media all and (min-width: 1280px) and (max-width: 1400px){
.information-right{
margin-top:1%;
margin-right:-8%;
font-size:130%;
}
.information-right > .contacts .phone{
padding-bottom:5%;
}
.information-right > form{
margin-top:5%;
}
.information-right > form #findquery{
font-size:155%;
background-size:7%;
text-indent:10%;
}
}
<b>Fatal error: Uncaught Error: </b>Call to a member function fetch_assoc() on bool in C:\xampp\htdocs\aplex\mahash\action.php:1036 Stack trace: #0 C:\xampp\htdocs\aplex\mahash\product.php(7): all_function->get_singleproduct_special('183', true) #1 {main} thrown in C:\xampp\htdocs\aplex\mahash\action.php on line 1036
public function get_singleproduct_special($service, $onlyVisible = false)
{
$services = array();
$query="SELECT cp.*, dcc.*, ssc.discount, (SELECT sse.product_id FROM special_stock_exclude sse WHERE sse.stock_id = ssc.stock_id AND sse.product_id = cp.prod_id LIMIT 1) AS exclude FROM cosmetic_product cp
LEFT JOIN cosmetic_brand dcc on dcc.category_id = cp.category_id
LEFT JOIN special_stock_category ssc ON ssc.category_id = dcc.category_id
WHERE cp.prod_id='".$service."'
AND cp.show_type < 2";
if($onlyVisible) {
$query .= " AND ct.type != 2";
}
$execute = $this->connect->query($query);
var_dump($execute);
//$slider= $execute->fetch_assoc();
while($service= $execute->fetch_assoc())
{
if(!$service['prod_special_status'] && $service['discount'] && !$service['exclude']) {
$price = calcDiscount($service['prod_price'], $service['discount']);
$service['prod_special_price'] = $service['prod_price'];
$service['prod_price'] = $price;
$service['prod_special_status'] = 1;
}
if(!empty($_SESSION['user_subscribed']) && $service['subscribe_price'] && $service['subscribe_price'] < $service['prod_price']) {
$service['prod_price'] = $service['subscribe_price'];
}
$services[]=$service;
}
// print_r($services);
return $services;
}
$service = (!$_SESSION['special_stock'] ? $funObj->get_singleproduct($productId, true) : FALSE)[0];
bool(false)
и в Интернете сложновато приходилось искать решение проблемы. А вы сами хорошо знаете, как правильно выборку реализовывать? Чего-то не хватает? import ast
import json
nmq = input()
nm = nmq.split(" ")
n = int(nm[0])
m = int(nm[1])
feedqueres = []
feedform = {}
feed = {}
for i in range(n):
feeddata = str(input())
feedqueres.append(feeddata)
feedform.update({'offers':{}})
for i in range(len(feedqueres)):
data = json.loads(feedqueres[i])
feedform['offers'].update(ast.literal_eval(data['offers']))
feed.update({'offers':{}})
for i in range(m):
readydata = feedform['offers'][i]
feed['offers'].update(ast.literal_eval(readydata))
print(json.dumps(feed))
Traceback (most recent call last):
File "main.py", line 24, in <module>
feedform['offers'].update(ast.literal_eval(data['offers']))
File "/usr/lib/python3.8/ast.py", line 99, in literal_eval
return _convert(node_or_string)
File "/usr/lib/python3.8/ast.py", line 98, in _convert
return _convert_signed_num(node)
File "/usr/lib/python3.8/ast.py", line 75, in _convert_signed_num
return _convert_num(node)
File "/usr/lib/python3.8/ast.py", line 66, in _convert_num
_raise_malformed_node(node)
File "/usr/lib/python3.8/ast.py", line 63, in _raise_malformed_node
raise ValueError(f'malformed node or string: {node!r}')
ValueError: malformed node or string: [{'offer_id': 'offer1', 'market_sku': 10846332, 'price': 1490}, {'offer_id': 'offer2', 'market_sku': 682644, 'price': 499}]
2 3
{"offers": [{"offer_id": "offer1", "market_sku": 10846332, "price": 1490}, {"offer_id": "offer2", "market_sku": 682644, "price": 499}]}
{"offers": [{"offer_id": "offer3", "market_sku": 832784, "price": 14000}, {"offer_id": "offer4", "market_sku": 3234, "price": 100}]}
{"offers":[{"market_sku":10846332,"offer_id":"offer1","price":1490},{"market_sku":682644,"offer_id":"offer2","price":499},{"market_sku":832784,"offer_id":"offer3","price":14000}]}
numbers = input() #Выбранные числа
ndata = []
tdata = []
tickets = input() #Количество билетов
tcount = int(tickets)
numdata = numbers.split(" ")
for i in range(len(numdata)):
ndata.append(int(numdata[i]))
for i in range(0,tcount):
tquery = input()
tdata.append(tquery)
for i in range(len(tdata)):
lucky = 0
tdr = tdata[i].split(" ")
tdra = []
for i in range(len(tdr)):
tdra.append(int(tdr[i]))
for i in range(len(tdra)):
nf = tdra[i]
for s in range(len(ndata)):
if ndata[i] % 2 != 0 and nf % 2 != 0: lucky += 1
else: lucky += 0
if lucky > 1: print('Lucky')
else: print('Unlucky')
if ndata[i] % 2 != 0 and nf % 2 != 0: lucky += 1
Undefined variable 'floor'
m = floor((l + h) / 2)