Exemplo n.º 1
0
 public function save(Request $request)
 {
     $sid = Session::get('session_id');
     $name = Input::get('name');
     $phone = Input::get('phone');
     $address = Input::get('address');
     $weixin_no = Input::get('weixin_no');
     $blog = Input::get('blog');
     $weibo = Input::get('weibo');
     $company = Input::get('company');
     $jobs = Input::get('jobs');
     $city = Input::get('city');
     $country = Input::get('country');
     $title = Input::get('title');
     $email = Input::get('email');
     $content = 'Hi,我的名字是' . $name . ',目前在' . $company . '工作,任职为' . $jobs;
     $user = Models\User::find($sid);
     $user->name = $name;
     $user->phone = $phone;
     $user->address = $address;
     $user->save();
     $user_info = Models\User_info::find($sid);
     $user_info->title = $title;
     $user_info->company = $company;
     $user_info->jobs = $jobs;
     $user_info->email = $email;
     $user_info->city = $city;
     $user_info->country = $country;
     $user_info->about_no = $sid;
     $user_info->save();
     $about = Models\About::find($sid);
     $about->name = $name;
     $about->content = $content;
     $about->main_email = $email;
     $about->blog = $blog;
     $about->weibo = $weibo;
     $about->weixin_no = $weixin_no;
     $about->save();
     // print_r(Input::all());
     return view('admin.about.index')->with('nav_class', 'start active');
 }
Exemplo n.º 2
0
 public function actionGroupAllow($groupid, $userid, $isallow = 0)
 {
     $session = Yii::$app->session;
     $i = 0;
     if (empty($session['user'])) {
         echo '请' . Html::tag('a', '登陆', ['href' => '?r=forum/lee-login']);
     } else {
         foreach ($session['groupid'] as $g) {
             if ($g == $groupid && $session['property'][$i] == 0) {
                 if ($isallow == 1) {
                     $groupmem = new Group_mem();
                     $groupmem->userid = $userid;
                     $groupmem->groupid = $groupid;
                     $groupmem->property = 1;
                     $groupmem->username = User_info::findOne($userid)['name'];
                     $groupmem->save();
                     GroupManage::deleteAll(['groupid' => $groupid, 'userid' => $userid]);
                     return $this->redirect('?r=forum/group');
                 }
             }
             ++$i;
         }
     }
 }