/** * 添加商家 * http://localhost/beauty/index.php?m=shop&c=index&a=create */ public function create() { $data = getParams("data", ''); $data['created'] = strtotime(date('Y-m-d H:i:s')); $result = parent::save($data); echo json_encode(array('code' => '0', 'message' => '成功', 'data' => $result)); }
public function save() { if (!$this->CheckParams($this->modeltype)) { sendBack(); } $flash = Flash::Instance(); $errors = array(); if (controller::save($this->modeltype, '', $errors)) { sendTo($_SESSION['refererPage']['controller'], $_SESSION['refererPage']['action'], $_SESSION['refererPage']['modules'], isset($_SESSION['refererPage']['other']) ? $_SESSION['refererPage']['other'] : null); } $flash->addErrors($errors); $this->_data['data_mapping_rule_id'] = $this->_data[$this->modeltype]['data_mapping_rule_id']; $this->refresh(); }