当前位置: 首页>>代码示例>>PHP>>正文


PHP rq函数代码示例

本文整理汇总了PHP中rq函数的典型用法代码示例。如果您正苦于以下问题:PHP rq函数的具体用法?PHP rq怎么用?PHP rq使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了rq函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: index

 function index()
 {
     //验证权限,跳转提示页面
     if (!in_array(parent::visite_access, $this->admin_access)) {
         http::skip('message/login/forbid');
     }
     //接收请求参数
     $category = rq(2);
     //类型(1,已读/0,未读/全部)
     $page = rq(3, 1);
     //页码
     //获取删除和回复权限
     $del_access = in_array(parent::del_access, $this->admin_access);
     $reply_access = in_array(parent::reply_access, $this->admin_access);
     //调用查询模型
     $message = self::message_model($category, $page, 10);
     //处理分页导航
     $page_url = dc_url . 'manage/' . $category . '/';
     $page_nav = s_page::mark($page_url, $message['info'][0], $page, 3);
     //视图赋值
     $tpl = smarty('admin');
     $head['frame'] = '_self';
     $head['title'] = '留言管理_EQPHP案例留言本';
     $tpl->assign('head', $head);
     $tpl->assign('del_access', $del_access);
     $tpl->assign('reply_access', $reply_access);
     $tpl->assign('rs_count', $message['num']);
     $tpl->assign('message', $message['info'][1]);
     $tpl->assign('page_nav', $page_nav);
     //渲染视图模板
     $tpl->display('message/manage');
 }
开发者ID:art-youth,项目名称:framework,代码行数:32,代码来源:a_manage.php

示例2: reset_password

 /**
  * 重置密码
  * @return [type] [description]
  */
 public function reset_password()
 {
     $token = rq('token');
     $done = false;
     $errors = [];
     $expire = true;
     if (!$token) {
         abort(404);
     }
     $log = ILog::where('memo', $token)->first();
     if (!$log) {
         abort(404);
     }
     $at = Carbon::parse($log->at);
     $diff = $at->diffInHours(Carbon::now());
     if ($diff < 24) {
         $expire = false;
     }
     if (rq('reset') && Request::method() == 'POST' && !$expire) {
         $res = $this->reset($token, $log);
         if ($res['status']) {
             $done = true;
         } else {
             $errors = $res['errors'];
         }
     }
     return view('reset')->with(compact('token', 'log', 'errors', 'done', 'expire'));
 }
开发者ID:newset,项目名称:robot,代码行数:32,代码来源:IAuth.php

示例3: doctor

 public function doctor($p = null)
 {
     if (!he_is('doctor') && !rq()) {
         return view('page.doctor_login');
     }
     if (rq() && $p == 'login_check') {
         if (rq('user_type') == 'doctor') {
             $he = M('doctor')->where('cust_id', rq('cust_id'))->first();
             if (!$he) {
                 Session::flash('input_error', ['识别码有误']);
                 return redirect('doctor/login');
             } else {
                 log_him_in(['uid' => $he->id]);
                 add_chara(rq('user_type'));
                 return redirect('doctor/home');
             }
         }
     }
     $d = [];
     $appId = env('WECHAT_APPID');
     $secret = env('WECHAT_SECRET');
     $js = new Js($appId, $secret);
     $d['js'] = $js;
     switch ($p) {
         case 'history':
             $d['his_history'] = M('doctor')->get_his_history();
             break;
     }
     return view('page.doctor_' . $p, $d);
 }
开发者ID:newset,项目名称:robot,代码行数:30,代码来源:ShotController.php

示例4: login

 /**
  * 登入方法
  * @param null $input
  * @return array
  */
 public function login($input = null)
 {
     $input = $input ? $input : rq();
     if (!empty($input['user_type']) && $input['user_type'] == 'doctor' && !empty($input['cust_id'])) {
         $d = M('doctor');
         $d = $d->where('cust_id', $input['cust_id'])->first();
         if ($d) {
             log_him_in(['uid' => $d->id]);
             add_chara($input['user_type']);
             return ss();
         }
         return $d ? ss($d) : ee(2);
     }
     if (!empty($input['user_type']) && !empty($input['username']) && !empty($input['password'])) {
         $input['password'] = hash_password($input['password']);
         $user = $this->user_exists($input['user_type'], array_only($input, ['username', 'password']));
         if ($user) {
             log_him_in(['username' => $user->username, 'uid' => $user->id]);
             add_chara($input['user_type']);
             return ss();
         }
     } else {
         return ee(2);
     }
     return ee(2);
 }
开发者ID:hellopsm,项目名称:robot,代码行数:31,代码来源:AuthTrait.php

