pushCriteria(app(RequestCriteria::class)); } public function addNew($data) { return $this->model->create($data); } /**积分操作明细 * @param $uid * @param $utype * @return mixed */ public function getMembersHandsel($uid, $utype, $type) { $where['uid'] = $uid; $where['utype'] = $utype; if ($type != 3) { $where['operate'] = $type; } return $this->model->where($where)->orderBy('created_at', 'desc')->paginate(10, ['*']); } public function getNum($user, $type = 1) { $where['uid'] = $user->id; $where['utype'] = $user->utype; $where['operate'] = $type; return $this->model->where($where)->selectRaw('sum(points)as getTotalPoints')->get(); } }