1.提交缺失的东西

This commit is contained in:
2025-05-15 15:36:23 +08:00
parent 20e3079bc3
commit 38cd2632f3
3 changed files with 20 additions and 17 deletions

View File

@ -88,6 +88,6 @@ class SignController extends BaseApiController
*/ */
public function rule(){ public function rule(){
$rule = ConfigServer::get('sign_rule','instructions',''); $rule = ConfigServer::get('sign_rule','instructions','');
$this->_success('获取成功',$rule); $this->success('获取成功',$rule);
} }
} }

View File

@ -134,7 +134,7 @@ class SignLogic
$today_order_award = Db::name('account_log') $today_order_award = Db::name('account_log')
->where(['user_id'=>$user_id,'source_type'=>AccountLog::order_add_integral]) ->where(['user_id'=>$user_id,'source_type'=>AccountLog::order_add_integral])
->whereTime('create_time',date("Y-m-d",$today_start),date("Y-m-d",$today_end)) ->whereTime('create_time',[$today_start,$today_end])
->find(); ->find();
$make_inegral[] = [ $make_inegral[] = [
'name' => '下单任意商品', 'name' => '下单任意商品',
@ -147,7 +147,7 @@ class SignLogic
if($invited_award_integral > 0){ if($invited_award_integral > 0){
$total_invited_award = Db::name('account_log') $total_invited_award = Db::name('account_log')
->where(['user_id'=>$user_id,'source_type'=>AccountLog::invite_add_integral]) ->where(['user_id'=>$user_id,'source_type'=>AccountLog::invite_add_integral])
->whereTime('create_time',date("Y-m-d",$today_start),date("Y-m-d",$today_end)) ->whereTime('create_time',[$today_start,$today_end])
->find(); ->find();
$make_inegral[] = [ $make_inegral[] = [
'name' => '成功邀请1位好友', 'name' => '成功邀请1位好友',
@ -176,7 +176,7 @@ class SignLogic
->where(['del'=>0,'user_id'=>$user_id]) ->where(['del'=>0,'user_id'=>$user_id])
->order('id desc') ->order('id desc')
->find(); ->find();
$now = date("Y-m-d"); $now = time();
$total_integral = 0; //签到赠送的积分 $total_integral = 0; //签到赠送的积分
$total_growth = 0; //签到赠送的成长值 $total_growth = 0; //签到赠送的成长值
$continuous_integral = 0; //连续签到积分 $continuous_integral = 0; //连续签到积分

View File

@ -48,26 +48,29 @@ trait TimeFieldQuery
return $this; return $this;
} }
/**
* 查询日期或者时间. public function whereTime($field, $op, $range = null, $logic = 'AND')
*
* @param string $field 日期字段名
* @param string $op 比较运算符或者表达式
* @param mixed $range 比较范围
* @param string $logic AND OR
*
* @return $this
*/
public function whereTime(string $field, string $op, $range = null, string $logic = 'AND')
{ {
if (is_null($range)) { if (is_null($range)) {
$range = $this->timeRule[$op] ?? $op; if (is_array($op)) {
$range = $op;
} else {
if (isset($this->timeExp[strtolower($op)])) {
$op = $this->timeExp[strtolower($op)];
}
if (isset($this->timeRule[strtolower($op)])) {
$range = $this->timeRule[strtolower($op)];
} else {
$range = $op;
}
}
$op = is_array($range) ? 'between' : '>='; $op = is_array($range) ? 'between' : '>=';
} }
return $this->parseWhereExp($logic, $field, strtolower($op) . ' time', $range, [], true); return $this->parseWhereExp($logic, $field, strtolower($op) . ' time', $range, [], true);
} }
/** /**
* 查询某个时间间隔数据. * 查询某个时间间隔数据.
* *