public function init($value) { parent::init($value); if ($value === 0 || $value === "0" || $value === "" || $value === null) { $this->showValue = ' - '; return; } $this->valueSetted = true; if (!is_object($value) && $this->relate_id_is_id) { $real_value = new MongoId($value); } else { $real_value = $value; } $this->db->select(array($this->valueField, $this->showField))->where(array($this->valueField => $real_value))->limit(1); $this->checkWhere(); $query = $this->db->get($this->tableName); if ($query->num_rows() > 0) { $result = $query->row_array(); $this->carArray = $result['cars'][0]; // $this->xinghao = $result['cars'][0]['chexingbianhao']['pinpai']['name'].' > '. // $result['cars'][0]['chexingbianhao']['niankuan']['name']; $this->xinghao = $result['cars'][0]['chexingbianhao']['niankuan']['name']; $this->chepaihao = $result['cars'][0]['chepaihao']; $this->showValue = $this->xinghao . ' ' . $this->chepaihao; $this->value_checked = 1; } else { $this->xinghao = '其他品牌'; $this->chepaihao = '未知车牌'; $this->showValue = '[未知车辆(id:' . $value . ')]'; $this->value_checked = -1; } }
public function init($value) { if (is_numeric($value) && $value <= 0) { $this->showValue = '[系统]'; } else { parent::init($value); $this->userName = $this->showValue; } }
public function init($value) { parent::init($value); $this->jsonValue = array(array('id' => $value, 'name' => $this->showValue)); if ($value > 0) { $this->placeholder = '<span class="label label-primary">' . $this->showValue . '</span>'; } else { $this->placeholder = '请点击<+>输入'; } }
public function init($value) { $this->value = $value; if (is_numeric($value) && $value <= 0) { $this->showValue = '[系统]'; } else { if ($value === 0 || $value === "0" || $value === "" || $value === null) { $this->showValue = ' - '; return; } $this->valueSetted = true; if (!is_object($value) && $this->relate_id_is_id) { $real_value = new MongoId($value); } else { $real_value = $value; } $cache_rst = $this->checkCache($value); if ($cache_rst != null) { $this->showValue = $cache_rst; $this->value_checked = 1; return; } $this->db->select(array($this->valueField, 'name', 'loginName'))->where(array($this->valueField => $real_value))->limit(1); $query = $this->db->get($this->tableName); if ($query->num_rows() > 0) { $result = $query->row_array(); if (isset($result[$this->showField])) { $this->showValue = $result[$this->showField] . '(' . $result['loginName'] . ')'; $this->setCache($value, $this->showValue); } $this->value_checked = 1; } else { $this->showValue = '[未知(id:' . $value . ')]'; $this->value_checked = -1; } parent::init($value); $this->userName = $this->showValue; } }
public function init($value) { parent::init($value); }
public function baseInit($value) { parent::init($value); }