本文整理匯總了PHP中app\models\BaseModel::c方法的典型用法代碼示例。如果您正苦於以下問題:PHP BaseModel::c方法的具體用法?PHP BaseModel::c怎麽用?PHP BaseModel::c使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類app\models\BaseModel
的用法示例。
在下文中一共展示了BaseModel::c方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: c
public function c($rq = null)
{
$type = ['employee' => 1, 'agency' => 2, 'doctor' => 3];
$rq = rq();
$rq['senderid'] = uid();
$rq['sendername'] = username();
if (he_is('agency')) {
$rq['org'] = sess('org');
}
if (he_is('employee')) {
$rq['org'] = sess('org');
}
// return his_chara()[0];
$rq['sendertype'] = $type[his_chara()[0]];
if (his_chara()[0] == 'agency') {
$rq['recipienttype'] = 1;
$rq['recipientid'] = 1;
$rq['recipientname'] = 'admin';
} elseif (his_chara()[0] == 'employee') {
$rq['recipienttype'] = $type[$rq['recipienttype']];
}
// 驗證發信規則
$valid = $this->verify($rq);
if (!$valid) {
return ee(2);
}
$rq['sendtime'] = date("Y-m-d H:i:s");
return parent::c($rq);
}
示例2: c
/**
* 創建
*/
public function c($rq = NULL)
{
$this->guarded = arr_except_vals($this->guarded, ['password']);
if (!$rq) {
$rq = rq();
}
return parent::c($rq);
}
示例3: c
/**
* 創建
*/
public function c($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::c($rq);
}
示例4: 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;
}
示例5: c
public function c($rq = NULL, $rules = NULL, $messages = NULL)
{
$rq = rqOnly(['action_type', 'memo', 'robot_id']);
// 設置 id
$rq['at'] = time();
$rq['employee_id'] = Session::get('uid');
if ($rq['action_type'] == 2) {
// 更新狀態
IRobot::where('id', $rq['robot_id'])->update(['status' => 1]);
} else {
if ($rq['action_type'] == 3) {
IRobot::where('id', $rq['robot_id'])->update(['status' => 2]);
} else {
if ($rq['action_type'] == 4) {
IRobot::where('id', $rq['robot_id'])->update(['status' => 0]);
}
}
}
return parent::c($rq);
}