コード例 #1
0
 /** @return \CDBResult */
 public function getData()
 {
     $lid = $this->getFieldValue('LID', null);
     $orderCountFrom = $this->getFieldValue('ORDER_COUNT_FROM', null);
     $orderCountTo = $this->getFieldValue('ORDER_COUNT_TO', null);
     $orderSumFrom = $this->getFieldValue('ORDER_SUM_FROM', null);
     $orderSumTo = $this->getFieldValue('ORDER_SUM_TO', null);
     $orderLastDateFrom = $this->getFieldValue('LAST_ORDER_DATE_FROM', null);
     $orderLastDateTo = $this->getFieldValue('LAST_ORDER_DATE_TO', null);
     $filter = array();
     if ($lid) {
         $filter['LID'] = $lid;
     }
     if ($orderCountFrom) {
         $filter['>=ORDER_COUNT'] = $orderCountFrom;
     }
     if ($orderCountTo) {
         $filter['<ORDER_COUNT'] = $orderCountTo;
     }
     if ($orderSumFrom) {
         $filter['>=ORDER_SUM'] = $orderSumFrom;
     }
     if ($orderSumTo) {
         $filter['<ORDER_SUM'] = $orderSumTo;
     }
     if ($orderLastDateFrom) {
         $filter['>=LAST_ORDER_DATE'] = $orderLastDateFrom;
     }
     if ($orderLastDateTo) {
         $filter['<LAST_ORDER_DATE'] = $orderLastDateTo;
     }
     $dbBuyerList = \CSaleUser::GetBuyersList(array('ID' => 'ASC'), $filter, false, false, array("EMAIL", "NAME", "USER_ID"));
     return $dbBuyerList;
 }
コード例 #2
0
ファイル: buyers.php プロジェクト: DarneoStudio/bitrix
        $arSitesShop[] = array("ID" => $key, "NAME" => $val["NAME"]);
    }
}
if (empty($arSitesShop)) {
    $arSitesShop = $arSites;
}
$arCountry = GetCountryArray();
$arCountry["reference_id"] = array_flip($arCountry["reference_id"]);
/*
 * select all user (byuers)
 */
$arHeaders = array(array("id" => "USER_ID", "content" => "ID", "sort" => "USER_ID"), array("id" => "BUYER", "content" => GetMessage("BUYER_ROW_BUYER"), "sort" => "NAME", "default" => true), array("id" => "LOGIN", "content" => GetMessage("BUYER_ROW_LOGIN"), "sort" => "LOGIN"), array("id" => "LAST_NAME", "content" => GetMessage("BUYER_ROW_LAST"), "sort" => "LAST_NAME"), array("id" => "NAME", "content" => GetMessage("BUYER_ROW_NAME"), "sort" => "NAME"), array("id" => "SECOND_NAME", "content" => GetMessage("BUYER_ROW_SECOND"), "sort" => "SECOND_NAME"), array("id" => "EMAIL", "content" => GetMessage("BUYER_ROW_MAIL"), "sort" => "EMAIL", "default" => true), array("id" => "PERSONAL_PHONE", "content" => GetMessage("BUYER_ROW_PHONE"), "sort" => "PERSONAL_PHONE", "default" => true), array("id" => "LAST_LOGIN", "content" => GetMessage('BUYER_ROW_LAST_LOGIN'), "sort" => "LAST_LOGIN", "default" => false), array("id" => "DATE_REGISTER", "content" => GetMessage('BUYER_ROW_DATE_REGISTER'), "sort" => "DATE_REGISTER", "default" => true), array("id" => "LAST_ORDER_DATE", "content" => GetMessage('BUYER_ROW_LAST_ORDER_DATE'), "sort" => "LAST_ORDER_DATE", "default" => true), array("id" => "ORDER_COUNT", "content" => GetMessage('BUYER_ROW_COUNT_ORDER'), "sort" => "ORDER_COUNT", "default" => true, "align" => "right"), array("id" => "ORDER_SUM", "content" => GetMessage('BUYER_ROW_SUM_ORDER'), "sort" => "ORDER_SUM", "default" => true, "align" => "right"), array("id" => "GROUPS_ID", "content" => GetMessage('BUYER_ROW_GROUP')));
$lAdmin->AddHeaders($arHeaders);
$arVisibleColumns = $lAdmin->GetVisibleHeaderColumns();
$arOrderBuyer[$by] = $order;
$dbUsersList = CSaleUser::GetBuyersList($arOrderBuyer, $arFilter, false, array("nPageSize" => CAdminResult::GetNavSize($sTableID)), array("ID", "LID", "ACTIVE", "DATE_REGISTER", "LOGIN", "EMAIL", "NAME", "LAST_NAME", "SECOND_NAME", "PERSONAL_PHONE", "USER_ID", "LAST_LOGIN", "ORDER_COUNT", "ORDER_SUM", "CURRENCY", "LAST_ORDER_DATE"));
$dbUsersList = new CAdminResult($dbUsersList, $sTableID);
$dbUsersList->NavStart();
$lAdmin->NavText($dbUsersList->GetNavPrint(GetMessage("BUYER_PRLIST")));
while ($arBuyers = $dbUsersList->Fetch()) {
    $row =& $lAdmin->AddRow($arBuyers["USER_ID"], $arBuyers, "sale_buyers_profile.php?USER_ID=" . $arBuyers["USER_ID"] . "&lang=" . LANGUAGE_ID, GetMessage("BUYER_SUB_ACTION_PROFILE"));
    $profile = '<a href="sale_buyers_profile.php?USER_ID=' . $arBuyers["USER_ID"] . '&lang=' . LANGUAGE_ID . '">' . $arBuyers["USER_ID"] . '</a>';
    $row->AddField("USER_ID", $profile);
    if (floatVal($arBuyers["ORDER_SUM"]) > 0 && in_array("ORDER_SUM", $arVisibleColumns)) {
        $row->AddField("ORDER_SUM", SaleFormatCurrency($arBuyers["ORDER_SUM"], $arBuyers["CURRENCY"]));
    }
    if (floatVal($arBuyers["ORDER_COUNT"]) <= 0) {
        $row->AddField("ORDER_COUNT", '&nbsp;');
    }
    if (in_array("GROUPS_ID", $arVisibleColumns)) {
        $strUserGroup = '';