123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693 |
- <?php
- namespace Cas\Dao;
- use KIF\Dao\DBAgileDev;
- /**
- *
- * 活动表
- *
- * @author lihuanchun@qq.com
- *
- */
- class LotteryEvents extends DBAgileDev {
- protected $tableName = 'lottery_events';
-
- /**
- * 数据库里的真实字段
- * @var array
- */
- protected $other_field = array(
- 'events_name',
- 'begin_time',
- 'end_time',
- 'share_button',
- 'platform_ids',
- 'operator_uid',
- 'list_display',
- 'focus_display',
- 'top_display',
- 'category_id',
- 'display', // 是否显示
- 'type',// 活动类型 转盘 ... ...
- 'del' // 是否被删除
- );
-
- /**
- * EVENT_DISPLAY_SHOW 发布
- * @var int
- */
- const EVENT_DISPLAY_SHOW = 1;
- /**
- * EVENT_DISPLAY_HIDE 停用
- * @var int
- */
- const EVENT_DISPLAY_HIDE = 0;
- /**
- * EVENT_DISPLAY_UNFINISHED 未设置完成
- * @var int
- */
- const EVENT_DISPLAY_UNFINISHED = 2;
-
-
- public static $display= array(
- self::EVENT_DISPLAY_SHOW => array(
- 'desc' => '发布',
- 'kw' => 'EVENT_DISPLAY_SHOW',
- ),
- self::EVENT_DISPLAY_HIDE => array(
- 'desc' => '停用',
- 'kw' => 'EVENT_DISPLAY_HIDE',
- ),
- self::EVENT_DISPLAY_UNFINISHED => array(
- 'desc' => '未设置完成',
- 'kw' => 'EVENT_DISPLAY_UNFINISHED',
- ),
-
- );
-
- /**
- * 活动发布状态
- * @return array
- */
- public static function getDisplay() {
- return self::$display;
- }
-
-
- /**
- * LIST_DISPLAY_HIDE 列表中隐藏
- * @var int
- */
- const LIST_DISPLAY_HIDE = 0;
-
- /**
- * LIST_DISPLAY_SHOW 列表中显示
- * @var int
- */
- const LIST_DISPLAY_SHOW = 1;
-
- public static $listDisplay= array(
- self::LIST_DISPLAY_HIDE => array(
- 'desc' => '不出现',
- 'kw' => 'LIST_DISPLAY_HIDE',
- ),
- self::LIST_DISPLAY_SHOW => array(
- 'desc' => '出现',
- 'kw' => 'LIST_DISPLAY_SHOW',
- )
- );
- /**
- * 活动列表中显示状态
- * @return array
- */
- public static function getListDisplay() {
- return self::$listDisplay;
- }
- /**
- * FOCUS_DISPLAY_HIDE 不推荐到焦点图
- * @var int
- */
- const FOCUS_DISPLAY_HIDE = 1;
-
- /**
- * FOCUS_DISPLAY_SHOW 推荐到焦点图
- * @var int
- */
- const FOCUS_DISPLAY_SHOW = 2;
-
- public static $focusDisplay= array(
- self::FOCUS_DISPLAY_HIDE => array(
- 'desc' => '不推荐',
- 'kw' => 'FOCUS_DISPLAY_HIDE',
- ),
- self::FOCUS_DISPLAY_SHOW => array(
- 'desc' => '推荐',
- 'kw' => 'FOCUS_DISPLAY_SHOW',
- )
- );
- /**
- * 推荐到焦点图
- * @return array
- */
- public static function getFocusDisplay() {
- return self::$focusDisplay;
- }
- /**
- * TOP_DISPLAY_HIDE 是否置顶
- * @var int
- */
- const TOP_DISPLAY_HIDE = 1;
-
- /**
- * TOP_DISPLAY_SHOW 是否置顶
- * @var int
- */
- const TOP_DISPLAY_SHOW = 2;
-
- public static $topDisplay= array(
- self::TOP_DISPLAY_HIDE => array(
- 'desc' => '不置顶',
- 'kw' => 'TOP_DISPLAY_HIDE',
- ),
- self::TOP_DISPLAY_SHOW => array(
- 'desc' => '置顶',
- 'kw' => 'TOP_DISPLAY_SHOW',
- )
- );
- /**
- * 是否置顶
- * @return array
- */
- public static function getTopDisplay() {
- return self::$topDisplay;
- }
-
-
- /**
- * NOT_DEL 未删除
- * @var int
- */
- const NOT_DEL = 1;
-
- /**
- * IS_NOT_DEL 已删除
- * @var int
- */
- const IS_DEL = 2;
-
- public static $del= array(
- self::NOT_DEL => array(
- 'desc' => '未删除',
- 'kw' => 'NOT_DEL',
- ),
- self::IS_DEL => array(
- 'desc' => '已删除',
- 'kw' => 'IS_DEL',
- )
- );
-
- /**
- * 获取活动是否被管理员删除状态
- * @return array
- */
- public static function getDel() {
- return self::$del;
- }
-
- /**
- * EVENT_AUTHORIZE_TRUE 需要登录
- * @var int
- */
- const EVENT_AUTHORIZE_TRUE = 1;
- /**
- * EVENT_AUTHORIZE_FALSE 不需要登录
- * @var int
- */
- const EVENT_AUTHORIZE_FALSE = 0;
-
- public static $authorize= array(
- self::EVENT_AUTHORIZE_TRUE => array(
- 'desc' => '需要登录',
- 'kw' => 'EVENT_AUTHORIZE_TRUE',
- ),
- self::EVENT_AUTHORIZE_FALSE => array(
- 'desc' => '不需要登录',
- 'kw' => 'EVENT_AUTHORIZE_FALSE',
- ),
- );
-
-
- /**
- * 是否需要登录
- * @return array
- */
- public static function getAuthorize() {
- return self::$authorize;
- }
-
- /**
- * MUSIC_POSITION_LEFT 左上角
- * @var int
- */
- const MUSIC_POSITION_LEFT = 0;
-
- /**
- * MUSIC_POSITION_RIGHT 右上角
- * @var int
- */
- const MUSIC_POSITION_RIGHT = 1;
-
- public static $musicPosition = array(
- self::MUSIC_POSITION_LEFT=> array(
- 'desc' => '左上角',
- 'kw' => 'MUSIC_POSITION_LEFT',
- ),
- self::MUSIC_POSITION_RIGHT=> array(
- 'desc' => '右上角',
- 'kw' => 'MUSIC_POSITION_RIGHT',
- ),
- );
-
- /**
- * 音乐图标位置
- * @return array
- */
- public static function getMusicPosition() {
- return self::$musicPosition;
- }
-
-
- /**
- * TYPE_EVENTS_NULL 未设置
- * @var int
- */
- const TYPE_EVENTS_NULL = 0;
-
-
- /**
- * TYPE_EVENTS_TURNTABLE 转盘
- * @var int
- */
- const TYPE_EVENTS_TURNTABLE = 1;
-
- /**
- * TYPE_EVENTS_SCRATCH 刮刮卡
- * @var int
- */
- const TYPE_EVENTS_SCRATCH = 2;
-
- /**
- * TYPE_EVENTS_LETTERS 收集字母
- * @var int
- */
- const TYPE_EVENTS_LETTERS = 3;
-
- /**
- * TYPE_EVENTS_TRY 试用
- * @var int
- */
- const TYPE_EVENTS_TRY = 4;
-
- /**
- * TYPE_EVENTS_VOTE 投票
- * @var int
- */
- const TYPE_EVENTS_VOTE = 5;
-
- /**
- * TYPE_EVENTS_INVITATION 邀请函
- * @var int
- */
- const TYPE_EVENTS_INVITATION = 6;
-
- /**
- * TYPE_EVENTS_CODE 领券
- * @var int
- */
- const TYPE_EVENTS_CODE = 7;
-
- /**
- * TYPE_EVENTS_OTHER 其他
- * @var int
- */
- const TYPE_EVENTS_OTHER = 8;
-
- /**
- * TYPE_EVENTS_ARTICLE 文章
- * @var int
- */
- const TYPE_EVENTS_ARTICLE = 9;
-
- /**
- * TYPE_EVENTS_CUT_SCREEN 切屏专题
- * @var int
- */
- const TYPE_EVENTS_CUT_SCREEN = 10;
-
- /**
- * TYPE_EVENTS_SURVEY 问卷调查
- * @var int
- */
- const TYPE_EVENTS_SURVEY = 11;
-
-
-
- public static $type = array(
- // self::TYPE_EVENTS_NULL => array(
- // 'desc' => '未设置',
- // 'kw' => 'TYPE_EVENTS_NULL',
- // ),
-
- self::TYPE_EVENTS_TURNTABLE => array(
- 'desc' => '抽奖',
- 'kw' => 'TYPE_EVENTS_TURNTABLE',
- 'lottery' => true,
- 'restrictions' => true,
- 'pageRoutine' => true,
- 'c' => 'EventsTurntable',
- ),
- // self::TYPE_EVENTS_SCRATCH => array(
- // 'desc' => '刮刮卡',
- // 'kw' => 'TYPE_EVENTS_SCRATCH',
- // 'lottery' => true,
- // 'restrictions' => true,
- // 'pageRoutine' => true,
- // 'c' => 'EventsScratch',
- // ),
- // self::TYPE_EVENTS_LETTERS => array(
- // 'desc' => '收集字母',
- // 'kw' => 'TYPE_EVENTS_LETTERS',
- // 'lottery' => true,
- // 'restrictions' => true,
- // 'pageRoutine' => true,
- // 'c' => 'EventsLetters',
- // ),
- self::TYPE_EVENTS_TRY => array(
- 'desc' => '试用',
- 'kw' => 'TYPE_EVENTS_TRY',
- 'form' => true,
- 'restrictions' => true,
- 'pageRoutine' => true,
- 'c' => 'EventsTry',
- ),
- self::TYPE_EVENTS_VOTE => array(
- 'desc' => '投票',
- 'kw' => 'TYPE_EVENTS_VOTE',
- 'vote' => true,
- 'restrictions' => true,
- 'pageRoutine' => true,
- 'c' => 'EventsVote',
- ),
- self::TYPE_EVENTS_INVITATION => array(
- 'desc' => '邀请函',
- 'kw' => 'TYPE_EVENTS_INVITATION',
- 'form' => true,
- 'restrictions' => true,
- 'pageRoutine' => true,
- 'c' => 'EventsInvitation',
- ),
- self::TYPE_EVENTS_CODE => array(
- 'desc' => '优惠券',
- 'kw' => 'TYPE_EVENTS_CODE',
- 'form' => true,
- 'code' => true,
- 'restrictions' => true,
- 'pageRoutine' => true,
- 'c' => 'EventsCode',
- ),
- self::TYPE_EVENTS_ARTICLE => array(
- 'desc' => '文章',
- 'kw' => 'TYPE_EVENTS_ARTICLE',
- 'article' =>true,
- 'c' => 'EventsArticle',
- ),
- self::TYPE_EVENTS_CUT_SCREEN => array(
- 'desc' => '切屏专题',
- 'kw' => 'TYPE_EVENTS_CUT_SCREEN',
- 'cut_screen' => true,
- 'c' => 'EventsCutScreen',
- ),
- self::TYPE_EVENTS_OTHER => array(
- 'desc' => '链接',
- 'kw' => 'TYPE_EVENTS_OTHER',
- 'jumpUrl' => true,
- 'c' => 'EventsOther',
- ),
- self::TYPE_EVENTS_SURVEY => array(
- 'desc' => '问卷调查',
- 'kw' => 'TYPE_EVENTS_SURVEY',
- 'form' => true,
- 'restrictions' => true,
- 'pageRoutine' => true,
- 'c' => 'EventsSurvey',
- ),
-
- );
-
- /**
- * 获取活动路由规则
- */
- static public function getEventRoute(){
- return array(
- 'a' => 'EventsTurntable',
- 'b' => 'EventsScratch',
- 'c' => 'EventsTry',
- 'd' => 'EventsVote',
- 'e' => 'EventsInvitation',
- 'f' => 'EventsCode',
- 'g' => 'EventsArticle',
- 'h' => 'EventsCutScreen',
- 'y' => 'EventsOther',
- 'z' => 'EventsSurvey'
- );
- }
-
-
-
- /**
- * 活动 大类型 配置
- *
- * @retrun array
- */
- public function getBigTypeConfig(){
- return array(
- 'H5' => array(
- self::TYPE_EVENTS_ARTICLE,
- ),
- 'Event' => array(
- self::TYPE_EVENTS_TURNTABLE,
- // self::TYPE_EVENTS_SCRATCH,
- self::TYPE_EVENTS_TRY,
- self::TYPE_EVENTS_SURVEY,
- self::TYPE_EVENTS_VOTE,
- self::TYPE_EVENTS_INVITATION,
- self::TYPE_EVENTS_CODE
- ),
- 'Article' => array(
- self::TYPE_EVENTS_CUT_SCREEN,
- )
- );
- }
-
- public function getBigType($type) {
- $bigTypes = self::getBigTypeConfig();
- if (!$bigTypes) {
- return false;
- }
-
- foreach ($bigTypes as $bigType => $tmpTypes) {
- if (!in_array($type, $tmpTypes)) {
- continue;
- }
-
- return $bigType;
- }
-
- return false;
- }
-
- /**
- * 获取活动类型
- * @return array
- */
- public static function getType() {
- return self::$type;
- }
-
- /**
- * [领券活动] 是否是二维码输出 [是]
- */
- const TWO_DIMENSIONAL_CODE_TRUE = 1;
-
- /**
- * [领券活动] 是否是二维码输出 [否]
- */
- const TWO_DIMENSIONAL_CODE_FALSE = 2;
-
- public static $twoDimensionalCodeType= array(
- self::TWO_DIMENSIONAL_CODE_TRUE => array(
- 'desc' => '是',
- 'kw' => 'TWO_DIMENSIONAL_CODE_TRUE',
- ),
- self::TWO_DIMENSIONAL_CODE_FALSE => array(
- 'desc' => '否',
- 'kw' => 'TWO_DIMENSIONAL_CODE_FALSE',
- ),
- );
-
- /**
- * 获取 [领券活动] 是否是二维码输出 类型
- * @return array
- */
- public static function getTwoDimensionalCodeType() {
- return self::$twoDimensionalCodeType;
- }
-
- /**
- * EVENT_VOTE_TEXT [投票活动] 文字类型
- * @var int
- */
- const EVENT_VOTE_TEXT = 1;
- /**
- * EVENT_VOTE_IMG [投票活动]图文类型
- * @var int
- */
- const EVENT_VOTE_IMG = 2;
-
-
- public static $voteType= array(
- self::EVENT_VOTE_TEXT => array(
- 'desc' => '文字类型',
- 'kw' => 'EVENT_VOTE_TEXT',
- ),
- self::EVENT_VOTE_IMG => array(
- 'desc' => '图文类型',
- 'kw' => 'EVENT_VOTE_IMG',
- ),
- );
-
- /**
- * 获取 [投票活动]类型
- * @return array
- */
- public static function getVoteType() {
- return self::$voteType;
- }
-
-
- /**
- * DELIVERY_FALSE [未发货]
- * @var int
- */
- const DELIVERY_FALSE = 1;
- /**
- * DELIVERY_TRUE [已经发货]
- * @var int
- */
- const DELIVERY_TRUE = 2;
-
-
- public static $deliveryType= array(
- self::DELIVERY_FALSE => array(
- 'desc' => '未发货',
- 'kw' => 'DELIVERY_FALSE',
- ),
- self::DELIVERY_TRUE => array(
- 'desc' => '已经发货',
- 'kw' => 'DELIVERY_TRUE',
- ),
- );
-
- /**
- * 获取 发货状态
- * @return array
- */
- public static function getDeliveryType() {
- return self::$deliveryType;
- }
-
- /**
- * SHARE_BUTTON_FALSE [不显示分享按钮]
- * @var int
- */
- const SHARE_BUTTON_FALSE = 1;
- /**
- * SHARE_BUTTON_TRUE [显示分享按钮]
- * @var int
- */
- const SHARE_BUTTON_TRUE = 2;
-
-
- public static $shareButton= array(
- self::SHARE_BUTTON_FALSE => array(
- 'desc' => '不显示',
- 'kw' => 'SHARE_BUTTON_FALSE',
- ),
- self::SHARE_BUTTON_TRUE => array(
- 'desc' => '显示',
- 'kw' => 'SHARE_BUTTON_TRUE',
- ),
- );
-
- /**
- * 获取 是否显示分享按钮
- * @return array
- */
- public static function getShareButton() {
- return self::$shareButton;
- }
- /**
- * TOP_DATA_FALSE [不显示顶部数据栏目]
- * @var int
- */
- const TOP_DATA_FALSE = 1;
- /**
- * TOP_DATA_TRUE [显示顶部数据栏目]
- * @var int
- */
- const TOP_DATA_TRUE = 2;
-
-
- public static $topData= array(
- self::TOP_DATA_FALSE => array(
- 'desc' => '不显示',
- 'kw' => 'TOP_DATA_FALSE',
- ),
- self::TOP_DATA_TRUE => array(
- 'desc' => '显示',
- 'kw' => 'TOP_DATA_TRUE',
- ),
- );
-
- /**
- * 获取 是否显示分享按钮
- * @return array
- */
- public static function getTopData() {
- return self::$topData;
- }
- /**
- * BUY_BUTTON_FALSE [是否显示导购按钮]
- * @var int
- */
- const BUY_BUTTON_FALSE = 1;
- /**
- * BUY_BUTTON_TRUE [是否显示导购按钮]
- * @var int
- */
- const BUY_BUTTON_TRUE = 2;
-
-
- public static $buyButton= array(
- self::BUY_BUTTON_FALSE => array(
- 'desc' => '不显示',
- 'kw' => 'BUY_BUTTON_FALSE',
- ),
- self::BUY_BUTTON_TRUE => array(
- 'desc' => '显示',
- 'kw' => 'BUY_BUTTON_TRUE',
- ),
- );
-
- /**
- * 获取 是否显示导购按钮
- * @return array
- */
- public static function getBuyButton() {
- return self::$buyButton;
- }
-
- }
|