diff --git a/app/Http/Controllers/Order/OrderController.php b/app/Http/Controllers/Order/OrderController.php
index bd6cefc..b5e3b79 100644
--- a/app/Http/Controllers/Order/OrderController.php
+++ b/app/Http/Controllers/Order/OrderController.php
@@ -71,10 +71,11 @@ 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;
}
public function displayOrder(){
diff --git a/public/js/create_records/order.js b/public/js/create_records/order.js
index eaca595..3cdaba0 100644
--- a/public/js/create_records/order.js
+++ b/public/js/create_records/order.js
@@ -53,16 +53,17 @@ yinjiApp.controller('orderController',
})
.success(function(data) {
if(data != null){
- console.log(data);
+ console.log(data.length);
imgList = data;
for(var i = 0; i < data.length; i++){
- var ele = "";
- $("div.order_text").append(ele);
+ var ele = "";
+ $("div.order_text").append(ele);
+ }
+ if(data.length != 0){
+ temId = "img" + data[0].id;
+ document.getElementById(temId).className = "hasBorder";
}
- //var tt = "img" + data[0].id;
- //console.log(tt);
- temId = "img" + data[0].id;
- document.getElementById(temId).className = "hasBorder";
+
}
else{
console.log("false");
@@ -83,7 +84,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方法