Best Atoum code snippet using trim.decorate
DecorateController.class.php
Source:DecorateController.class.php
...22 //æ交æ¹æ¡23 $condition_order['order1.store_id'] = session('store_id');24 $condition_order['order1.order_type'] = ORDER_TYPE_DECORATE;25 $condition_order['order1.order_state'] = array('in', '20,30,40,50');26 $fields = 'order1.add_time,order1.store_id,decorate_plan.title,decorate_plan.house_type,decorate_plan.house_address,decorate_plan.cost,decorate_plan.coverpage';27 $order = 'order1.add_time desc';28 $on = 'order.plan_id=decorate_plan.de_plan_id';29 $jion = 'INNER JOIN allwood_decorate_plan as decorate_plan on order1.plan_id=decorate_plan.de_plan_id';30 $succe_plan = M()->table('allwood_order as order1')->join($jion)->where($condition_order)->field($fields)->order($order)->limit(10)->select();31 32 $this->assign('storeinfo',$storeinfo);33 $this->assign('order_start',$order_start);34 $this->assign('order_over',$order_over);35 $this->assign('succe_plan',$succe_plan);36 $this->display();37 }38 /*39 * æçæ¹æ¡40 */41 public function solutionList(){42 $decorate_model = D('Decorate');43 $conditon = array();44 $conditon['store_id'] = $_SESSION['store_id'];45 if ($_POST['title'] != ''){46 $conditon['title'] = array('like', '%' . trim($_POST['title']) . '%');47 $this->assign('search_title', $_POST['title']);48 }49 if ($_POST['house_type'] != ''){50 $conditon['house_type'] = array('like', '%' . trim($_POST['house_type']) . '%');51 $this->assign('search_house_type', $_POST['house_type']);52 }53 $p = empty($_GET['p'])?1:$_GET['p'];54 $decorate_list = $decorate_model->getDecorateList('decorate_plan', $conditon, '*', 'de_plan_id desc', $p.',10');55 $count = $decorate_model->getDecorateListCount('decorate_plan', $conditon);56 $this->assign('show_page', getPage($count));57 $this->assign('decorate_list', $decorate_list);58 $this->display();59 }60 61 /*62 * æ·»å /ä¿®æ¹ï¼æ¹æ¡ï¼63 */64 public function decorateOperate(){65 $decorate_model = D('Decorate');66 $id = intval($_REQUEST['id']);67 if ($id > 0){68 $decorate_plan_info = $decorate_model->getDecorateInfo('decorate_plan', array('de_plan_id' => $id));69 $this->assign('decorate_plan_info', $decorate_plan_info);70 }71 if ($_POST){72 $data = array();73 $data['store_id'] = $_SESSION['store_id'];74 $data['title'] = trim($_POST['title']);75 $data['house_type'] = trim($_POST['house_type']);76 $data['house_address'] = trim($_POST['house_address']);77 $data['cost'] = $_POST['cost'];78 $data['area'] = $_POST['area'];79 $data['is_discount'] = intval($_POST['is_discount']);80 $data['decorate_type'] = intval($_POST['decorate_type']);81 if(empty($id)){82 $data['visit_pwd'] = $_POST['visit_pwd'];83 } 84 $data['coverpage'] = serialize($_POST['coverpage']);85 $data['contract_pic'] = serialize($_POST['contract_pic']);86 $data['description'] = trim($_POST['description']);87 $this->validateDecorate($data);88 89 if ($id > 0){90 $title_isexist = $decorate_model->getDecorateInfo('decorate_plan', array('title' => $data['title'],'store_id'=>$_SESSION['store_id'],'de_plan_id'=>array('neq',$id)));91 if(!empty($title_isexist)){92 $this->jsonFail('æ é¢å称,å·²åå¨ï¼');93 }94 $rs = $decorate_model->updDecorate('decorate_plan', $data, array('de_plan_id' => $id));95 96 }else{97 $data['visit_pwd'] = md5($_POST['visit_pwd']);98 $rs = $decorate_model->insertToDecorate('decorate_plan', $data);99 }100 $this->jsonSucc('ä¿åæå');101 }102 $decorate_type_model = D('EffectdrawType');103 $condition = array();104 $condition['status'] = 1;105 $decorate_type_list = $decorate_type_model->selectEffectdrawType($condition, 'id,type_name');106 $this->assign('decorate_type_list', $decorate_type_list);107 $this->display();108 }109 110 public function validateDecorate($param)111 {112 $rules = array(113 array('store_id','require','åºéºidä¸è½ä¸ºç©ºï¼'),114 array('title','require','æ é¢ä¸è½ä¸ºç©ºä¸å¿
é¡»å°äº50个åï¼'),115 array('title','1,50','æ é¢ä¸è½ä¸ºç©ºä¸å¿
é¡»å°äº50个åï¼',0,'length'),116 array('house_type','require','æ·åä¸è½ä¸ºç©ºä¸å¿
é¡»å°äº50个åï¼'),117 array('house_type','1,50','æ·åä¸è½ä¸ºç©ºä¸å¿
é¡»å°äº50个åï¼',0,'length'),118 array('house_address','require','æ·åå°åä¸è½ä¸ºç©ºä¸å¿
é¡»å°äº50个åï¼'),119 array('house_address','1,50','æ·åå°åä¸è½ä¸ºç©ºä¸å¿
é¡»å°äº50个åï¼',0,'length'),120 array('cost','require','é ä»·ä¸è½ä¸ºç©ºï¼'),121 array('cost','/^\d+|\d+\.{1}\d{0,2}$/','é ä»·ä¸è½è¶
è¿2ä½å°æ°ï¼',0,'regex'),122 array('area','require','é¢ç§¯ä¸è½ä¸ºç©ºï¼'),123 array('area','/^\d+|\d+\.{1}\d{0,2}$/','é¢ç§¯å¿
é¡»æ¯ä¸è½è¶
è¿2ä½å°æ°çæ°å¼ï¼',0,'regex'),124 array('visit_pwd','require','å¯ç ä¸è½ä¸ºç©ºä¸é¿åº¦å¿
é¡»å°äº16 ï¼'),125 array('visit_pwd','1,16','å¯ç ä¸è½ä¸ºç©ºä¸é¿åº¦å¿
é¡»å°äº16 ï¼',0,'length'),126 array('coverpage','require','å°é¢å¾ä¸è½ä¸ºç©ºï¼'),127 array('contract_pic','require','ååå¾çä¸è½ä¸ºç©ºï¼'),128 array('description','require','æ¹æ¡æè¿°ä¸è½ä¸ºç©ºï¼')129 );130 $decorate_model = D('Decorate');131 if(!$decorate_model->validate($rules)->create($param)){132 //è¿åéªè¯å¤±è´¥çä¿¡æ¯133 $this->jsonFail($decorate_model->getError());134 } 135 }136 137 public function delDecorate(){138 $idstr = $_POST['id'];139 if ($idstr == ''){140 $this->jsonFail('åæ°é误');141 }else{142 $decorate_model = D('Decorate');143 $res = $decorate_model->updDecorate('decorate_plan',array('tesu_deleted'=>1), array('de_plan_id' => array('in', explode(',', $idstr))));144 if ($res){145 $this->jsonSucc('å é¤æå');146 $result = array('code' => 1, 'resultText' => array('message' => 'å é¤æå'));147 }else{148 $this->jsonFail('å é¤å¤±è´¥');149 }150 }151 }152 153 /*154 * ææå¾155 */156 public function effectdraw(){157 $decorate_model = D('Decorate');158 $conditon = array();159 $conditon['store_id'] = $_SESSION['store_id'];160 if ($_POST['title'] != ''){161 $conditon['title'] = array('like', '%' . trim($_POST['title']) . '%');162 $this->assign('search_title', $_POST['title']);163 }164 $p = empty($_GET['p'])?1:$_GET['p'];165 $effectdraw_list = $decorate_model->getDecorateList('decorate_effectdraw', $conditon, '*', 'draw_id desc', $p.',10');166 $count = $decorate_model->getDecorateListCount('decorate_effectdraw', $conditon);167 $this->assign('show_page', getPage($count));168 $this->assign('effectdraw_list', $effectdraw_list);169 $this->display();170 }171 172 /*173 * æ·»å /ä¿®æ¹ï¼ææå¾ï¼174 */175 public function effectdrawOperate(){176 177 if(IS_AJAX){178 $decorate_model = D('Decorate');179 $id = intval($_POST['id']);180 181 $this->validateOperate($_POST);182 183 if ($id > 0) {184 $effectdraw_list =$decorate_model->getDecorateInfo('decorate_effectdraw_list', array('store_id'=>$_SESSION['store_id'],'id'=>$id));185 if(empty($effectdraw_list)){186 $this->jsonFail('éæ³æä½ï¼');187 }188 $title_isexist = $decorate_model->getDecorateInfo('decorate_effectdraw_list', array('title' => trim($_POST['title']),'store_id'=>$_SESSION['store_id'],'id'=>array('neq',$id)));189 if(!empty($title_isexist)){190 $this->jsonFail('æ é¢å称,å·²åå¨ï¼');191 }192 $update['title'] = trim($_POST['title']);193 $update['type_id'] = intval($_POST['type_id']); 194 $is_update = $decorate_model->updDecorate('decorate_effectdraw_list', $update, array('id' => $effectdraw_list['id']));195 $decorate_model->delDecorate('decorate_effectdraw',array('draw_list_id'=>$effectdraw_list['id']));196 $operate = $effectdraw_list['id'];197 } else {198 $title_isexist = $decorate_model->getDecorateInfo('decorate_effectdraw_list', array('title' => trim($_POST['title']),'store_id'=>$_SESSION['store_id']));199 if(!empty($title_isexist)){200 $this->jsonFail('æ é¢å称,å·²åå¨ï¼');201 }202 203 $data['store_id'] = $_SESSION['store_id'];204 $data['title'] = trim($_POST['title']);205 $data['type_id'] = intval($_POST['type_id']);206 $operate = $decorate_model->insertToDecorate('decorate_effectdraw_list', $data);207 }208 209 foreach ($_POST['pic'] as $item) {210 $data = array();211 $data['draw_list_id'] = $operate;212 $data['store_id'] = $_SESSION['store_id'];213 $data['title'] = trim($_POST['title']);214 $data['type_id'] = intval($_POST['type_id']);215 $data['is_cover'] = $item['fengmian'] == 1 ? 1 : 0;216 unset($item['fengmian']);217 $data['pic'] = serialize($item);218 $rs = $decorate_model->insertToDecorate('decorate_effectdraw', $data);219 }220 $this->jsonSucc('æä½æåï¼');221 }else{222 $decorate_model = D('Decorate');223 $id = intval($_REQUEST['id']);224 if ($id > 0){225 $effectdraw_info = $decorate_model->getDecorateInfo('decorate_effectdraw', array('draw_id' => $id));226 if (!empty($effectdraw_info)){227 $condition = array();228 $condition['draw_list_id'] = $effectdraw_info['draw_list_id'];229 $draw_list = $decorate_model->getDecorateList('decorate_effectdraw', $condition, 'pic,is_cover', '');230 if (!empty($draw_list)){231 $pic_arr = array();232 foreach ($draw_list as $item) {233 $pic_data = array();234 $pic_data['pic_arr'] = unserialize($item['pic']);235 $pic_data['is_cover'] = $item['is_cover'];236 $pic_arr[] = $pic_data;237 }238 }239 $effectdraw_info['pic_list'] = $pic_arr;240 $this->assign('decorate_effectdraw_info', $effectdraw_info);241 }242 }243 $type_model = D('EffectdrawType');244 $condition = array();245 $condition['status'] = 1;246 $field = 'id,type_name';247 $type_list = $type_model->selectEffectdrawType($condition, $field);248 $this->assign('type_list', $type_list);249 $this->display();250 }251 }252 253 public function validateOperate($param)254 {255 if(empty($param['title']) || (mb_strlen($param['title'])>50)){256 $this->jsonFail('æ é¢ä¸è½ä¸ºç©ºä¸å¿
é¡»å°äº50个å!');257 }258 if(empty($param['type_id'])){259 $this->jsonFail('请éæ©é£æ ¼!');260 }261 if(empty($param['pic'])){262 $this->jsonFail('请ä¸ä¼ ææå¾!');263 }264 }265 266 public function deEffectdraw(){267 $idstr = $_POST['id'];268 if ($idstr == ''){269 $this->jsonFail('åæ°é误');270 }else{271 $decorate_model = D('Decorate');272 $res = $decorate_model->updDecorate('decorate_effectdraw', array('tesu_deleted'=>1), array('draw_id' => array('in', explode(',', $idstr))));273 if ($res){274 $this->jsonSucc('å é¤æåï¼');275 }else{276 $this->jsonFail('å é¤å¤±è´¥ï¼');277 }278 }279 }280 281 /*282 * è¾åºjson æåä¿¡æ¯283 */284 function jsonSucc($msg='æåï¼'){285 $result['code'] = 1;286 $result['resultText']['message'] = $msg;...
Usuario.php
Source:Usuario.php
1<?php2class Application_Form_Usuario extends Zend_Form3{4 protected $_vendedor= null;5 public function init()6 {7 /*validadores*/8 $this->_vendedor = new Application_Model_Usuarios();9 10 $validarTamanho = new Zend_Validate_StringLength(1,100);11 $validarEmail = new Zend_Validate_EmailAddress();12 13 /*filtros*/14 $stripTags = new Zend_Filter_StripTags();15 $trim = new Zend_Filter_StringTrim();16 17 $customDecorateInput = new Tokem_CustomDecorator;18 $customDecorateSelectVende = new Tokem_CustomDecoratorSelectVende;19 $customDecorateSelectEstado = new Tokem_CustomDecoratorSelectEstado;20 $customDecorateSelectPermissao = new Tokem_CustomDecoratorSelectPermissao;21 $customDecorateSelectVendedor = new Tokem_CustomDecoratorSelectVendedor;22 $customDecorateButton= new Tokem_CustomDecoratorButton;23 $auth = Zend_Auth::getInstance();24 $identity = $auth->getIdentity();25 26 /*Elementos do formulario*/27 $nome = new Zend_Form_Element_Text('usr_nome');28 $nome->setLabel('Nome:')29 ->setRequired(true)30 ->addFilter($stripTags)31 ->addFilter($trim)32 ->addValidator($validarTamanho)33 ->setDecorators(array($customDecorateInput));34 $profissao = new Zend_Form_Element_Text('fis_profissao');35 $profissao->setLabel('Profissao:')36 ->setRequired(true)37 ->addFilter($stripTags)38 ->addFilter($trim)39 ->addValidator($validarTamanho)40 ->setDecorators(array($customDecorateInput));41 $ocupacao = new Zend_Form_Element_Text('fis_ocupacao');42 $ocupacao->setLabel('Ocupação Atual:')43 ->setRequired(true)44 ->addFilter($stripTags)45 ->addFilter($trim)46 ->addValidator($validarTamanho)47 ->setDecorators(array($customDecorateInput)); 48 $nasc = new Zend_Form_Element_Text('fis_data_nasc');49 $nasc->setLabel('Data Nascimento:')50 ->setRequired(true)51 ->addFilter($stripTags)52 ->addFilter($trim)53 ->addValidator($validarTamanho)54 ->setDecorators(array($customDecorateInput));55 56 $cpf = new Zend_Form_Element_Text('fis_cpf');57 $cpf->setLabel('CPF:')58 ->setRequired(true)59 ->addFilter($stripTags)60 ->addFilter($trim)61 ->addValidator($validarTamanho)62 ->setDecorators(array($customDecorateInput));63 64 $rg = new Zend_Form_Element_Text('fis_rg');65 $rg->setLabel('RG:')66 ->setRequired(true)67 ->addFilter($stripTags)68 ->addFilter($trim)69 ->addValidator($validarTamanho)70 ->setDecorators(array($customDecorateInput));71 72 73 $email = new Zend_Form_Element_Text('usr_email');74 $email->setLabel('Email')75 ->setRequired(true)76 ->addFilter($stripTags)77 ->addFilter($trim)78 ->addValidator($validarEmail)79 ->setDecorators(array($customDecorateInput));80 81 $telefone = new Zend_Form_Element_Text('usr_telefone');82 $telefone->setLabel('Telefone')83 ->setRequired(true)84 ->addFilter($stripTags)85 ->addFilter($trim)86 ->setDecorators(array($customDecorateInput));87 $celular = new Zend_Form_Element_Text('usr_celular');88 $celular->setLabel('Celular')89 ->setRequired(true)90 ->addFilter($stripTags)91 ->addFilter($trim)92 ->setDecorators(array($customDecorateInput)); 93 $pergunta = new Zend_Form_Element('select_pergunta', array(94 'elemName'=>'que_pergunta',95 'label'=>'Vende alguma linha de produto?',96 'type' =>'select',97 'required' => true,98 'multiOptions' => array(""=>"Selecione","Sim"=>"Sim", "Não"=>'Não'),99 'decorators' => array($customDecorateSelectVende),100 ));101 102 $resposta = new Zend_Form_Element_Text('que_resposta');103 $resposta->setLabel('Se Sim qual?')104 ->addFilter($stripTags)105 ->addFilter($trim)106 ->setDecorators(array($customDecorateInput)); 107 108 $this->addDisplayGroup(array(109 $nome,110 $profissao,111 $ocupacao,112 $nasc,113 $cpf,114 $rg,115 $email,116 $telefone,117 $celular,118 $pergunta,119 $resposta,120 ), 'Perfil', array('legend'=>'Dados Pessoais')); 121 //endereço122 /*Elementos do formulario*/123 $cep = new Zend_Form_Element_Text('end_cep');124 $cep->setLabel('CEP:')125 ->setRequired(true)126 ->addFilter($stripTags)127 ->addFilter($trim)128 ->addValidator($validarTamanho)129 ->setDecorators(array($customDecorateInput));130 $logradouro = new Zend_Form_Element_Text('end_logradouro');131 $logradouro->setLabel('Logradouro:')132 ->setRequired(true)133 ->addFilter($stripTags)134 ->addFilter($trim)135 ->addValidator($validarTamanho)136 ->setDecorators(array($customDecorateInput));137 $bairro = new Zend_Form_Element_Text('end_bairro');138 $bairro->setLabel('Bairro:')139 ->setRequired(true)140 ->addFilter($stripTags)141 ->addFilter($trim)142 ->addValidator($validarTamanho)143 ->setDecorators(array($customDecorateInput));144 $cidade = new Zend_Form_Element_Text('end_cidade');145 $cidade->setLabel('Cidade:')146 ->setRequired(true)147 ->addFilter($stripTags)148 ->addFilter($trim)149 ->addValidator($validarTamanho)150 ->setDecorators(array($customDecorateInput));151 $estado = new Zend_Form_Element('select_estado', array(152 'elemName'=>'end_estado',153 'label'=>'Estado',154 'type' =>'select',155 'required' => true,156 'multiOptions' => 157 array(158 ""=>"Selecione o estado",159 "AC"=>"Acre",160 "AL"=>"Alagoas", 161 "AM"=>"Amazonas", 162 "AP"=>"Amapá",163 "BA"=>"Bahia",164 "CE"=>"Ceará",165 "DF"=>"Distrito Federal",166 "ES"=>"EspÃrito Santo",167 "G"=>"Goiás",168 "MA"=>"Maranhão",169 "MT"=>"Mato Grosso",170 "MS"=>"Mato Grosso do Sul",171 "MG"=>"Minas Gerais",172 "PR"=>"Pará",173 "PB"=>"ParaÃba",174 "PR"=>"Paraná",175 "PE"=>"Pernambuco",176 "PI"=>"PiauÃ",177 "RJ"=>"Rio de Janeiro",178 "RN"=>"Rio Grande do Norte",179 "RO"=>"Rondônia",180 "RS"=>"Rio Grande do Sul",181 "RO"=>"Roraima",182 "SC"=>"Santa Catarina",183 "SE"=>"Sergipe",184 "SP"=>"São Paulo",185 "TO"=>"Tocantins"),186 'decorators' => array($customDecorateSelectEstado)187 ));188 $numero = new Zend_Form_Element_Text('end_numero');189 $numero->setLabel('Número:')190 ->setRequired(true)191 ->addFilter($stripTags)192 ->addFilter($trim)193 ->addValidator($validarTamanho)194 ->setDecorators(array($customDecorateInput));195 $complemento = new Zend_Form_Element_Text('end_complemento');196 $complemento->setLabel('Complemento:')197 ->setRequired(false)198 ->addFilter($stripTags)199 ->addFilter($trim)200 ->addValidator($validarTamanho)201 ->setDecorators(array($customDecorateInput));202 $this->addDisplayGroup(array(203 $cep,204 $logradouro,205 $bairro,206 $cidade,207 $estado,208 $numero,209 $complemento,210 ), 'Endereço', array('legend'=>'Endereço')); 211 // $vendedor = new Zend_Form_Element_Text('usr_id_fk_carteira');212 // $vendedor->setLabel('Vendedor:(código)')213 // ->setRequired(true)214 // ->addFilter($stripTags)215 // ->addFilter($trim)216 // ->setDecorators(array($customDecorateInput));217 $vendedor = $this->createElement('select', 'select_vendedor', array(218 'label' => 'Vendedor',219 'elemName'=>'usr_id_fk_carteira',220 'required' => true,'class'=>'form-control',221 )); 222 // var_dump($this->_categoria->fetchAll());223 // exit;224 foreach ($this->_vendedor->fetchAll("usr_permissao='vendedor'","usr_id DESC") as $row) {225 $vendedor->addMultiOption($row['usr_id'], $row['usr_nome']);226 }227 228 $vendedor->setDecorators(array($customDecorateSelectVendedor)); 229 if($identity->usr_permissao!="revendedor"){230 $revendedorInput = new Zend_Form_Element_Text('usr_id_fk_agregado');231 $revendedorInput->setLabel('Agregar ao Revendedor:(código)')232 ->setRequired(false)233 ->addFilter($stripTags)234 ->addFilter($trim)235 ->setDecorators(array($customDecorateInput));236 }237 238 $permissao = new Zend_Form_Element('select_permissao', array(239 'elemName'=>'usr_permissao',240 'label'=>'Permissao',241 'type' =>'select',242 'required' => true,243 'multiOptions' => array(244 ''=>'Selecionea permissão',245 'administrador'=>'Administrador',246 'operador'=>'Operador', 247 'vendedor'=>'Vendedor',248 'revendedor'=>'Revendedor',249 'painel'=>'painel', 250 ),251 'decorators' => array($customDecorateSelectPermissao)252 ));253 if($identity->usr_permissao!="revendedor"){254 $usuario = new Zend_Form_Element_Text('usr_usuario');255 $usuario->setLabel('Usuário:')256 ->setRequired(true)257 ->addFilter($stripTags)258 ->addFilter($trim)259 ->addValidator($validarTamanho)260 ->setDecorators(array($customDecorateInput));261 $senha = new Zend_Form_Element_Text('usr_senha');262 $senha->setLabel('Senha:')263 ->setRequired(true)264 ->addFilter($stripTags)265 ->addFilter($trim)266 ->addValidator(new Zend_Validate_StringLength(array('min' => 6,'max' => 12)))267 ->setDecorators(array($customDecorateInput));268 269 270 $repetir = new Zend_Form_Element_Text('repeat-password');271 $repetir->setLabel('Repetir a senha:')272 ->setRequired(true)273 ->addFilter($stripTags)274 ->addFilter($trim)275 ->addValidator(new Zend_Validate_StringLength(array('min' => 6,'max' => 12)))276 ->addValidator('identical', true, array('usr_senha'))277 ->setDecorators(array($customDecorateInput));278 } 279 $desconto = new Zend_Form_Element_Text('usr_tabela');280 $desconto->setLabel('Desconto sem (%):')281 ->addFilter($trim)282 ->setDecorators(array($customDecorateInput));283 $submit = new Zend_Form_Element('btn_enviar', array(284 'elemName'=>'btn_enviar',285 'label'=>'Enviar Dados',286 'type' =>'submit',287 'required' => false,288 'decorators' => array($customDecorateButton),289 'setAttrib'=>array('name','btn_enviar')290 )); 291 if($identity->usr_permissao!="revendedor"){292 $this->addDisplayGroup(array(293 $desconto,294 $usuario,295 $senha,296 $repetir,297 $permissao,298 ), 'Acesso', array('legend'=>'Acesso ao CRM / Desconto')); 299 }300 if($identity->usr_permissao!="revendedor"){301 $this->addDisplayGroup(array(302 $vendedor,303 $revendedorInput, 304 $submit305 ), 'Interno', array('legend'=>'Interno')); 306 }307 $this->setAttrib('id','form-usuario');308 $this->addElements(array(309 @$vendedor,310 $submit,311 ));312 313 }314}...
MenuDecorateLogic.php
Source:MenuDecorateLogic.php
...27 public static function lists($get)28 {29 $type = $get['type'] ?? 1;30 $where[] = ['del','=',0];31 $where[] = ['decorate_type', '=', $type];32 $count = Db::name('menu_decorate')->where($where)->count();33 $lists = Db::name('menu_decorate')34 ->where($where)35 ->page($get['page'], $get['limit'])36 ->order('id desc')37 ->select();38 foreach ($lists as &$item){39 $item['image'] = UrlServer::getFileUrl($item['image']);40 if($item['link_type'] == 1){41 $content = Menu_::getMenuContent($type,$item['link_address']);42 $item['link_address'] = $content['link'] ?? '';43 }44 }45 return ['count' => $count, 'lists' => $lists];46 }47 // é¦é¡µ48 public static function indexList($get)49 {50 $where[] = ['del','=',0];51 $where[] = ['decorate_type', '=', 1];52 $count = Db::name('menu_decorate')->where($where)->count();53 $lists = Db::name('menu_decorate')54 ->where($where)55 ->page($get['page'], $get['limit'])56 ->order('id desc')57 ->select();58 foreach ($lists as &$item){59 $item['image'] = UrlServer::getFileUrl($item['image']);60 if($item['link_type'] == 1){61 $content = Menu_::getMenuContent(1,$item['link_address']);62 $item['link_address'] = $content['link'] ?? '';63 }64 }65 return ['count' => $count, 'lists' => $lists];66 }67 // é¦é¡µ68 public static function centerList($get)69 {70 $where[] = ['del','=',0];71 $where[] = ['decorate_type', '=', 2];72 $count = Db::name('menu_decorate')->where($where)->count();73 $lists = Db::name('menu_decorate')74 ->where($where)75 ->page($get['page'], $get['limit'])76 ->order('id desc')77 ->select();78 foreach ($lists as &$item){79 $item['image'] = UrlServer::getFileUrl($item['image']);80 if($item['link_type'] == 1){81 $content = Menu_::getMenuContent(1,$item['link_address']);82 $item['link_address'] = $content['link'] ?? '';83 }84 }85 return ['count' => $count, 'lists' => $lists];86 }87 /*88 * æ°å¢89 */90 public static function add($post){91 $link_address = $post['menu'];92 if($post['link_type'] == 2){93 $link_address = $post['url'];94 }95 $time = time(); //å½åæ¶é´æª96 $data = [97 'name' => $post['name'],98 'image' => $post['image'],99 'decorate_type' => $post['decorate_type'],100 'link_type' => $post['link_type'],101 'link_address' => $link_address,102 'sort' => $post['sort']?:0,103 'update_time' => $time,104 'create_time' => $time,105 'is_show' => $post['is_show'],106 ];107 return Db::name('menu_decorate')->insert($data);108 }109 /*110 * ç¼è¾èå111 */112 public static function edit($post){113 $link_address = $post['menu'];114 if($post['link_type'] == 2){115 $link_address = $post['url'];116 }117 $time = time(); //å½åæ¶é´æª118 $data = [119 'name' => $post['name'],120 'image' => $post['image'],121 'decorate_type' => $post['decorate_type'],122 'link_type' => $post['link_type'],123 'link_address' => $link_address,124 'sort' => $post['sort']?:0,125 'update_time' => $time,126 'is_show' => $post['is_show'],127 ];128 return Db::name('menu_decorate')->where(['id'=>$post['id']])->update($data);129 }130 /*131 * å é¤èå132 */133 public static function del($id){134 $data= [135 'del' =>1,136 'update_time' =>time()137 ];138 return Db::name('menu_decorate')->where(['id'=>$id])->update($data);139 }140 /*141 * æ¹éå é¤èå142 */143 public static function batchDelMenuDecorate($ids){144 $data = [145 'del' => 1,146 'update_time' => time()147 ];148 return Db::name('menu_decorate')->where(['id'=>$ids])->update($data);149 }150 /*151 * è·åèå152 */153 public static function getMenuDecorate($id){154 $detail = Db::name('menu_decorate')->where(['id'=>$id])->find();155 $detail['abs_image'] = UrlServer::getFileUrl($detail['image']);156 return $detail;157 }158 /**159 * æ·»å - åºé¨å¯¼èª160 */161 public static function addNavigation($post)162 {163 if(empty($post['name'])) {164 return [165 'flag' => false,166 'msg' => '导èªå称ä¸è½ä¸ºç©º'167 ];168 }...
decorate
Using AI Code Generation
1$obj = new trim();2$obj->decorate('1.php');3$obj = new trim();4$obj->decorate('2.php');5$obj = new trim();6$obj->decorate('3.php');7$obj = new trim();8$obj->decorate('4.php');9$obj = new trim();10$obj->decorate('5.php');11$obj = new trim();12$obj->decorate('6.php');13$obj = new trim();14$obj->decorate('7.php');15$obj = new trim();16$obj->decorate('8.php');17$obj = new trim();18$obj->decorate('9.php');19$obj = new trim();20$obj->decorate('10.php');21$obj = new trim();22$obj->decorate('11.php');23$obj = new trim();24$obj->decorate('12.php');25$obj = new trim();26$obj->decorate('13.php');27$obj = new trim();28$obj->decorate('14.php');29$obj = new trim();30$obj->decorate('15.php');31$obj = new trim();32$obj->decorate('16.php');33$obj = new trim();34$obj->decorate('17.php');35$obj = new trim();
decorate
Using AI Code Generation
1$trim = new Trim();2$trim->decorate($string);3$trim = new Trim();4$trim->decorate($string);5$trim = new Trim();6$trim->decorate($string);7$trim = new Trim();8$trim->decorate($string);9$trim = new Trim();10$trim->decorate($string);11$trim = new Trim();12$decorator = new Decorator($trim);13$decorator->decorate($string);14$trim = new Trim();15$decorator = new Decorator($trim);16$decorator->decorate($string);17$trim = new Trim();18$decorator = new Decorator($trim);19$decorator->decorate($string);20$trim = new Trim();21$decorator = new Decorator($trim);22$decorator->decorate($string);23$trim = new Trim();24$decorator = new Decorator($trim);25$decorator->decorate($string);
decorate
Using AI Code Generation
1$obj = new trim();2$obj->decorate('string');3$obj = new trim();4$obj->decorate('string');5$obj = new trim();6$obj->decorate('string');
decorate
Using AI Code Generation
1$trim = new Trim(' this is a test ');2echo $trim->decorate();3$trim = new Trim(' this is a test ');4echo $trim->decorate();5$trim = new Trim(' this is a test ');6echo $trim->decorate();7$trim = new Trim(' this is a test ');8echo $trim->decorate();9$trim = new Trim(' this is a test ');10echo $trim->decorate();11$trim = new Trim(' this is a test ');12echo $trim->decorate();13$trim = new Trim(' this is a test ');14echo $trim->decorate();15$trim = new Trim(' this is a test ');16echo $trim->decorate();17$trim = new Trim(' this is a test ');18echo $trim->decorate();19$trim = new Trim(' this is a test ');20echo $trim->decorate();21$trim = new Trim(' this is a test ');22echo $trim->decorate();23$trim = new Trim(' this is a test ');24echo $trim->decorate();25$trim = new Trim(' this is a test ');26echo $trim->decorate();27$trim = new Trim(' this is a test ');28echo $trim->decorate();
decorate
Using AI Code Generation
1$trim = new trim();2$trim->decorate(' hello ');3$trim = new trim();4$trim->decorate(' hello ');5$trim = new trim();6$trim->decorate(' hello ');7$trim = new trim();8$trim->decorate(' hello ');9$trim = new trim();10$trim->decorate(' hello ');11$trim = new trim();12$trim->decorate(' hello ');13$trim = new trim();14$trim->decorate(' hello ');15$trim = new trim();16$trim->decorate(' hello ');17$trim = new trim();18$trim->decorate(' hello ');19$trim = new trim();20$trim->decorate(' hello ');21$trim = new trim();22$trim->decorate(' hello ');23$trim = new trim();24$trim->decorate(' hello ');25$trim = new trim();26$trim->decorate(' hello ');27$trim = new trim();28$trim->decorate(' hello ');29$trim = new trim();30$trim->decorate(' hello ');
decorate
Using AI Code Generation
1$trim = new trim();2$trim->setString(' Hello World ');3echo $trim->decorate();4$trim = new trim();5$trim->setString(' Hello World ');6echo $trim->decorate();7$trim = new trim();8$trim->setString(' Hello World ');9echo $trim->decorate();10$trim = new trim();11$trim->setString(' Hello World ');12echo $trim->decorate();13$trim = new trim();14$trim->setString(' Hello World ');15echo $trim->decorate();16$trim = new trim();17$trim->setString(' Hello World ');18echo $trim->decorate();19$trim = new trim();20$trim->setString(' Hello World ');21echo $trim->decorate();22$trim = new trim();23$trim->setString(' Hello World ');24echo $trim->decorate();25$trim = new trim();26$trim->setString(' Hello World ');27echo $trim->decorate();28$trim = new trim();29$trim->setString(' Hello World ');30echo $trim->decorate();31$trim = new trim();32$trim->setString(' Hello World ');33echo $trim->decorate();
decorate
Using AI Code Generation
1require_once 'trim.php';2$trim = new Trim();3$trim->decorate(' Hello World ');4require_once 'trim.php';5$trim = new Trim();6$trim->decorate(' Hello World ');7require_once 'trim.php';8$trim = new Trim();9$trim->decorate(' Hello World ');10require_once 'trim.php';11$trim = new Trim();12$trim->decorate(' Hello World ');13require_once 'trim.php';14$trim = new Trim();15$trim->decorate(' Hello World ');16require_once 'trim.php';17$trim = new Trim();18$trim->decorate(' Hello World ');19require_once 'trim.php';20$trim = new Trim();21$trim->decorate(' Hello World ');22require_once 'trim.php';23$trim = new Trim();24$trim->decorate(' Hello World ');25require_once 'trim.php';26$trim = new Trim();27$trim->decorate(' Hello World ');28require_once 'trim.php';29$trim = new Trim();30$trim->decorate(' Hello World ');31require_once 'trim.php';32$trim = new Trim();33$trim->decorate(' Hello World ');34require_once 'trim.php';
Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Execute automation tests with decorate on a cloud-based Grid of 3000+ real browsers and operating systems for both web and mobile applications.
Test now for FreeGet 100 minutes of automation test minutes FREE!!