1.提交缺失的东西
This commit is contained in:
@ -88,6 +88,6 @@ class SignController extends BaseApiController
|
||||
*/
|
||||
public function rule(){
|
||||
$rule = ConfigServer::get('sign_rule','instructions','');
|
||||
$this->_success('获取成功',$rule);
|
||||
$this->success('获取成功',$rule);
|
||||
}
|
||||
}
|
||||
@ -134,7 +134,7 @@ class SignLogic
|
||||
|
||||
$today_order_award = Db::name('account_log')
|
||||
->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();
|
||||
$make_inegral[] = [
|
||||
'name' => '下单任意商品',
|
||||
@ -147,7 +147,7 @@ class SignLogic
|
||||
if($invited_award_integral > 0){
|
||||
$total_invited_award = Db::name('account_log')
|
||||
->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();
|
||||
$make_inegral[] = [
|
||||
'name' => '成功邀请1位好友',
|
||||
@ -176,7 +176,7 @@ class SignLogic
|
||||
->where(['del'=>0,'user_id'=>$user_id])
|
||||
->order('id desc')
|
||||
->find();
|
||||
$now = date("Y-m-d");
|
||||
$now = time();
|
||||
$total_integral = 0; //签到赠送的积分
|
||||
$total_growth = 0; //签到赠送的成长值
|
||||
$continuous_integral = 0; //连续签到积分
|
||||
|
||||
@ -48,26 +48,29 @@ trait TimeFieldQuery
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询日期或者时间.
|
||||
*
|
||||
* @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')
|
||||
|
||||
public function whereTime($field, $op, $range = null, $logic = 'AND')
|
||||
{
|
||||
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' : '>=';
|
||||
}
|
||||
|
||||
return $this->parseWhereExp($logic, $field, strtolower($op) . ' time', $range, [], true);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询某个时间间隔数据.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user