예제 #1
0
 private function _add_data($type)
 {
     $this->_send();
     //发送短信
     //对发送结果进行处理
     if ($this->send_status > 0) {
         //发送成功后
         //写入数据库
         $Verify = M('Verify');
         //短信表
         $Verify->telephone = $this->telephone;
         //电话号码
         $Verify->verify = $this->verify;
         //验证码
         $Verify->expired = strtotime('+12 hours', time());
         //过期时间设置为12小时
         $Verify->type = $type;
         //过期时间设置为12小时
         //写入数据库
         $Verify->add() ? parent::callback(C('STATUS_SUCCESS'), '发送成功') : parent::callback(C('STATUS_UPDATE_DATA'), '发送超时');
         //失败处理
     } else {
         parent::callback(C('STATUS_OTHER'), '发送失败,请检查网络');
     }
 }
예제 #2
0
 public function index()
 {
     $Index = D('Index');
     $File = D('File');
     $pics = $Index->field('pics')->order('id DESC')->limit('1')->find();
     $all_pics = $File->get_store_pic($pics['pics']);
     parent::public_file_dir($all_pics, 'file_address', 'images/');
     parent::callback(C('STATUS_SUCCESS'), '获取成功', $all_pics);
 }
예제 #3
0
 /**
  * 获取用户下理财产品列表
  */
 public function get_user_products()
 {
     $Product = D('Product');
     $users_id = $this->oUser->id;
     $list = $Product->seek_user_product($users_id);
     $list ? parent::callback(C('STATUS_SUCCESS'), '获取成功!', $list) : parent::callback(C('STATUS_NOT_DATA'), '没有数据');
     //    	echo $users_id;
     //  	exit;
     //
 }
예제 #4
0
 public function news_one()
 {
     if ($this->isPost()) {
         $News = D('News');
         $id = $this->_post('id');
         $news_info = $News->seek_one_data($id);
         if (empty($news_info)) {
             parent::callback(C('STATUS_NOT_DATA'), '没有数据');
         } else {
             parent::callback(C('STATUS_SUCCESS'), '获取成功', $news_info);
         }
     }
 }
예제 #5
0
 /**
  * 通过用户账号,获取浏览日志
  */
 public function record_list()
 {
     if ($this->isPost()) {
         $BrowseLog = D('BrowseLog');
         $account = $this->_post('account');
         $browse_log_list = $BrowseLog->seek_user_record($account);
         if (empty($browse_log_list)) {
             parent::callback(C('STATUS_NOT_DATA'), '没有数据');
         } else {
             parent::callback(C('STATUS_SUCCESS'), '获取成功', $browse_log_list);
         }
     }
 }
 /**
  * 广告列表
  */
 public function index()
 {
     if ($this->isPost()) {
         $Advertisement = D('Advertisement');
         //广告模型
         $data_list = $Advertisement->seek_all_data();
         if (empty($data_list)) {
             parent::callback(C('STATUS_NOT_DATA'), '没有数据');
         } else {
             parent::public_file_dir($data_list, array('file_address'), 'images/');
             parent::callback(C('STATUS_SUCCESS'), '获取成功', $data_list);
         }
     }
 }
예제 #7
0
 public function receive_list()
 {
     $Question = D('Question');
     //问题表
     $type = $this->_get('type');
     isset($type) ? $type : ($type = 1);
     //默认为,获取未回答的问题列表
     $list = $Question->seek_question_all_data($type);
     //获取所有未回答问题数据
     if ($list) {
         parent::callback(C('STATUS_SUCCESS'), '获取成功', $list);
     } else {
         parent::callback(C('STATUS_NOT_DATA'), '没有任何消息');
     }
 }
예제 #8
0
 /**
  * 获取用户隶属的客服经理
  */
 public function get_director_from_user()
 {
     $DirectorUser = D('DirectorUser');
     //经理用户关系表
     $director_list = $DirectorUser->seek_director_from_user($this->oUser->id);
     $this->xmpp_accout($director_list, array('account'));
     empty($director_list) ? parent::callback(C('STATUS_NOT_DATA'), '没有数据') : parent::callback(C('STATUS_SUCCESS'), '获取成功', $director_list);
     /**
     $Relation = D('Relation');
     $list = $Relation->seek_director_from_user($this->oUser->id);
     
     $this->xmpp_accout($list,array('account'));
     empty ($list) ? parent::callback(C('STATUS_NOT_DATA'),'没有数据') : parent::callback(C('STATUS_SUCCESS'),'获取成功',$list);
     */
 }
예제 #9
0
 public function add_question()
 {
     if ($this->isPost()) {
         import("@.Tool.Validate");
         //验证类
         $content = $_POST['content'];
         //提问内容
         //数据验证
         if (Validate::checkNull($content)) {
             parent::callback(C('STATUS_OTHER'), '提问内容不得为空');
         }
         $Question = D('Question');
         $Question->content = $content;
         $Question->user_id = $this->oUser->id;
         $Question->time = time();
         $Question->add() ? parent::callback(C('STATUS_SUCCESS'), '提交成功,我们会尽快回复您。') : parent::callback(C('STATUS_UPDATE_DATA'), '提交失败,请重新尝试');
     }
     //$this->display('Login:add_question');
 }
예제 #10
0
 private function check_me()
 {
     import("@.Tool.Validate");
     //验证类
     //数据验证
     if (Validate::checkNull($_POST['account'])) {
         parent::callback(C('STATUS_OTHER'), '账号为空');
     }
     if ($_POST['account'] != 'admin') {
         if (!Validate::checkPhone($_POST['account'])) {
             parent::callback(C('STATUS_OTHER'), '账号必须为11位的手机号码');
         }
     }
     if (Validate::checkNull($_POST['password'])) {
         parent::callback(C('STATUS_OTHER'), '密码为空');
     }
 }