Exemplo n.º 1
0
 function editShopbranch($id)
 {
     if ($this->input->post('title')) {
         //			var_dump($_POST);
         $keys = array('title', 'openTime', 'phone', 'address');
         foreach ($keys as $key) {
             $data[$key] = $this->input->post($key);
         }
         $data['district'] = avosPointer('District', $this->input->post('districtId'));
         $data['subDistrict'] = avosPointer('District', $this->input->post('subDistrictId'));
         $latitude = doubleval($this->input->post('latitude'));
         $longitude = doubleval($this->input->post('longitude'));
         $data['location'] = avosGeoPoint($latitude, $longitude);
         $result = $this->model->update($id, $data);
         if ($result < 0) {
             echo $result;
         } else {
             $this->session->set_flashdata('msg', '创建成功');
             redirect('admin/shops/index', 'refresh');
         }
         return;
     }
     $headDistricts = $this->district_m->get_all_headDistrict();
     $subDistricts = array();
     foreach ($headDistricts as $district) {
         $subDistricts = array_merge($subDistricts, $district['subDistricts']);
     }
     $data['title'] = '子商户';
     $data['main'] = 'admin_shops_editshopbranch';
     $data['model'] = $this->model->get($id);
     $data['headDistricts'] = $headDistricts;
     $data['subDistricts'] = $subDistricts;
     $this->load->view($this->config->item('admin_template'), $data);
 }
Exemplo n.º 2
0
 /**
  * 
  * 删除会员
  * @param integer $id
  */
 function delete($id, $parentId)
 {
     $this->model->delete($id);
     if (!empty($parentId)) {
     }
     //
     //		$this->session->set_flashdata('msg','删除成功');
     //		redirect('admin/coupontypes/index','refresh');
 }
Exemplo n.º 3
0
 public function headDistricts_get()
 {
     $results = $this->district_m->get_all_headDistrict();
     return $this->output_results($results);
 }