18 lines
		
	
	
		
			396 B
		
	
	
	
		
			PHP
		
	
	
		
		
			
		
	
	
			18 lines
		
	
	
		
			396 B
		
	
	
	
		
			PHP
		
	
	
| 
								 | 
							
								<?php
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								namespace app\traits\account;
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								use app\model\AccountDataLog;
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								trait AccountDataLogTrait
							 | 
						||
| 
								 | 
							
								{
							 | 
						||
| 
								 | 
							
								    /*
							 | 
						||
| 
								 | 
							
								     * 后台统计当天积分使用数量
							 | 
						||
| 
								 | 
							
								     * */
							 | 
						||
| 
								 | 
							
								    public function todayScoreConsumptionCount()
							 | 
						||
| 
								 | 
							
								    {
							 | 
						||
| 
								 | 
							
								        return abs(AccountDataLog::whereBetweenTime("created_at", date("Y-m-d 00:00:00"), date("Y-m-d 23:59:59"))
							 | 
						||
| 
								 | 
							
								            ->where("num", "<", 0)
							 | 
						||
| 
								 | 
							
								            ->sum("num"));
							 | 
						||
| 
								 | 
							
								    }
							 | 
						||
| 
								 | 
							
								}
							 |