Skip to content

Commit

Permalink
订单修改
Browse files Browse the repository at this point in the history
  • Loading branch information
canzhen committed Jun 19, 2016
2 parents 02c80e3 + f29ef70 commit d8a336f
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 35 deletions.
15 changes: 9 additions & 6 deletions app/Http/Controllers/Order/OrderController.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public function addOrder(){
$oComment = $_GET['oComment'];
$oNum = $_GET['oNum'];
$oPrice = $_GET['oPrice'];

$orderTime = date('y-m-d H:i:s', time());

$userId = $_SESSION['userId'];
Expand Down Expand Up @@ -55,7 +55,9 @@ public function addOrder(){
//模版使用次数自增
\DB::table('templates')->where('id', $oTem)->increment('count');

return $eid;
//return $eid;

return $curAlbumName[0];
}


Expand All @@ -71,11 +73,12 @@ public function deleteOrder(){
public function getTemplates(){
if(!isset($_SESSION)){
session_start();
}
}
$curName = $_SESSION['userName'];
///$resSet = \DB::table('templates')->where('author_name', $curName)->get();
//return $resSet;
return $curName;
$resSet = \DB::table('templates')->get();
return $resSet;
//return $curName;

}

public function displayOrder(){
Expand Down
46 changes: 18 additions & 28 deletions public/js/create_records/order.js
Original file line number Diff line number Diff line change
@@ -1,25 +1,7 @@
window.imgList = "";
window.temId = 0;

function deleteOrder(){
$.ajax({
type: 'get',
url: '/deleteOrder',

dataType : "text",
success : function(data) {
if(data != null){
console.log(data);
//alert("删除成功!");
//window.location.href = "/home";
}
},
error : function() {
alert("false");
}
});

}

function selectTemplate(objId){
for (var i = 0; i < imgList.length; i++) {
Expand Down Expand Up @@ -59,10 +41,11 @@ yinjiApp.controller('orderController',
var ele = "<img src = '" + data[i].saving_path + "' id = 'img" + data[i].id + "' title = '" + data[i].description + "' onclick = 'selectTemplate(this.id)' class = 'noBorder'>";
$("div.order_text").append(ele);
}
//var tt = "img" + data[0].id;
//console.log(tt);
temId = "img" + data[0].id;
document.getElementById(temId).className = "hasBorder";
if(data.length != 0){
temId = "img" + data[0].id;
document.getElementById(temId).className = "hasBorder";
}

}
else{
console.log("false");
Expand All @@ -71,6 +54,7 @@ yinjiApp.controller('orderController',


$scope.addOrder = function(){

if($("#text_box2").val() < $("#text_box1").val()){
alert("页码错误");
}
Expand All @@ -83,7 +67,13 @@ yinjiApp.controller('orderController',
commentText = "无";
}

var oTem = temId.substring(3,4);
if(temId == 0){
//console.log("00000");
var oTem = 0;
}else{
var oTem = temId.substring(3,4);

}

$http({
method: 'GET',//注意,这里必须要用GET方法
Expand All @@ -92,17 +82,17 @@ yinjiApp.controller('orderController',
'oName': $scope.oName,
'oPhone': $scope.oPhone,
'oAddress' : $scope.oAddress,
'oComment' : commentText,
'oNum' : pageRange,
'oPrice' : pagePrice,
'oTemplate' : oTem
'oComment' : commentText,
'oNum' : pageRange,
'oPrice' : pagePrice,
'oTemplate' : oTem
}
})
.success(function(data) {
if(data != null){
console.log(data);
alert("成功!");
window.location.href = "/";
window.location.href = "/orderInfo";
}
else{
console.log("false");
Expand Down
3 changes: 2 additions & 1 deletion public/js/orderDetail.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ function deleteOrder(objId, obj){
if(data != null){
console.log(data);
alert("删除成功!");
deleteCurRow(obj);
//deleteCurRow(obj);
window.location.reload();
}
},
error : function() {
Expand Down

0 comments on commit d8a336f

Please sign in to comment.