|
@@ 1443-1455 (lines=13) @@
|
| 1440 |
|
* @param int $productType The type of product
|
| 1441 |
|
* @return int The number of affected rows. Otherwise return false
|
| 1442 |
|
*/
|
| 1443 |
|
public function updateItem(array $itemData, $productId, $productType)
|
| 1444 |
|
{
|
| 1445 |
|
$itemTable = Database::get_main_table(BuyCoursesPlugin::TABLE_ITEM);
|
| 1446 |
|
|
| 1447 |
|
return Database::update(
|
| 1448 |
|
$itemTable,
|
| 1449 |
|
$itemData,
|
| 1450 |
|
[
|
| 1451 |
|
'product_id = ? AND ' => intval($productId),
|
| 1452 |
|
'product_type' => $productType
|
| 1453 |
|
]
|
| 1454 |
|
);
|
| 1455 |
|
}
|
| 1456 |
|
|
| 1457 |
|
/**
|
| 1458 |
|
* Remove all beneficiaries for a item
|
|
@@ 1663-1673 (lines=11) @@
|
| 1660 |
|
* @param int $status The status to set (-1 to cancel, 0 to pending, 1 to completed)
|
| 1661 |
|
* @return array
|
| 1662 |
|
*/
|
| 1663 |
|
public function setStatusPayouts($payoutId, $status)
|
| 1664 |
|
{
|
| 1665 |
|
$payoutsTable = Database::get_main_table(BuyCoursesPlugin::TABLE_PAYPAL_PAYOUTS);
|
| 1666 |
|
|
| 1667 |
|
Database::update(
|
| 1668 |
|
$payoutsTable,
|
| 1669 |
|
['status' => intval($status)],
|
| 1670 |
|
['id = ?' => intval($payoutId)]
|
| 1671 |
|
);
|
| 1672 |
|
|
| 1673 |
|
}
|
| 1674 |
|
|
| 1675 |
|
/**
|
| 1676 |
|
* Gets the stored platform commission params
|
|
@@ 1694-1702 (lines=9) @@
|
| 1691 |
|
* @param int $params platform commission
|
| 1692 |
|
* @return int The number of affected rows. Otherwise return false
|
| 1693 |
|
*/
|
| 1694 |
|
public function updateCommission($params)
|
| 1695 |
|
{
|
| 1696 |
|
$commissionTable = Database::get_main_table(BuyCoursesPlugin::TABLE_COMMISSION);
|
| 1697 |
|
|
| 1698 |
|
return Database::update(
|
| 1699 |
|
$commissionTable,
|
| 1700 |
|
['commission' => intval($params['commission'])]
|
| 1701 |
|
);
|
| 1702 |
|
}
|
| 1703 |
|
|
| 1704 |
|
/**
|
| 1705 |
|
* Register addicional service
|
|
@@ 2104-2113 (lines=10) @@
|
| 2101 |
|
* @param int $newStatus The new status
|
| 2102 |
|
* @return boolean
|
| 2103 |
|
*/
|
| 2104 |
|
private function updateServiceSaleStatus($serviceSaleId, $newStatus = self::SERVICE_STATUS_PENDING)
|
| 2105 |
|
{
|
| 2106 |
|
$serviceSaleTable = Database::get_main_table(self::TABLE_SERVICES_SALE);
|
| 2107 |
|
|
| 2108 |
|
return Database::update(
|
| 2109 |
|
$serviceSaleTable,
|
| 2110 |
|
['status' => intval($newStatus)],
|
| 2111 |
|
['id = ?' => intval($serviceSaleId)]
|
| 2112 |
|
);
|
| 2113 |
|
}
|
| 2114 |
|
|
| 2115 |
|
/**
|
| 2116 |
|
* Register a Service sale
|