init: import production code mss.nahaichuan.com (exclude Runtime/Uploads/backups/logs)

这个提交包含在:
Developer
2026-10-30 10:18:50 +08:00
当前提交 1f3e0ce2f6
共有 9291 个文件被更改,包括 1776674 次插入 和 0 次删除

查看文件

@@ -0,0 +1,67 @@
<?php
namespace Common\Model;
//[1.8.68]
/**
* 普通用户领取的优惠券记录表
* Class RetailCouponLogsModel
* @package Common\Model
*/
class RetailCouponLogsModel extends BaseModel
{
protected $tableName = 'retail_coupon_logs';
const ID = 'id'; //int(11) NOT NULL AUTO_INCREMENT,
const COUPON_ID = 'coupon_id'; //int(11) DEFAULT NULL COMMENT '用户领取的优惠券id',
const UID = 'uid'; //int(11) DEFAULT NULL COMMENT '用户id',
const STORE_ID = 'storeid'; //int(11) DEFAULT NULL COMMENT '门店id',
const MERCHANT_ID = 'merchantid'; //int(11) DEFAULT NULL COMMENT '商户id ',
const ADD_TIME = 'addtime'; //varchar(18) DEFAULT NULL COMMENT '领取时间',
const STATUS = 'status'; //tinyint(3) DEFAULT '1' COMMENT '用户领取得优惠券状态 1:未使用 2:已使用',
const USE_TIME = 'usetime'; //varchar(18) DEFAULT NULL COMMENT '使用时间',
/**
* 获取已领取的优惠券的详细情况
* @param $where
* @param $field
* @param string $order
* @param $page
* @return mixed
*/
public function getCoupon($where, $field, $order = 'c.end_time', $page = '')
{
if ($page) {
$coupon = $this->alias('l')
->join("ls_retail_coupon as c ON c.id=l.coupon_id")
->field($field)
->where($where)
->order($order)
->page($page)
->select();
} else {
$coupon = $this->alias('l')
->join("ls_retail_coupon as c ON c.id=l.coupon_id")
->field($field)
->where($where)
->order($order)
->select();
}
return $coupon;
}
/**
* 获取已领取的优惠券的数量
* @param $where
* @return mixed
*/
public function getCouponCount($where)
{
$count = $coupon = $this->alias('l')
->join("ls_retail_coupon as c ON c.id=l.coupon_id")
->where($where)
->count();
return $count;
}
}