當前位置: 首頁>>代碼示例>>PHP>>正文


PHP ss函數代碼示例

本文整理匯總了PHP中ss函數的典型用法代碼示例。如果您正苦於以下問題:PHP ss函數的具體用法?PHP ss怎麽用?PHP ss使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了ss函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: 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

示例2: robot

 public function robot()
 {
     if (!he_is('agency')) {
         abort(403);
     }
     $data = DB::table('i_robot')->select('i_robot.*', 'i_robot_lease_log.*', 'i_hospital.name as hospital_name', 'i_employee.name as employee_name')->leftJoin('i_robot_lease_log', 'i_robot.id', '=', 'i_robot_lease_log.robot_id')->leftJoin('i_hospital', 'i_hospital.id', '=', 'i_robot_lease_log.hospital_id')->leftJoin('i_employee', 'i_employee.id', '=', 'i_robot.employee_id')->where('i_robot_lease_log.recent', 1)->where('i_robot_lease_log.agency_id', uid())->orderBy('i_robot.id', 'i_robot_lease_log.lease_ended_at desc')->get();
     return ss($data);
 }
開發者ID:Aaronqcd,項目名稱:robot,代碼行數:8,代碼來源:VRobotHome.php

示例3: change_password

 public function change_password($row = null)
 {
     $row = $row ? $row : rq();
     $ins = $this->find($row['id']);
     $ins->password = hash_password($row['password']);
     $r = $ins->save();
     return $r ? ss($r) : ee(1);
 }
開發者ID:hellopsm,項目名稱:robot,代碼行數:8,代碼來源:IEmployee.php

示例4: chs

function chs($var, $def = 0)
{
    if (isset($_REQUEST[$var])) {
        return ss($_REQUEST[$var]);
    } else {
        return $def;
    }
}
開發者ID:purplepixie,項目名稱:freenats,代碼行數:8,代碼來源:view.edit.php

示例5: 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

示例6: index

 public function index()
 {
     if (ss('uid')) {
         header('Location: /?c=default&a=main');
     }
     $this->data['side'] = true;
     $this->data['title'] = $this->data['top_title'] = '首頁';
     render($this->data);
 }
開發者ID:adamchau,項目名稱:teamdisk,代碼行數:9,代碼來源:login.class.php

示例7: change_password

 public function change_password($row = null)
 {
     $row = $row ? $row : rq();
     $ins = $this->find($row['id']);
     $ins->password = hash_password($row['password']);
     $r = $ins->save();
     // trigger log
     $this->eventFire('pass', $ins);
     return $r ? ss($r) : ee(1);
 }
開發者ID:newset,項目名稱:robot,代碼行數:10,代碼來源:IEmployee.php

示例8: ss

 function ss($n)
 {
     foreach ($n as $k => $v) {
         if (is_array($v)) {
             $n[$k] = ss($v);
         } else {
             $n[$k] = stripslashes($v);
         }
     }
 }
開發者ID:laiello,項目名稱:yakbb,代碼行數:10,代碼來源:index.php

示例9: 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

示例10: 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

示例11: __construct

 function __construct()
 {
     // 載入默認的
     parent::__construct();
     $a = g('a');
     $c = g('c');
     session_start();
     if (!ss('uid') && $c != 'login') {
         header('Location: /?c=login');
         exit;
     }
 }
開發者ID:adamchau,項目名稱:teamdisk,代碼行數:12,代碼來源:app.class.php

示例12: Set

 function Set($var, $val, $perm = true)
 {
     $this->data[$var] = $val;
     if ($perm) {
         global $NATS;
         $q = "UPDATE fnconfig SET fnc_val=\"" . ss($val) . "\" WHERE fnc_var=\"" . ss($var) . "\"";
         $NATS->DB->Query($q);
         if ($NATS->DB->Affected_Rows() <= 0) {
             $q = "INSERT INTO fnconfig(fnc_var,fnc_val) VALUES(\"" . ss($var) . "\",\"" . ss($val) . "\")";
             mysql_query($q);
         }
     }
 }
開發者ID:alvunera,項目名稱:FreeNats-PlugIn,代碼行數:13,代碼來源:nats.cfg.inc.php

示例13: forget

 /**
  * 找回密碼 
  * @param  [type] $p3 找回密碼類型 - employee , agency
  * @return [type]     [description]
  */
 public function forget($p3 = null)
 {
     $email = rq('email');
     $ins = Route::current()->parameter('p3');
     $row = M($ins)->where('email', $email)->first();
     if ($row) {
         // 發送郵件
         $hash = hash_password($row->email . time());
         Mail::send('emails.reminder', ['user' => $row, 'hash' => $hash], function ($m) use($row) {
             $m->to($row->email, $row->name)->subject('密碼重置');
         });
         // 發送log
         Event::fire(new LogEvent('reminder', 'auth', ['type' => $ins, 'user' => $row, 'hash' => $hash]));
         return ss('郵件已發送');
     } else {
         return ss('無相關用戶', 0);
     }
 }
開發者ID:newset,項目名稱:robot,代碼行數:23,代碼來源:IAuth.php

示例14: 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) {
             $lifetime = 6000;
             log_him_in(['username' => $user->username, 'uid' => $user->id], $lifetime);
             add_chara($input['user_type']);
             if ($input['user_type'] == 'employee') {
                 sess('permission', $user->permissions);
             } else {
                 sess('permission', []);
             }
             if ($input['user_type'] == 'agency') {
                 sess('org', $user->name);
                 sess('name_in_charge', $user->name_in_charge);
             }
             if ($input['user_type'] == 'department') {
                 sess('org', $user->hospital_name . ':' . $user->name);
             }
             if ($input['user_type'] == 'employee') {
                 sess('org', $user->name);
             }
             // 添加日誌
             ILog::login($input['user_type'], $user);
             return ss($user);
         }
     } else {
         return ee(2);
     }
     return ee(2);
 }
開發者ID:newset,項目名稱:robot,代碼行數:49,代碼來源:AuthTrait.php

示例15: scan_u

 public function scan_u()
 {
     if (rq('cust_id')) {
         $ins = $this->where('cust_id', rq('cust_id'))->first();
     } else {
         return ee(2, 'missing_cust_id');
     }
     if (!$ins) {
         return ee(2, 'record_not_found');
     }
     if ($ins->used_at) {
         return ee(2, 'mark_is_already_used');
     }
     $ins->doctor_id = uid();
     $ins->used_at = \Carbon\Carbon::now();
     if ($ins->save()) {
         return ss();
     }
 }
開發者ID:hellopsm,項目名稱:robot,代碼行數:19,代碼來源:IMark.php


注:本文中的ss函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。