39 行
2.2 KiB
PHP
可执行文件
39 行
2.2 KiB
PHP
可执行文件
<?php
|
||
|
||
namespace Common\Model;
|
||
//[1.3.43]
|
||
class RetailPlusRecordModel extends BaseModel
|
||
{
|
||
protected $tableName = 'retail_plus_record';
|
||
const ID = 'id'; //int(10) unsigned NOT NULL AUTO_INCREMENT,
|
||
const PAY_ORDER_ID = 'pay_order_id'; //varchar(50) DEFAULT '' COMMENT 'retail_pay_order id',
|
||
const MERCHANT_ID = 'merchantid'; //int(10) DEFAULT NULL COMMENT '商户id',
|
||
const STORE_ID = 'storeid'; //int(10) DEFAULT NULL COMMENT '门店id',
|
||
const XCX_UID = 'xcx_uid'; //int(10) DEFAULT NULL COMMENT '小程序用户id',
|
||
const VIP_ID = 'vip_id'; //int(10) DEFAULT NULL COMMENT '会员卡id',
|
||
const MONEY = 'money'; //decimal(10,2) DEFAULT NULL COMMENT '金额',
|
||
const PAY_STATE = 'pay_state'; //tinyint(1) DEFAULT '0' COMMENT '支付状态 0.未支付 1.已支付',
|
||
const PAY_TYPE = 'pay_type'; // tinyint(1) DEFAULT '0' COMMENT '支付状态 0 未支付 1.微信 2.会员 3支付宝 4现金 5其他',
|
||
const TYPE = 'type'; //tinyint(3) DEFAULT '0' COMMENT '1 成为购买 2 续费购买 3.成为充值 4.续费充值 5.购买商品 6购买套餐',
|
||
const GOODS_IDS = 'goods_ids'; //varchar(255) DEFAULT NULL COMMENT '购买商品成为付费会员对应商品id',
|
||
const PLUS_GROUP_ID = 'plus_group_id'; //int(11) DEFAULT '0' COMMENT '购买套餐组id成为plus会员',
|
||
const ADD_TIME = 'addtime'; //varchar(20) DEFAULT NULL COMMENT '订单生成时间',
|
||
const ACTIVITY_ID = 'activity_id'; //varchar(20) DEFAULT NULL COMMENT '直接购买或续费plus会员套餐id',
|
||
const BILL_ID = 'bill_id'; //varchar(20) DEFAULT NULL COMMENT '直接购买或续费plus会员套餐id',
|
||
const TIME = 'time'; //int(6) DEFAULT '0' COMMENT '获得plus会员时长(天)',
|
||
const PLUS_NAME = 'plus_name';// varchar(255) DEFAULT NULL COMMENT '注册plus会员时的姓名',
|
||
const PLUS_PHONE = 'plus_phone';// varchar(255) DEFAULT NULL COMMENT '注册plus会员时的手机号',
|
||
|
||
/*
|
||
* pay_order表和plus_record连表查
|
||
*/
|
||
public function getPlusOrder($where, $field)
|
||
{
|
||
$find = $this->alias('r')
|
||
->join('ls_retail_pay_order as o on o.id=r.' . $this::PAY_ORDER_ID)
|
||
->field($field)
|
||
->where($where)
|
||
->find();
|
||
return $find;
|
||
}
|
||
} |