38 行
2.1 KiB
PHP
可执行文件
38 行
2.1 KiB
PHP
可执行文件
<?php
|
|
|
|
namespace Common\Model;
|
|
//[1.2.41]
|
|
class RetailGiftCardRecordModel extends BaseModel
|
|
{
|
|
protected $tableName = 'gift_card_record';
|
|
const ID = 'id'; //int(11) NOT NULL AUTO_INCREMENT,
|
|
const XCX_VID = 'xcx_vid'; //int(11) DEFAULT NULL COMMENT '小程序会员id',
|
|
const MERCHANT_ID = 'merchantid'; //int(11) DEFAULT NULL COMMENT '商户id',
|
|
const GIFT_ID = 'gift_id'; //int(11) DEFAULT NULL COMMENT '礼品卡id',
|
|
const GIFT_COVER_ID = 'gift_cover_id'; //int(11) DEFAULT NULL COMMENT '礼品卡样式id',
|
|
const GIFT_PRICE_ID = 'gift_price_id'; //int(11) DEFAULT NULL COMMENT '礼品卡金额id',
|
|
const ADD_TIME = 'addtime'; //varchar(11) DEFAULT NULL COMMENT '添加时间',
|
|
const STATUS = 'status'; //tinyint(1) DEFAULT '0' COMMENT '0未使用 1已使用',
|
|
const STATUS_TYPE = 'status_type'; //tinyint(1) DEFAULT '1' COMMENT '1是用户的 2用户已赠送别人',
|
|
const TYPE = 'type'; //tinyint(1) DEFAULT '1' COMMENT '1自己购买 2别人赠送',
|
|
const START_TIME = 'start_time'; //varchar(11) DEFAULT NULL COMMENT '礼品卡可用开始时间',
|
|
const END_TIME = 'end_time'; //varchar(11) DEFAULT NULL COMMENT '礼品卡到期时间',
|
|
const MONEY = 'money'; //decimal(10,2) DEFAULT NULL COMMENT '礼品卡面值',
|
|
const PRICE = 'price'; //decimal(10,2) DEFAULT NULL COMMENT '礼品卡售价',
|
|
const STATE = 'state'; //tinyint(1) DEFAULT '0' COMMENT '0未成功购买 1已成功购买',
|
|
const P_XCX_VID = 'p_xcx_vid'; //int(11) DEFAULT NULL COMMENT '小程序转增者id',
|
|
const RECHARGE_VID = 'recharge_vid'; //int(11) DEFAULT NULL COMMENT '充值到余额的会员id',
|
|
const GIFT_PID = 'gift_pid'; //int(11) DEFAULT NULL COMMENT '赠送者的礼品卡id',
|
|
const PAY_ORDER_ID = 'pay_order_id'; //int(11) DEFAULT NULL COMMENT 'pay_order_id',
|
|
|
|
public function getGiftCardDetails($where,$field,$order)
|
|
{
|
|
$gift = M('gift_card_record as r')
|
|
->join('ls_gift_card as g on r.gift_id=g.id')
|
|
->where($where)
|
|
->field($field)
|
|
->order($order)
|
|
->select();
|
|
return $gift;
|
|
}
|
|
} |