request->get(); $query = xhInvite::find(); $query->where(['merchantId' =>$this->merchantId]); $countQuery = clone $query; $count = $countQuery->count(); $page = isset($get['page']) ? $get['page'] : 1; $pageSize = 20; $offset = ($page - 1) * $pageSize; $models = $query->offset($offset)->orderBy('id desc')->limit($pageSize)->asArray()->all(); $page = new page($count,$page,$pageSize); $paging = $page->fpage(); $now = time(); return $this->render('list', ['models' => $models,'paging' => $paging]); } /** * 生成二维码 */ public function actionGenerate() { if(empty($this->merchant['agentLevel'])){ util::failInfo('您还不是代理商'); } $return = xhInviteService::generate($this->merchantId); util::encode($return); } }