| 22 |
* |
* |
| 23 |
* $Revision$ |
* $Revision$ |
| 24 |
* $Log$ |
* $Log$ |
| 25 |
|
* Revision 1.106 2005/08/29 07:11:05 aga4096 |
| 26 |
|
* ・xnp_update_item_status, xnp_selective_harvestingの修正. |
| 27 |
|
* |
| 28 |
* Revision 1.105 2005/08/29 05:27:37 aga4096 |
* Revision 1.105 2005/08/29 05:27:37 aga4096 |
| 29 |
* ・update_item_statusの修正. |
* ・update_item_statusの修正. |
| 30 |
* |
* |
| 8186 |
if ( isGuestEnabled() ){ |
if ( isGuestEnabled() ){ |
| 8187 |
{ |
{ |
| 8188 |
// アイテムが公開済みで、item_statusが削除または非存在のものを修正 |
// アイテムが公開済みで、item_statusが削除または非存在のものを修正 |
| 8189 |
|
// select distinct txil.item_id, tis.is_deleted from x_xoonips_index as tx,x_xoonips_index_item_link as txil left join x_xoonips_item_status as tis on txil.item_id = tis.item_id where tx.index_id=txil.index_id and txil.certify_state = 2 and tx.open_level = 1; |
| 8190 |
string sql = "select distinct txil.item_id, tis.is_deleted " |
string sql = "select distinct txil.item_id, tis.is_deleted " |
| 8191 |
" from " + dbprefix + "_xoonips_index as tx, " |
" from " + dbprefix + "_xoonips_index as tx, " |
| 8192 |
+ dbprefix + "_xoonips_index_item_link as txil " |
+ dbprefix + "_xoonips_index_item_link as txil " |
| 8219 |
} |
} |
| 8220 |
{ |
{ |
| 8221 |
// アイテムが非公開で、item_status.is_deleted=0のものを修正 |
// アイテムが非公開で、item_status.is_deleted=0のものを修正 |
| 8222 |
|
// select tis.item_id, count(tx.index_id) as public_count from x_xoonips_item_status as tis left join x_xoonips_index_item_link as tl on tl.item_id = tis.item_id and certify_state = 2 left join x_xoonips_index as tx on tx.index_id =tl.index_id and tx.open_level = 1 where is_deleted=0 group by tis.item_id having pubilc_count=0 ; |
| 8223 |
string sql = "select tis.item_id, count(tx.index_id) as public_count " |
string sql = "select tis.item_id, count(tx.index_id) as public_count " |
| 8224 |
" from " + dbprefix + "_xoonips_item_status as tis " |
" from " + dbprefix + "_xoonips_item_status as tis " |
| 8225 |
" left join " + dbprefix + "_xoonips_index_item_link as tl on tl.item_id = tis.item_id and certify_state = " + unsignedIntToString(index::CERTIFIED) + |
" left join " + dbprefix + "_xoonips_index_item_link as tl on tl.item_id = tis.item_id and certify_state = " + unsignedIntToString(index::CERTIFIED) + |
| 8226 |
" left join " + dbprefix + "_xoonips_index as tx on tx.index_id =tl.index_id and tx.open_level = " + unsignedIntToString(index::OL_PUBLIC) + |
" left join " + dbprefix + "_xoonips_index as tx on tx.index_id =tl.index_id and tx.open_level = " + unsignedIntToString(index::OL_PUBLIC) + |
| 8227 |
" where is_deleted=0 group by tis.item_id having pubilc_count=0 "; |
" where is_deleted=0 group by tis.item_id having public_count=0 "; |
| 8228 |
sqlexec_t s( "updateItemStatus", sql, &ret ); |
sqlexec_t s( "updateItemStatus", sql, &ret ); |
| 8229 |
if ( s.getSqlcode() == SQL_SUCCESS ){ |
if ( s.getSqlcode() == SQL_SUCCESS ){ |
| 8230 |
SQLUINTEGER iid = 0; |
SQLUINTEGER iid = 0; |
| 8260 |
} |
} |
| 8261 |
|
|
| 8262 |
/** selective harvesting |
/** selective harvesting |
| 8263 |
* @param from, until 選択範囲 指定しない場合は0を入れる |
* @param from, until 選択範囲 from=0なら最も古い時刻から until=0なら現在まで |
| 8264 |
* @param startIID startIID<=item_idであるようなitem_idのみを得る |
* @param startIID startIID<=item_idであるようなitem_idのみを得る |
| 8265 |
* @param limit 返すitem_idの個数の上限 |
* @param limit 返すitem_idの個数の上限 |
| 8266 |
* @param iids item_idを返す配列 item_idの小さいものから配列に入る |
* @param iids item_idを返す配列 item_idの小さいものから配列に入る |
| 8271 |
result_t ret = RES_ERROR; |
result_t ret = RES_ERROR; |
| 8272 |
if ( limit < 0 ) return RES_ERROR; |
if ( limit < 0 ) return RES_ERROR; |
| 8273 |
|
|
| 8274 |
string sql = "select item_id " |
string sql = "select item_id from " + dbprefix + "_xoonips_item_status where "; |
| 8275 |
" from " + dbprefix + "_xoonips_item_status " |
if ( from != 0 ) sql += unsignedIntToString(from) + " <= unix_timestamp(timestamp) and "; |
| 8276 |
" where " + unsignedIntToString(from) + " <= unix_timestamp(timestamp) " |
if ( until != 0 ) sql += " unix_timestamp(timestamp) <= " + unsignedIntToString(until) + " and "; |
| 8277 |
" and unix_timestamp(timestamp) <= " + unsignedIntToString(until) + |
sql += |
| 8278 |
" and item_id >= " + unsignedIntToString(startIID) + |
" item_id >= " + unsignedIntToString(startIID) + |
| 8279 |
" limit " + unsignedIntToString(limit); |
" limit " + unsignedIntToString(limit); |
| 8280 |
sqlexec_t s( "updateItemStatus", sql, &ret ); |
sqlexec_t s( "updateItemStatus", sql, &ret ); |
| 8281 |
//setLastErrorString( "selectiveHarvesting..." ); |
//setLastErrorString( "selectiveHarvesting..." ); |