OXID eShop CE  4.10.8
 All Classes Namespaces Files Functions Variables Pages
oxorderfilelist.php
Go to the documentation of this file.
1 <?php
2 
7 class oxOrderFileList extends oxList
8 {
9 
15  protected $_sObjectsInListName = 'oxorderfile';
16 
22  public function loadUserFiles($sUserId)
23  {
24  $oOrderFile = $this->getBaseObject();
25  $sFields = $oOrderFile->getSelectFields();
26  $sShopId = $this->getConfig()->getShopId();
27 
28  $oOrderFile->addFieldName('oxorderfiles__oxarticletitle');
29  $oOrderFile->addFieldName('oxorderfiles__oxarticleartnum');
30  $oOrderFile->addFieldName('oxorderfiles__oxordernr');
31  $oOrderFile->addFieldName('oxorderfiles__oxorderdate');
32 
33  $sSql = "SELECT " . $sFields . " ,
34  `oxorderarticles`.`oxtitle` AS `oxorderfiles__oxarticletitle`,
35  `oxorderarticles`.`oxartnum` AS `oxorderfiles__oxarticleartnum`,
36  `oxfiles`.`oxpurchasedonly` AS `oxorderfiles__oxpurchasedonly`,
37  `oxorder`.`oxordernr` AS `oxorderfiles__oxordernr`,
38  `oxorder`.`oxorderdate` AS `oxorderfiles__oxorderdate`,
39  IF( `oxorder`.`oxpaid` != '0000-00-00 00:00:00', 1, 0 ) AS `oxorderfiles__oxispaid`
40  FROM `oxorderfiles`
41  LEFT JOIN `oxorderarticles` ON `oxorderarticles`.`oxid` = `oxorderfiles`.`oxorderarticleid`
42  LEFT JOIN `oxfiles` ON `oxfiles`.`oxid` = `oxorderfiles`.`oxfileid`
43  LEFT JOIN `oxorder` ON `oxorder`.`oxid` = `oxorderfiles`.`oxorderid`
44  WHERE `oxorder`.`oxuserid` = '" . $sUserId . "'
45  AND `oxorderfiles`.`oxshopid` = '" . $sShopId . "'
46  AND `oxorder`.`oxstorno` = 0
47  AND `oxorderarticles`.`oxstorno` = 0
48  ORDER BY `oxorder`.`oxordernr`";
49 
50  $this->selectString($sSql);
51  }
52 
58  public function loadOrderFiles($sOrderId)
59  {
60  $oOrderFile = $this->getBaseObject();
61  $sFields = $oOrderFile->getSelectFields();
62  $sShopId = $this->getConfig()->getShopId();
63 
64  $oOrderFile->addFieldName('oxorderfiles__oxarticletitle');
65  $oOrderFile->addFieldName('oxorderfiles__oxarticleartnum');
66 
67  $sSql = "SELECT " . $sFields . " ,
68  `oxorderarticles`.`oxtitle` AS `oxorderfiles__oxarticletitle`,
69  `oxorderarticles`.`oxartnum` AS `oxorderfiles__oxarticleartnum`,
70  `oxfiles`.`oxpurchasedonly` AS `oxorderfiles__oxpurchasedonly`
71  FROM `oxorderfiles`
72  LEFT JOIN `oxorderarticles` ON `oxorderarticles`.`oxid` = `oxorderfiles`.`oxorderarticleid`
73  LEFT JOIN `oxfiles` ON `oxfiles`.`oxid` = `oxorderfiles`.`oxfileid`
74  WHERE `oxorderfiles`.`oxorderid` = '" . $sOrderId . "' AND `oxorderfiles`.`oxshopid` = '" . $sShopId . "'
75  AND `oxorderarticles`.`oxstorno` = 0";
76 
77  $this->selectString($sSql);
78  }
79 }