Commit 2662808c authored by clone's avatar clone

bug

parent fdc1ba60
......@@ -58,10 +58,10 @@ class Activity extends Basic
$total = $params["total"];
$available = $params["available"];
$activity_rule = $params["activity_rule"];
if(($return_action == 0 || $return_action == 1) && $return_type != 0){
if (($return_action == 0 || $return_action == 1) && $return_type != 0) {
return $this->response("101", "奖励动作为首次或邀请登陆,奖励类型必须为返现红包");
}
if( $return_type == 1 && $use_period > 0){
if ($return_type == 1 && $use_period > 0) {
return $this->response("101", "奖励类型为现金的奖励有效期必须为永久");
}
......@@ -116,7 +116,10 @@ class Activity extends Basic
}
$where_["status"] = array("neq", 4);
$list = $activityModel->getActivityList($field, $where_, $pageNo, $pageSize);
return $this->response("200", "success", $list);
$count = $activityModel->getActivityCount($field, $where_);
$result["list"] = $list;
$result["total"] = $count;
return $this->response("200", "success", $result);
}
......
......@@ -89,6 +89,20 @@ class CActivity extends Model
return $result;
}
/**
* @param $field
* @param $params
* @return int|string
*/
public function getActivityCount($field,$params)
{
$result = $this->db_
->field($field)
->where($params)
->count();
return $result;
}
/**
* 更新
* @param $activity_id
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment