叉p
2017-06-29 07:50
采纳率: 100%
浏览 3.8k
已采纳

jquery ajax怎么按条件查询数据

var app = angular.module('myApp', ['ui.bootstrap']);
app.controller('myCtrl', function ($scope) {
$scope.param = {};
$scope.search = function () {
$scope.loading = true;
$scope.param.orderBy = "id";
$scope.param.pageSize = "12";
$.ajax({
url: apiArtworkReadList,
data: $scope.param
}).then(function (result) {
$scope.loading = false;
if (result.httpCode == 200) {
/*if ($scope.param.saleStatus = 1) {*/
$scope.PageInfo = result.data
/* }*/
} else {
$scope.msg = result.msg;
}
$scope.$apply();

        });
    };

``
jquery 小白,想查询数据中saleStatus=1的数据返回到json类型  应该怎么修改

  • 写回答
  • 好问题 提建议
  • 追加酬金
  • 关注问题
  • 邀请回答

3条回答 默认 最新

  • 丵鹰 2017-06-29 07:55
    最佳回答
     var app = angular.module('myApp', ['ui.bootstrap']);
    app.controller('myCtrl', function ($scope) {
    $scope.param = {};
    $scope.search = function () {
    $scope.loading = true;
    $scope.param.orderBy = "id";
    $scope.param.pageSize = "12";
    $scope.param.saleStatus = 1;//加上这个添加,后台处理是看到有没有带上这个条件,没有的话还需加上
    $.ajax({
    url: apiArtworkReadList,
    data: $scope.param
    }).then(function (result) {
    $scope.loading = false;
    if (result.httpCode == 200) {
    
    $scope.PageInfo = result.data
    
    } else {
    $scope.msg = result.msg;
    }
    $scope.$apply();
            });
        };
    
    评论
    解决 无用
    打赏 举报
查看更多回答(2条)

相关推荐 更多相似问题