Exemplo n.º 1
0
 public function checkSellerNameIsExist($sellerName)
 {
     $seller = Seller::find()->where(array('sellerName' => $sellerName))->one();
     if ($seller) {
         return new static($seller);
     }
     return false;
 }
 public function actionSeller()
 {
     $user = new AdminUser();
     if (!$user->checkUserIsLogin()) {
         $this->redirect(Variable::$home_url);
         return;
     }
     $query = Seller::findBySql('select se.id,se.sellerName,se.sellerBrief,se.sellerLogo,se.sellerProvince,se.sellerCity,se.contacts,se.phone,ar1.name  "prvince",ar2.name "city" from mp_seller se LEFT JOIN mp_area ar1 ON se.sellerProvince=ar1.id LEFT JOIN mp_area ar2 ON se.sellerCity=ar2.id   ')->all();
     $pagination = new Pagination(['defaultPageSize' => 8, 'totalCount' => Seller::find()->count()]);
     $countries = Seller::find()->orderBy('registerTime DESC')->offset($pagination->offset)->limit($pagination->limit)->all();
     return $this->render(Variable::$sellerManger_view, ['countries' => $countries, 'pagination' => $pagination]);
 }