文件
mashangyoujiu/Application/Common/Model/RetailGiftCardModel.class.php

32 行
1.2 KiB
PHP
可执行文件

<?php
namespace Common\Model;
//[1.2.41]
class RetailGiftCardModel extends BaseModel
{
protected $tableName = 'gift_card';
const ID = 'id'; //int(11) NOT NULL AUTO_INCREMENT,
const MERCHANT_ID = 'merchantid'; //int(11) DEFAULT NULL COMMENT '商户id',
const TITLE = 'title'; //varchar(20) DEFAULT NULL COMMENT '礼品卡标题',
const START_TIME = 'start_time'; //varchar(255) DEFAULT NULL COMMENT '启用时间',
const END_TIME = 'end_time'; //varchar(255) DEFAULT NULL COMMENT '停用时间',
const ADD_TIME = 'addtime'; //varchar(11) DEFAULT NULL COMMENT '添加时间',
const STATUS = 'status'; //tinyint(1) DEFAULT '0' COMMENT '0不启用 1启用',
const STATE = 'state'; //tinyint(1) DEFAULT '1' COMMENT '1正常 0删除',
const NOTES = 'notes'; //text COMMENT '使用须知',
/*
*礼品卡价格图片连表查
*/
public function getGiftDetail($where,$field)
{
$gift = $this->alias('g')
->join('ls_gift_card_cover as c on c.gift_cardid=g.'.$this::ID)
->join('ls_gift_card_price as p on p.gift_cardid=g.'.$this::ID)
->where($where)
->field($field)
->find();
return $gift;
}
}