コード例 #1
0
ファイル: ActivityController.php プロジェクト: suyuanen/p2p
 public function actionIndex()
 {
     $model = Post::find()->orderBy('id desc')->all();
     foreach ($model as $k => $v) {
         $model[$k]['created_at'] = date("Y-m-d h:i:s", $v['created_at']);
         $model[$k]['updated_at'] = date("Y-m-d h:i:s", $v['updated_at']);
         $model[$k]['status'] = Post::get_record_status($v['status']);
     }
     return $model;
 }
コード例 #2
0
ファイル: SiteController.php プロジェクト: suyuanen/p2p
 public function actionInformation()
 {
     if (($moneyModel = Invest::findByLately(Invest::TYPE_MONEY)) !== null) {
         $inverstOfMoney = Utils::timeCut($moneyModel->buy_time_start, time());
     } else {
         $inverstOfMoney = '未发布';
     }
     if (($emoneyModel = Invest::findByLately(Invest::TYPE_EXPERIENCE_MONEY)) !== null) {
         $inverstOfeMoney = Utils::timeCut($emoneyModel->buy_time_start, time());
     } else {
         $inverstOfeMoney = '未发布';
     }
     try {
         $jiuxinInfo = JiuxinApi::jiuxinGet();
         $row = wanhunet::app()->member->getOtherInfo(MemberOther::TABLE_JIUXIN)->row;
         $jiuxinInfo['j_user_name'] = current(explode('=|=', $row));
     } catch (\Exception $e) {
         $jiuxinInfo = [];
         //
         //            if ($e->getCode() == ErrorCode::Jiuxin_auth) {
         //                $jiuxinInfo = [];
         //            } else {
         //            }
     }
     return $this->view('information', ['inverstOfMoney' => $inverstOfMoney, 'inverstOfeMoney' => $inverstOfeMoney, 'jiuxinInfo' => $jiuxinInfo, 'actives' => Post::find()->where(['status' => Post::STATUS_ACTIVE])->orderBy('id desc')->all()]);
 }