Activity.php 1.39 KB
<?php

namespace YHMSupport\SqlMap\Activity;

class Activity {

    const SELECT_ACTIVITY = 'select * from activity where status=1 order by id desc limit 5';
    const SELECT_INFO_BY_ID = 'select * from activity where id=:id';
    const SELECT_GOODS_LIST_BY_ACTIVITY_ID = 'select * from activity_goods where activity_id=:activity_id limit :offset,:num';
    //admin
    const SELECT_ACTIVITY_LIST = 'select * from activity where status=1 order by id desc limit :offset,:num';
    const INSERT_INTO_ACTIVITY = 'insert into activity(activity_name,activity_banner,activity_describe,start_time,end_time,create_time,create_pid) values(
            :activity_name,:activity_banner,:activity_describe,:start_time,:end_time,UNIX_TIMESTAMP(),:create_pid)';
    const SELECT_ACTIVITY_GOODS = 'select * from activity_goods where activity_id=:activity_id and product_skc=:product_skc';
    const INSERT_INTO_ACTIVITY_GOODS = 'insert into activity_goods(activity_id,product_skc) values(:activity_id,:product_skc)';
    const DELETE_ACTIVITY_BY_ID = 'delete from activity where id=:id';
    const UPDATE_ACTIVITY_BY_ID = 'update activity set create_pid=:create_pid,activity_name=:activity_name,start_time=:start_time,end_time=:end_time,activity_banner=:activity_banner,activity_describe=:activity_describe,status=:status where id=:id';
    const SELECT_ACTIVITY_GOODS_LIST = 'select * from activity_goods where activity_id=:activity_id ';

}