文档详情

SQL操作及分页.doc

发布:2017-12-16约1.08万字共14页下载文档
文本预览下载声明
Find class brandControl extends SystemControl $model_brand = Model(); $v = intval($v); $brand_array = $model_brand-table(brand)-where(array(brand_id=$v))-find(); $condition[gname] = $_GET[gname]; $info = Model(gadmin)-where($condition)-find(); $attr_info = $model-table(attribute)-where(attr_id=.$attr_id)-find(); $attr_value_list = $model-table(attribute_value)-where(attr_id=.$attr_id)-order(attr_value_sort asc, attr_value_id asc)-select(); $model = Model(voucher); //查询模板信息 $param = array(); $param[voucher_t_id] = $t_id; $t_info = $model-table(voucher_template)-where($param)-find(); $this-cm_info = Model()-table(circle_member)-where(array(circle_id=$this-c_id, member_id=$_SESSION[member_id]))-find(); $class_info = Model()-table(circle_class)-find($this-circle_info[class_id]); Tpl::output(class_info, $class_info); Update $model = Model(); //更新过期套餐的状态 $time = time(); $model-table(voucher_quota)-where(array(quota_endtime=array(lt,$time),quota_state={$this-quotastate_arr[activity][0]}))-update(array(quota_state=$this-quotastate_arr[expire][0])); public function set($key, $value, $type=, $ttl = SESSION_EXPIRE){ $info = $this-model-where(array(pid=$key))-find(); if ($info){ $this-model-where(array(pid=$key))-update(array(pvalue=$value,expiretime=TIMESTAMP+$ttl)); }else{ $this-model-insert(array(pid=$key,pvalue=$value,expiretime=TIMESTAMP+$ttl)); } } /** ??? ?* 更新信息 ??? ?* ??? ?* @param array $param 更新数据 ??? ?* @return bool 布尔类型的返回结果 ??? ?*/ ??? public function update($param){ ??? ??? if (empty($param)){ ??? ??? ??? return false; ??? ??? } ??? ??? if (is_array($param)){ ??? ??? ??? $tmp = array(); ??? ??? ??? foreach ($param as $k = $v){ ??? ??? ??? ??? $tmp[$k] = $v; ??? ??? ??? } ??? ??? ??? $where = sc_id = . $param[sc_id] .; ??? ??? ??? $result = Db::update(store_class,$tmp,$where); ??? ??? ??? return $result; ??? ??? }else { ??? ??? ??? return false; ??? ??? } ??? } Select /** * 套餐管理 **/ public fu
显示全部
相似文档