37 lines
993 B
PHP
37 lines
993 B
PHP
<?php
|
|
|
|
namespace app\admin\model\data;
|
|
|
|
use think\Model;
|
|
|
|
|
|
class Order extends Model
|
|
{
|
|
|
|
|
|
// 表名
|
|
protected $name = 'order';
|
|
|
|
// 自动写入时间戳字段
|
|
protected $autoWriteTimestamp = 'integer';
|
|
|
|
// 定义时间戳字段名
|
|
protected $createTime = 'createtime';
|
|
protected $updateTime = false;
|
|
protected $deleteTime = false;
|
|
|
|
|
|
/**
|
|
* 获取时间区间内的支付人数
|
|
* @param $startTime
|
|
* @param $endTime
|
|
* @return void
|
|
*/
|
|
public function getTimeRangePayUserCount($startTime,$endTime){
|
|
return self::where([
|
|
'createtime'=>['between',[$startTime,$endTime]],
|
|
'status'=>['in',[\app\common\constant\order\Status::STATUS_PAID,\app\common\constant\order\Status::STATUS_UNRECEIVE,\app\common\constant\order\Status::STATUS_UNSEND,\app\common\constant\order\Status::STATUS_SUREUNRECEIVE,\app\common\constant\order\Status::STATUS_SUCCESS]]
|
|
])->group('user_id')
|
|
->count();
|
|
}
|
|
} |