included class files in install.php
This commit is contained in:
parent
f3a7ad7a48
commit
8128c5bbf8
4 changed files with 23 additions and 17 deletions
|
@ -225,11 +225,14 @@ class intaro_retailcrm extends CModule
|
|||
}
|
||||
}
|
||||
|
||||
include($this->INSTALL_PATH . '/../lib/model/bitrix/abstractmodelproxy.php');
|
||||
include($this->INSTALL_PATH . '/../lib/model/bitrix/orderprops.php');
|
||||
include($this->INSTALL_PATH . '/../lib/model/bitrix/tomodule.php');
|
||||
include($this->INSTALL_PATH . '/../lib/repository/abstractrepository.php');
|
||||
include($this->INSTALL_PATH . '/../lib/repository/orderpropsrepository.php');
|
||||
include($this->INSTALL_PATH . '/../lib/repository/persontyperepository.php');
|
||||
include($this->INSTALL_PATH . '/../lib/repository/tomodulerepository.php');
|
||||
include($this->INSTALL_PATH . '/../lib/model/bitrix/orm/tomodule.php');
|
||||
|
||||
$this->CopyFiles();
|
||||
$this->addBonusPaySystem();
|
||||
|
@ -1496,11 +1499,9 @@ class intaro_retailcrm extends CModule
|
|||
public function addLPOrderProps(): void
|
||||
{
|
||||
$persons = PersonTypeRepository::getCollectionByWhere(['ID']);
|
||||
|
||||
foreach ($persons as $person) {
|
||||
$personId = $person->getID();
|
||||
$groupID = $this->getGroupID($personId);
|
||||
|
||||
if (isset($groupID)) {
|
||||
$this->addBonusField($personId, $groupID);
|
||||
}
|
||||
|
@ -1565,6 +1566,9 @@ class intaro_retailcrm extends CModule
|
|||
/**
|
||||
* @param $personID
|
||||
* @param $groupID
|
||||
* @throws \Bitrix\Main\ArgumentException
|
||||
* @throws \Bitrix\Main\ObjectPropertyException
|
||||
* @throws \Bitrix\Main\SystemException
|
||||
*/
|
||||
private function addBonusField($personID, $groupID): void
|
||||
{
|
||||
|
@ -1574,8 +1578,8 @@ class intaro_retailcrm extends CModule
|
|||
];
|
||||
|
||||
$bonusProp = OrderPropsRepository::getFirstByWhere(['ID'], $where);
|
||||
|
||||
if ($bonusProp === false) {
|
||||
|
||||
if ($bonusProp === null) {
|
||||
$fields = [
|
||||
"REQUIRED" => "N",
|
||||
"NAME" => self::BONUS_COUNT,
|
||||
|
@ -1648,8 +1652,6 @@ class intaro_retailcrm extends CModule
|
|||
private function addLPEvents(): void
|
||||
{
|
||||
$eventManager = EventManager::getInstance();
|
||||
include($this->INSTALL_PATH . '/../lib/model/bitrix/orm/tomodule.php');
|
||||
include($this->INSTALL_PATH . '/../lib/repository/tomodulerepository.php');
|
||||
|
||||
foreach (self::SUBSCRIBE_LP_EVENTS as $event){
|
||||
$select = ['ID'];
|
||||
|
|
|
@ -11,13 +11,10 @@
|
|||
*/
|
||||
namespace Intaro\RetailCrm\Repository;
|
||||
|
||||
use Bitrix\Sale\FuserTable;
|
||||
use Bitrix\Sale\Internals\OrderPropsTable;
|
||||
use Intaro\RetailCrm\Model\Bitrix\Fuser;
|
||||
use Bitrix\Main\ORM\Objectify\EntityObject;
|
||||
use Intaro\RetailCrm\Model\Bitrix\OrderProps;
|
||||
use Intaro\RetailCrm\Model\Bitrix\ORM\ToModuleTable;
|
||||
use Intaro\RetailCrm\Model\Bitrix\ToModule;
|
||||
|
||||
|
||||
/**
|
||||
* Class RepositoryRepository
|
||||
|
@ -26,10 +23,17 @@ use Intaro\RetailCrm\Model\Bitrix\ToModule;
|
|||
*/
|
||||
class OrderPropsRepository extends AbstractRepository
|
||||
{
|
||||
|
||||
public static function getFirstByWhere(array $select, array $where): ?ToModule
|
||||
/**
|
||||
* @param array $select
|
||||
* @param array $where
|
||||
* @return \Intaro\RetailCrm\Model\Bitrix\OrderProps|null
|
||||
* @throws \Bitrix\Main\ArgumentException
|
||||
* @throws \Bitrix\Main\ObjectPropertyException
|
||||
* @throws \Bitrix\Main\SystemException
|
||||
*/
|
||||
public static function getFirstByWhere(array $select, array $where): ?OrderProps
|
||||
{
|
||||
return static::getWrapped(ToModuleTable::query()
|
||||
return static::getWrapped(OrderPropsTable::query()
|
||||
->setSelect($select)
|
||||
->where($where)
|
||||
->fetchObject());
|
||||
|
|
|
@ -24,12 +24,12 @@ class PersonTypeRepository extends AbstractRepository
|
|||
/**
|
||||
* @param array $select
|
||||
* @param array $where
|
||||
* @return \Bitrix\Main\Type\Collection|null
|
||||
* @return \Bitrix\Main\Type\Collection|null|Bitrix\Sale\Internals\EO_PersonType_Collection
|
||||
* @throws \Bitrix\Main\ArgumentException
|
||||
* @throws \Bitrix\Main\ObjectPropertyException
|
||||
* @throws \Bitrix\Main\SystemException
|
||||
*/
|
||||
public static function getCollectionByWhere(array $select = ['*'], array $where = []): ?Collection
|
||||
public static function getCollectionByWhere(array $select = ['*'], array $where = [])
|
||||
{
|
||||
return PersonTypeTable::query()
|
||||
->setSelect($select)
|
||||
|
|
|
@ -41,12 +41,12 @@ class ToModuleRepository extends AbstractRepository
|
|||
/**
|
||||
* @param array $select
|
||||
* @param array $where
|
||||
* @return \Bitrix\Main\Type\Collection|null
|
||||
* @return \Bitrix\Main\Type\Collection|Intaro\RetailCrm\Model\Bitrix\ORM\EO_ToModule_Collection|null
|
||||
* @throws \Bitrix\Main\ArgumentException
|
||||
* @throws \Bitrix\Main\ObjectPropertyException
|
||||
* @throws \Bitrix\Main\SystemException
|
||||
*/
|
||||
public static function getCollectionByWhere(array $select, array $where): ?Collection
|
||||
public static function getCollectionByWhere(array $select, array $where)
|
||||
{
|
||||
return ToModuleTable::query()
|
||||
->setSelect($select)
|
||||
|
|
Loading…
Add table
Reference in a new issue