初始化项目:添加后端代码、ThinkPHP框架、前端资源
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
<?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();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user