ここの情報は古いです。ご理解頂いた上でお取り扱いください。

Changeset 483


Ignore:
Timestamp:
Oct 14, 2006, 1:15:12 PM (14 years ago)
Author:
ojima
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • OpenPNE/branches/tejima/prj_db_refine/webapp/lib/db/db_deplicated_ojima.php

    r481 r483  
    148148
    149149
    150 /**
    151  * @copyright 2005-2006 OpenPNE Project
    152  * @license   http://www.php.net/license/3_01.txt PHP License 3.01
    153  */
    154 
    155 function do_c_review_add_insert_c_review($product, $c_review_category_id)
    156 {
    157     $sql = 'SELECT c_review_id FROM c_review WHERE asin = ?';
    158     $params = array($product['asin']);
    159     if ($c_review_id = db_get_one($sql, $params)) {
    160         return $c_review_id;
    161     }
    162 
    163     $data = array(
    164         'title'        => $product['name'],
    165         'release_date' => $product['release'],
    166         'manufacturer' => $product['manufacturer'],
    167         'author'       => $product['author'],
    168         'c_review_category_id' => intval($c_review_category_id),
    169         'image_small'  => $product['imagesmall'],
    170         'image_medium' => $product['imagemedium'],
    171         'image_large'  => $product['imagelarge'],
    172         'url'          => $product['url'],
    173         'asin'         => $product['asin'],
    174         'list_price'   => $product['listprice'],
    175         'retail_price' => $product['ourprice'],
    176         'r_datetime'   => db_now(),
    177     );
    178 
    179     //TODO:暫定処理
    180     foreach ($data as $key => $value) {
    181         if (is_null($value)) $data[$key] = '';
    182     }
    183     return db_insert('c_review', $data);
    184 }
    185 
    186 function do_c_review_add_insert_c_review_comment($c_review_id , $c_member_id, $body, $satisfaction_level)
    187 {
    188     $data = array(
    189         'c_review_id' => intval($c_review_id),
    190         'c_member_id' => intval($c_member_id),
    191         'body' => $body,
    192         'satisfaction_level' => intval($satisfaction_level),
    193         'r_datetime' => db_now(),
    194     );
    195     return db_insert('c_review_comment', $data);
    196 }
    197 
    198 function do_h_review_edit_update_c_review_comment($c_review_comment_id, $body, $satisfaction_level)
    199 {
    200     $data = array(
    201         'body' => $body,
    202         'satisfaction_level' => intval($satisfaction_level),
    203         'r_datetime' => db_now(),
    204     );
    205     $where = array('c_review_comment_id' => intval($c_review_comment_id));
    206     return db_update('c_review_comment', $data, $where);
    207 }
    208 
    209 function do_h_review_edit_delete_c_review_comment($c_review_comment_id)
    210 {
    211     $sql = 'DELETE FROM c_review_comment WHERE c_review_comment_id = ?';
    212     $params = array(intval($c_review_comment_id));
    213     db_query($sql, $params);
    214 }
    215 
    216 function do_h_review_clip_add_insert_c_review_clip($c_review_id, $c_member_id)
    217 {
    218     $data = array(
    219         'c_member_id' => intval($c_member_id),
    220         'c_review_id' => intval($c_review_id),
    221         'r_datetime' => db_now(),
    222     );
    223     return db_insert('c_review_clip', $data);
    224 }
    225 
    226 function do_c_member_review_insert_c_commu_review($c_review_id, $c_member_id, $c_commu_id)
    227 {
    228     $data = array(
    229         'c_commu_id' => intval($c_commu_id),
    230         'c_review_id' => intval($c_review_id),
    231         'c_member_id' => intval($c_member_id),
    232         'r_datetime' => db_now(),
    233     );
    234     return db_insert('c_commu_review', $data);
    235 }
    236 
    237 function do_h_review_clip_list_delete_c_review_clip($c_member_id , $c_review_clips)
    238 {
    239     if (!is_array($c_review_clips)) {
    240         return false;
    241     }
    242     $ids = implode(',', array_map('intval', $c_review_clips));
    243 
    244     $sql = 'DELETE FROM c_review_clip WHERE c_member_id = ?' .
    245             ' AND c_review_id IN ('.$ids.')';
    246     $params = array(intval($c_member_id));
    247     return db_query($sql, $params);
    248 }
    249 
    250 function do_delete_c_review4c_review_id($c_review_id)
    251 {
    252     $params = array(intval($c_review_id));
    253 
    254     // c_review
    255     $sql = 'DELETE FROM c_review WHERE c_review_id = ?';
    256     db_query($sql, $params);
    257 
    258     // c_review_clip
    259     $sql = 'DELETE FROM c_review_clip WHERE c_review_id = ?';
    260     db_query($sql, $params);
    261 
    262     // c_commu_review
    263     $sql = 'DELETE FROM c_commu_review WHERE c_review_id = ?';
    264     db_query($sql, $params);
    265 }
    266 
    267150?>
    268151
    269 ?>
Note: See TracChangeset for help on using the changeset viewer.