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类型 应该怎么修改
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();
});
};
怎么按条件查询数据 :数据不是查询不是按照ajax的问题,最后的的数据一定是从数据库出来的!所以是你数据传导后台,查询
这个不用你修改,是后端返回的数据,1表示有返回,前端只是获取到了后端的返回数据做判断