getInfoById($id); } static public function getInfoByPhone($phone) { $Table_common_guest = new Table_common_guest(); return $Table_common_guest->getInfoByPhone($phone); } static public function getInfoByOpenId($openId) { $Table_common_guest = new Table_common_guest(); return $Table_common_guest->getInfoByOpenId($openId); } static public function generateNewCode($id) { $Table_common_guest = new Table_common_guest(); return $Table_common_guest->generateNewCode($id); } static public function getPassInfo($id) { $guest = self::getInfoById($id); if (empty($guest)) { return 0; } //没有编号先生成编号 if (empty($guest['code'])) { $newCode = self::generateNewCode($id); $updateAttr = array( 'code' => $newCode, ); self::update($id, $updateAttr); } //增加一次次数 $countAttr = array( 'count' => $guest['count'] + 1, ); self::update($id, $countAttr); //返回是否可以入场标记 $ret['id'] = $id; $ret['type'] = 1; //1-普通客户 2-经销商客户 $ret['msg'] = '允许入场'; $guest = self::getInfoById($id); $ret['code'] = $guest['code']; $ret['addtime'] = GetDateString($guest['addtime'], true); return $ret; } static public function add($attrs) { $Table_common_guest = new Table_common_guest(); $id = $Table_common_guest->add($attrs); return $id; } static public function edit($id, $attrs) { $Table_common_guest = new Table_common_guest(); return $Table_common_guest->edit($id, $attrs); } static public function update($id, $attrs) { $Table_common_guest = new Table_common_guest(); return $Table_common_guest->update($id, $attrs); } static public function del($id) { $Table_common_guest = new Table_common_guest(); return $Table_common_guest->del($id); } static public function getList($filter = array(), $count=0, $page=0, $pageSize=0) { $Table_common_guest = new Table_common_guest(); return $Table_common_guest->getList($filter, $count, $page, $pageSize); } static public function getListByPage($filter = array(), $page=0, $pagesize=0){ $Table_common_guest = new Table_common_guest(); return $Table_common_guest->getList($filter, 0, $page, $pagesize); } static public function getCountAll($filter = array()){ $Table_common_guest = new Table_common_guest(); return $Table_common_guest->getList($filter, 1); } }