• 欢迎访问搞代码网站,推荐使用最新版火狐浏览器和Chrome浏览器访问本网站!
  • 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏搞代码吧

php 自定义排序

php 搞代码 4年前 (2022-01-22) 22次浏览 已收录 0个评论

这篇文章介绍的内容是关于php 自定义排序,有着一定的参考价值,现在分享给大家,有需要的朋友可以参考一下

html 页面

<td class="textcenter">                  <input type="text" name="cat[order]" value="{$vo.order}" class="hy_input orders" orderid="{$vo.cat_id}" style="width:50px;" />          </td>js 页面<script type="text/javascript">     $(".orders").change(function(){             var orderid = $(this).attr('orderid');             var ordernum = $(this).val();             $.post("{:U('Image/listorder')}",{"orderid":orderid,"ordernum":ordernum},function(data){                      if(data.code==1000){                           location.replace(location);                       }else{                         alert(data.msg);                      }             },"json");               });</script>

php页面:

/**	 * 排序操作	 */	public function listorder(){         if(IS_POST){                $orderid = I("post.orderid",'','intval');                $ordernum = I("post.ordernum",'','intval');               <strong style="color:transparent">¥本文来源gaodai#ma#com搞@@代~&码网^</strong><small>搞gaodaima代码</small> if(empty($orderid)){                    $ini=array(                          'code'=>222,                          'msg'=>'id不合法'                    );                    $this->ajaxReturn($ini);                }                $listresult = M('Cat')->where("cat_id={$orderid} and status=0")->find();                if(empty($orderid)){					$ini=array(                          'code'=>223,                          'msg'=>'id已失效'                    );                    $this->ajaxReturn($ini);                }                $arr =array();                $arr['order']  = $ordernum;                $result = M('Cat')->where("cat_id={$orderid}")->save($arr);                if($result){                    $ini=array(                          'code'=>1000,                          'msg'=>'操作成功'                    );                }else{					$ini=array(                          'code'=>224,                          'msg'=>'操作失败'                    );                }                $this->ajaxReturn($ini);         }	}

以上就是php 自定义排序的详细内容,更多请关注搞代码gaodaima其它相关文章!


搞代码网(gaodaima.com)提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请说明详细缘由并提供版权或权益证明然后发送到邮箱[email protected],我们会在看到邮件的第一时间内为您处理,或直接联系QQ:872152909。本网站采用BY-NC-SA协议进行授权
转载请注明原文链接:php 自定义排序
喜欢 (0)
[搞代码]
分享 (0)
发表我的评论
取消评论

表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址