本文整理汇总了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);
}