66 lines
1.4 KiB
PHP
66 lines
1.4 KiB
PHP
<?php
|
|
defined('BASEPATH') OR exit('No direct script access allowed');
|
|
|
|
class User_model extends CI_Model {
|
|
|
|
public function __construct()
|
|
{
|
|
parent::__construct();
|
|
$this->load->database();
|
|
}
|
|
|
|
/*
|
|
解析用户信息
|
|
*/
|
|
public function setUserMsg($row)
|
|
{
|
|
$type = $this->Config_model->type[$row->type];
|
|
$data=array(
|
|
'id' => $row->id,
|
|
'type' => $type,
|
|
'name' => $row->name,
|
|
'wxname' => $row->wxname,
|
|
'password' => $row->password,
|
|
'telephone' => $row->telephone,
|
|
'addtime' => $row->addtime
|
|
);
|
|
return $data;
|
|
}
|
|
|
|
/*
|
|
接收用户信息
|
|
*/
|
|
public function receiveUserMsg()
|
|
{
|
|
$pass = isset($_POST['password'])?stripslashes($_POST['password']):"";
|
|
$telephone = isset($_POST['telephone'])?stripslashes($_POST['telephone']):"";
|
|
|
|
$data = array(
|
|
'password' => $pass,
|
|
'telephone' => $telephone
|
|
);
|
|
return $data;
|
|
}
|
|
|
|
/*
|
|
接收用户信息(注册)
|
|
*/
|
|
public function userMsg()
|
|
{
|
|
date_default_timezone_set("Asia/Shanghai");
|
|
$type = isset($_POST['type'])?$_POST['type']:"";
|
|
$name = isset($_POST['name'])?$_POST['name']:"";
|
|
$password = isset($_POST['password'])?$_POST['password']:"";
|
|
$telephone = isset($_POST['telephone'])?$_POST['telephone']:"";
|
|
|
|
$data = array(
|
|
'type' => $type,
|
|
'name' => $name,
|
|
'password' => $password,
|
|
'telephone' => $telephone,
|
|
'addtime' => date("m/d/Y")
|
|
);
|
|
return $data;
|
|
}
|
|
}
|