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;
     }
 }
Exemplo n.º 2
0
 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 __construct($show_name, $name, $is_must_input = false)
 {
     parent::__construct($show_name, $name, $is_must_input);
     $this->typ = "Field_related_multi_ids";
     $this->model_name = '';
     $this->valueSetted = false;
     $this->placeholder = '请点击<+>输入';
     $this->jsonValue = array();
     $this->plusCreateData = NULL;
 }
Exemplo n.º 5
0
 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 __construct($show_name, $name, $is_must_input = false)
 {
     parent::__construct($show_name, $name, $is_must_input);
     $this->set_relate_db('oOrg', '_id', 'name');
     $this->needOrgId = 0;
 }
Exemplo n.º 7
0
 public function init($value)
 {
     parent::init($value);
 }
 public function setOrgId($orgId)
 {
     parent::setOrgId($orgId);
     $this->whereOrgId = $orgId;
 }
Exemplo n.º 9
0
 public function check_data_input($input)
 {
     if ($input === 0) {
         return false;
     }
     return parent::check_data_input($input);
 }