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