21 array(
'oxartnum',
'oxarticles', 1, 0, 0 ),
22 array(
'oxtitle',
'oxarticles', 1, 1, 0 ),
23 array(
'oxean',
'oxarticles', 1, 0, 0 ),
24 array(
'oxmpn',
'oxarticles', 0, 0, 0 ),
25 array(
'oxprice',
'oxarticles', 0, 0, 0 ),
26 array(
'oxstock',
'oxarticles', 0, 0, 0 ),
27 array(
'oxid',
'oxarticles', 0, 0, 1 )
29 'container2' => array(
30 array(
'oxartnum',
'oxarticles', 1, 0, 0 ),
31 array(
'oxtitle',
'oxarticles', 1, 1, 0 ),
32 array(
'oxean',
'oxarticles', 1, 0, 0 ),
33 array(
'oxmpn',
'oxarticles', 0, 0, 0 ),
34 array(
'oxprice',
'oxarticles', 0, 0, 0 ),
35 array(
'oxstock',
'oxarticles', 0, 0, 0 ),
36 array(
'oxid',
'oxarticles', 0, 0, 1 )
59 if ( !$sOxid && $sSynchOxid ) {
62 $sQAdd =
' from '.$sArticleTable.
' where 1 ';
66 $sJoin =
" {$sArticleTable}.oxid={$sO2CView}.oxobjectid ";
69 if ( $sSynchOxid && $sOxid != $sSynchOxid ) {
71 $sSubSelect =
' and '.$sArticleTable.
'.oxid not in ( ';
72 $sSubSelect .=
"select $sArticleTable.oxid from $sO2CView left join $sArticleTable ";
73 $sSubSelect .=
"on $sJoin where $sO2CView.oxcatnid = " . $oDb->quote( $sSynchOxid ) .
" ";
74 $sSubSelect .=
'and '.$sArticleTable.
'.oxid is not null ) ';
77 $sQAdd =
" from $sO2CView join $sArticleTable ";
78 $sQAdd .=
" on $sJoin where $sO2CView.oxcatnid = " . $oDb->quote( $sOxid );
79 $sQAdd .=
" and $sArticleTable.oxid is not null $sSubSelect ";
98 if ( !$this->
getConfig()->getConfigParam(
'blVariantsSelection' ) ) {
99 $sQ .=
" and {$sArtTable}.oxparentid = '' ";
126 if ( is_array($aArticles)) {
131 $oNew =
oxNew(
'oxbase' );
132 $oNew->init(
'oxobject2category' );
137 foreach ( $aArticles as $sAdd) {
140 $sSelect =
"select 1 from $sO2CView as oxobject2category where oxobject2category.oxcatnid= " . $oDb->quote( $sCategoryID ) .
" and oxobject2category.oxobjectid = " . $oDb->quote( $sAdd ) .
"";
141 if ( $oDb->getOne( $sSelect,
false,
false ) )
144 $oNew->oxobject2category__oxid =
new oxField( $oNew->setId( $myUtilsObject->generateUID() ) );
145 $oNew->oxobject2category__oxobjectid =
new oxField( $sAdd );
146 $oNew->oxobject2category__oxcatnid =
new oxField( $sCategoryID );
147 $oNew->oxobject2category__oxtime =
new oxField( time() );
154 $sProdIds .= $oDb->quote( $sAdd ) ;
178 $sQ =
"update oxobject2category set oxtime = 0 where oxid in (
179 select _tmp.oxid from (
180 select oxobject2category.oxid from (
181 select min(oxtime) as oxtime, oxobjectid from {$sO2CView} where oxobjectid in ( {$sProdIds} ) group by oxobjectid
183 left join oxobject2category on oxobject2category.oxtime = _subtmp.oxtime and oxobject2category.oxobjectid = _subtmp.oxobjectid
200 $sShopID = $this->
getConfig()->getShopId();
210 if ( is_array( $aArticles ) && count( $aArticles ) ) {
213 $sDelete =
"delete from oxobject2category where";
214 $sWhere =
" oxcatnid=".$oDb->quote( $sCategoryID );
215 if ( !$this->
getConfig()->getConfigParam(
'blVariantsSelection' ) ) {
216 $sQ = $sDelete.$sWhere.
" and oxobjectid in ( select oxid from oxarticles where oxparentid in ( {$sProdIds} ) )";
217 $oDb->execute( $sQ );
219 $sQ = $sDelete.$sWhere.
" and oxobjectid in ( {$sProdIds} )";
220 $oDb->execute( $sQ );