function update()
 {
     $id = $_POST['id'];
     $post['merchant_name'] = $_POST['merchant_name'];
     $post['tel'] = $_POST['tel'];
     $post['province_id'] = $_POST['province_id'];
     $post['city_id'] = $_POST['city_id'];
     $post['area_id'] = $_POST['area_id'];
     $post['address'] = $_POST['address'];
     $post['business_time'] = $_POST['business_time'];
     $post['manager'] = $_POST['manager'];
     $post['longitude'] = $_POST['longitude'];
     $post['latitude'] = $_POST['latitude'];
     $db = M('Auth');
     $data = $db->where(array('id' => $id))->find();
     $save = array_merge(json_decode($data['check_data'], true), $post);
     $action = $db->where(array('id' => $id))->save(array('check_data' => json_encode($save)));
     if ($action === false) {
         $this->ajaxReturn(array('code' => 1, 'msg' => '审核失败'), 'json');
         exit;
     } else {
         $url = "http://121.40.92.53/ycbb/index.php/App/Auth/execAction";
         $rel = CurlController::curl($url, array('id' => $id));
         if ($rel['code'] == 0) {
             $this->ajaxReturn(array('code' => 0, 'msg' => '审核成功'), 'json');
             exit;
         } else {
             $this->ajaxReturn(array('code' => 1, 'msg' => '审核失败'), 'json');
             exit;
         }
     }
 }
 public function userAlreadyExists()
 {
     $username = isset($_POST['username']) ? htmlspecialchars(trim($_POST['username'])) : '';
     $verifylength = strlen($username);
     if ($verifylength != 11 || is_numeric($username) == false) {
         die(json_encode(array('code' => 202, 'msg' => '手机格式不符合要求')));
     }
     $url = C('CURL_POST_URL') . "Merchant/checkUser";
     $data = array('username' => $username);
     $rel = CurlController::curl($url, $data);
     die(json_encode($rel));
 }
 function edit()
 {
     $db = M('Auth');
     $data = $db->where(array('id' => $_GET['id']))->find();
     $data['check_data'] = json_decode($data['check_data'], true);
     $data['check_data']['header'] = imgUrl($data['check_data']['header']);
     $url = "http://121.40.92.53/ycbb/index.php/App/City/city_list";
     $province = CurlController::curl($url, array());
     $city = CurlController::curl($url, array('pid' => $data['check_data']['province_id']));
     $area = CurlController::curl($url, array('pid' => $data['check_data']['city_id']));
     $this->assign('vo', $data);
     $this->assign('province', $province['data']['list']);
     $this->assign('city', $city['data']['list']);
     $this->assign('area', $area['data']['list']);
     $this->display();
 }