update($data); } return $id; } public function model() { $where['template_id'] = Dever::input('search_option_template_id'); $data = Dever::db('poster/model')->select($where); if ($data) { foreach ($data as $k => $v) { $data[$k]['content'] = ''; $data[$k]['style'] = 'display:none;position:absolute;'; if ($v['type'] == 1) { $data[$k]['content'] = ''; $data[$k]['style'] .= 'width: '.$v['width'].'px;height:'.$v['height'].'px;'; } else { if (!$v['value']) { $v['value'] = $v['name']; } $data[$k]['content'] = $v['value']; //$data[$k]['style'] .= 'width: '.$v['text_width'].'px;'; if ($v['color']) { $data[$k]['style'] .= 'color:' . $v['color'] . ';'; } if ($v['size']) { $data[$k]['style'] .= 'font-size:' . $v['size'] . 'px;'; } if ($v['fonts']) { //$data[$k]['style'] .= 'font-size:' . $v['size'] . ';'; } } $p = explode(',', $v['position']); $data[$k]['style'] .= 'left:'.$p[0].'px;top:'.$p[1].'px;'; } } return $data; } }