Comment.php 1.55 KB
<?php

namespace YHMComment\SqlMap\Comment;

class Comment {

    const SELECT_ONE_BY_ID = 'select * from comment where id=:id';
    const COUNT_LIST_BYSKC = 'select count(1) from comment where product_skc=:product_skc';
    const SELECT_COMMENT_BYSKC = 'select id,star,uid,create_time from comment where product_skc=:product_skc order by  id desc limit :offset,:num';
    const SELECT_COMMENT_CONTENT_BYID = 'select content from comment_content where comment_id=:id';
    const INSERT_COMMENT = 'insert into comment(store_id,order_code,product_skc,star,uid,create_time) values(:store_id,:order_code,:product_skc,:star,:uid,UNIX_TIMESTAMP())';
    const INSERT_COMMENT_CONTENT = 'insert into comment_content(comment_id,content) values(:id,:content)';
    const DELETE_COMMENT_BYID = 'delete from comment where id=:id';
    const DELETE_COMMENT_CONTENT_BYID = 'delete from comment_content where comment_id=:id';
    const SELECT_COMMENT_BY_ORDER_CODE = 'select * from comment where order_code = :order_code and uid = :uid';
    const SELECT_COUNT_BY_STORE_ID = 'select count(1) from comment where store_id=:store_id';
    const SELECT_SUMSTAR_BY_STORE_ID = 'select sum(star) from comment where store_id=:store_id';
    const SELECT_COMMENT_BY_LIST="select * from comment where #where#  limit :offset,:num";
    const SELECT_COMMENT_BY_COUNT="select count(store_id) from comment where #where#  ";
    const INSERT_COMMENT_REPLY="insert into comment(parent_id,uid,create_time) values(:id,:uid,UNIX_TIMESTAMP())";
    const SELECT_REPLY="select * from comment where parent_id=:id";
    

}