示例5: sync

 public function sync($params = '')
 {
     $rq = rq();
     $fields = ['address' => '', 'helpdeskNumber' => '1234567', "reportedDate" => 201501012020.0, "event" => 'CREATE', "customerName" => "Test Customer", "customerAccountNumber" => "995", "customerHelpdeskNumber" => '', "customerTimezone" => "UTC", "project" => '', "projectNumber" => '', "productSerialNumber" => "SN123123", "productTag" => "Store12Device5", "productSystem" => '', "productDescription" => "POS", "productCustomerSerialnumber" => '', "installedAddress1" => "Heinz-Nixdorf-Ring 1", "installedAddress2" => '', "installedAddress3" => '', "installedAddress4" => '', "installedCity" => "Paderborn", "installedState" => '', "installedPostalcode" => "33106", "installedCountry" => "DE", "installedContact" => '', 'installedPhone' => '', 'installedFax' => '', 'installedEmail' => '', "callerFirstName" => "John", "callerLastName" => "Doe", "callerPhone" => "+49525169330", "callerPhoneType" => "PHONE", "callerEmail" => "john.doe@wincor-nixdorf.com", 'callerPreferredLanguage' => '', 'callerPreferredComm' => '', "errorType" => "Partial Failure", "urgency" => "High", "summary" => "Display does not work", "customerErrorCode" => "ERROR12", 'problemCode' => '', "ordertext1" => "Device does not start and display is black.", "ordertext2" => "Further analysis required.", "customerKey" => "INT_WN", "status" => "New", "channel" => "HTTP", "replyAddress" => "http://customer.com/servlet", "ownerName" => "PL1 AGT IFSO", 'serviceRequestNumber' => '', 'transactionNumber' => '', "targetDate" => "201501031200", 'plannedEndCallback' => '', 'plannedStartFieldService' => '', 'plannedEndFieldService' => '', 'sparepartProposal' => '', 'preferredEngineer' => '', 'ServiceProviderID' => '', 'noteType' => '', 'noteContent' => ''];
     // 创建 ticket
     $xml = Formatter::make($fields, Formatter::XML)->toXml();
     return Response::make($xml, 200)->header('Content-Type', 'text/xml');
 }
开发者ID:newset,项目名称:gd,代码行数:8,代码来源:ITicket.php

示例6: u

 /**
  * 更新
  */
 public function u($rq = NULL)
 {
     $this->guarded = arr_except_vals($this->guarded, ['password']);
     if (!$rq) {
         $rq = rq();
     }
     return parent::u($rq);
 }
开发者ID:newset,项目名称:robot,代码行数:11,代码来源:IEmployee.php

示例7: r

 public function r()
 {
     if (!intval(rq('id'))) {
         ss('无效ID', 0);
     }
     $data = $this->find(rq('id'));
     $this->eventFire('r', $data);
     return ss($data);
 }
开发者ID:newset,项目名称:robot,代码行数:9,代码来源:IUsblog.php

示例8: delete

 public function delete()
 {
     $coso = self::$model->firstOrNew(rq('id'));
     if ($coso->exists) {
         $coso->update();
     } else {
     }
     self::response($coso);
 }
开发者ID:pspaulus,项目名称:MyBici_server,代码行数:9,代码来源:api.php

示例9: label_read

 function label_read()
 {
     //验证权限,跳转提示页面
     if (!in_array(parent::visite_access, $this->admin_access)) {
         http::skip('login/forbid');
     }
     $message_id = rq(3, 1);
     $data['is_view'] = 1;
     db::mod(parent::table, $data, $message_id);
     http::script(null, 'back_refresh');
 }
开发者ID:art-youth,项目名称:framework,代码行数:11,代码来源:a_act_manage.php

示例10: read

 public function read()
 {
     $id = rq('id');
     $data = $this->find($id);
     $res = 0;
     if ($data->recipientid == uid()) {
         $data->read = 1;
         $res = $data->save();
     }
     return ss($res);
 }
开发者ID:newset,项目名称:robot,代码行数:11,代码来源:IMessage.php

示例11: u

 /**
  * 更新
  */
 public function u($rq = null)
 {
     $this->guarded = arr_except_vals($this->guarded, ['password']);
     if (!$rq) {
         $rq = rq();
     }
     if (isset($rq['password'])) {
         $rq['password'] = hash_password($rq['password']);
     }
     return parent::u($rq);
 }
开发者ID:hellopsm,项目名称:robot,代码行数:14,代码来源:IEmployee.php

示例12: recover

 public function recover()
 {
     if (rq('id')) {
         $row = $this->find(rq('id'));
         $row->update(['status' => 1, 'wechat_id' => null]);
         $this->eventFire('recover', $row);
         return ss($row);
     } else {
         ee(2);
     }
 }
开发者ID:newset,项目名称:robot,代码行数:11,代码来源:IDoctor.php

示例13: index

 static function index()
 {
     $tpl = smarty();
     $head['title'] = 'EQPHP 文件上传(file upload)';
     $tpl->assign('head', $head);
     $lie = 1;
     $param['type'] = rq($lie);
     $param['dir'] = rq($lie + 1);
     $param['id'] = rq($lie + 2);
     $tpl->assign('up', $param);
     $tpl->display('plugin/upload');
 }
开发者ID:art-youth,项目名称:framework,代码行数:12,代码来源:a_upload.php

示例14: c

 public function c($rq = NULL, $rules = NULL, $messages = NULL)
 {
     $rq = rq();
     $new = parent::c($rq, $this->createRule);
     if ($new['status'] == 1) {
         // 设置
         $query = $this->where('robot_id', $rq['robot_id']);
         $query->update(['recent' => 0]);
         $query->where('id', $new['d']['id'])->update(['recent' => 1]);
     }
     $new['rq'] = $rq;
     return $new;
 }
开发者ID:newset,项目名称:robot,代码行数:13,代码来源:IRobotLeaseLog.php

示例15: cook

 /**
  * 请求
  * @param  [type] $ctrl   [description]
  * @param  [type] $action [description]
  * @param  string $params [description]
  * @return [type]         [description]
  */
 public function cook($ctrl, $action, $params = '')
 {
     // If exists model in univ, use it.
     if (class_exists(MName($ctrl, 'v')) && !rq('write_data')) {
         $ins = new M($ctrl, 'v');
     } else {
         if (class_exists(MName($ctrl, 'i'))) {
             $ins = M($ctrl, 'i');
         } else {
             return ee(2);
         }
     }
     // 权限检查
     // 方法调用 是否存在 check guard
     return call_user_func_array([$ins, $action], explode('/', $params));
 }
开发者ID:newset,项目名称:gd,代码行数:23,代码来源:CookController.php


注:本文中的rq函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。