Убрал вызов User->addDelo.

This commit is contained in:
2023-12-01 23:05:11 +02:00
parent ad80a30a5f
commit 4c6a5d055b
17 changed files with 1187 additions and 1100 deletions
+12 -35
View File
@@ -36,61 +36,38 @@ foreach (Db::getRows($q) as $row) {
if ($row['inGroup']) {
$col = $u->itemsX($row['id']);
if ($col > 1) {
$stmt = Db::prepare('
update items_users set inShop = 0, 1price = ?
where
item_id = ? and
inShop = 30 and
uid = ? and
inGroup = ?
limit ' . $col);
$stmt = Db::prepare(
'update items_users set inShop = 0, 1price = ?
where item_id = ? and inShop = 30 and uid = ? and inGroup = ? limit ' . $col);
if ($stmt->execute([$row['price1'], $row['item_id'], $row['uid'], $row['inGroup']])) {
$ld = $u->addDelo(
Delo::add(
1,
SHOP_TYPE,
$row['uid'],
sprintf(RETURN_GROUP, $row['item_id'], $row['name'], $row['price1'], $row['inGroup'] . '+1'),
time(),
$u->info['city'],
SHOP_TYPE,
0,
0
);
}
} else {
$stmt = Db::prepare('
update items_users set inShop = 0, 1price = ?
where
uid = ? and
id = ? and
inOdet = 0 and
`delete` = 0 and
inShop = 30
');
$stmt = Db::prepare('update items_users set inShop = 0, 1price = ?
where uid = ? and id = ? and inOdet = 0 and `delete` = 0 and inShop = 30');
if ($stmt->execute([$row['price1'], $row['uid'], $row['id']])) {
$ld = $u->addDelo(
Delo::add(
1,
SHOP_TYPE,
$row['uid'],
sprintf(RETURN_ONE, $row['item_id'], $row['name'], $row['price1']),
time(),
$u->info['city'],
SHOP_TYPE,
0,
0
);
}
}
} else {
$stmt = Db::prepare('update items_users set inShop = 0, 1price = ? where id = ? and inShop = 30');
if ($stmt->execute([$row['price1'], $row['id']])) {
$ld = $u->addDelo(
Delo::add(
1,
SHOP_TYPE,
$row['uid'],
sprintf(RETURN_ONE, $row['item_id'], $row['name'], $row['price1']),
time(),
$u->info['city'],
SHOP_TYPE,
0,
0
);
}
}