52 行
3.5 KiB
PHP
可执行文件
52 行
3.5 KiB
PHP
可执行文件
<?php
|
|
namespace Common\Model;
|
|
//[1.4.36]
|
|
/**
|
|
* 拼团
|
|
* Class RetailGroupModel
|
|
* @package Common\Model
|
|
*/
|
|
class RetailGroupModel extends BaseModel
|
|
{
|
|
protected $tableName = 'retail_spellgroup';
|
|
|
|
const ID = 'id'; // `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
|
const GID = 'gid'; // `gid` int(10) DEFAULT NULL COMMENT '商品id',
|
|
const STORE_ID = 'storeid'; // `storeid` int(10) DEFAULT NULL COMMENT '门店ID',
|
|
const MERCHANT_ID = 'merchantid'; // `merchantid` int(10) DEFAULT NULL COMMENT '商户id',
|
|
const GROUP_SKU_IDS = 'group_skuid'; // `group_skuid` varchar(255) DEFAULT NULL COMMENT '拼团规格id',
|
|
const ACT_NAME = 'actname'; // `actname` varchar(60) DEFAULT NULL COMMENT '活动名称',
|
|
const NUMBER = 'number'; // `number` int(10) DEFAULT NULL COMMENT '参团人数',
|
|
const START_TIME = 'starttime'; // `starttime` varchar(20) DEFAULT NULL COMMENT '活动开始时间',
|
|
const ENT_TIME = 'endtime'; // `endtime` varchar(20) DEFAULT NULL COMMENT '活动结束时间',
|
|
const DAY = 'day'; // `day` tinyint(3) DEFAULT NULL COMMENT '成团有效时间 天',
|
|
const HOUR = 'hour'; // `hour` tinyint(3) DEFAULT NULL COMMENT '成团有效时间 小时',
|
|
const MIN = 'min'; // `min` tinyint(3) DEFAULT NULL COMMENT '成团有效时间 分钟',
|
|
const ACT_TYPE = 'acttype'; // `acttype` tinyint(1) DEFAULT '1' COMMENT '活动状态:1.正常的活动2.取消的活动3.删除的活动',
|
|
const RULES = 'rules'; // `rules` tinyint(10) DEFAULT '1' COMMENT '商品限购 1.未开启2.开启',
|
|
const ITEM = 'item'; // `item` varchar(100) DEFAULT NULL COMMENT '每人限购多少',
|
|
const RISE_NUM = 'rise_num'; // `rise` decimal(10,3) DEFAULT NULL COMMENT '起购数量',
|
|
const ACT_PRICE = 'actprice'; // `actprice` decimal(10,2) DEFAULT NULL COMMENT '活动售价',
|
|
const ACT_NUM = 'actnum'; // `actnum` int(10) DEFAULT NULL COMMENT '活动库存',
|
|
const ADD_TIME = 'addtime'; // `addtime` varchar(20) DEFAULT NULL COMMENT '活动创建时间',
|
|
const ATTRIBUTE_STATE = 'attribute'; // `attribute` tinyint(1) DEFAULT '1' COMMENT '是否开启sku 1不开启 2开启',
|
|
const IS_CLUB_CARD = 'is_club_card'; // `is_club_card` tinyint(1) DEFAULT '1' COMMENT '是否允许会员卡购买 默认1.允许 2.不允许',
|
|
const SEND_TYPE = 'send_type'; // `send_type` tinyint(1) DEFAULT '0' COMMENT '0允许配送和自提 1允许自提 2允许配送',
|
|
const JOIN_TIME = 'join_time'; // `join_time` int(11) DEFAULT '1' COMMENT '0不限制 1,2,3...次数',
|
|
const TEAM_UP = 'team_up'; // `team_up` tinyint(3) DEFAULT '1' COMMENT '凑团 1.开启2.关闭',
|
|
const SELL_NUMBER = 'sell_number'; // 销售数量
|
|
const IS_RECOMMEND = 'is_recommend'; // 是否推荐
|
|
|
|
/**
|
|
* 拼团商品联查
|
|
*/
|
|
public function getFindGroupAndGoods($map, $field = '*')
|
|
{
|
|
$find = $this->alias('gr')
|
|
->join('ls_retail_goods as go on gr.' . $this::GID . '=go.id')
|
|
->field($field)
|
|
->where($map)
|
|
->find();
|
|
return $find;
|
|
}
|
|
} |