Skip to content

Commit

Permalink
公司新消息提醒修改
Browse files Browse the repository at this point in the history
  • Loading branch information
canzhen committed Jun 20, 2016
1 parent 74026dd commit 3be3fc8
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 12 deletions.
2 changes: 1 addition & 1 deletion app/Http/Controllers/CpyController.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public function getBadEva(){
* @return 所有订单
*/
public function getOrders(){
return Order::all();
return Order::where([])->orderBy('id')->get();
}

/**
Expand Down
32 changes: 22 additions & 10 deletions app/Http/Controllers/Order/OrderController.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
use Illuminate\Http\Request;

use App\Order;
use App\Evaluation;
use App\Http\Requests;
use App\Http\Controllers\Controller;

Expand Down Expand Up @@ -98,18 +99,29 @@ public function assessOrder(){
//\DB::table('orders')->where('id', $orderId)->update(['assess' => $detail]);


$eid = \DB::table('evaluation')
->insertGetId(
array(
'order_id' => $orderId,
'parent_eva_id' => "-1",
'user_name' => $curName,
'reply_user_name' => "",
'content' => $detail
)
);
$newEvaluation = new Evaluation;
$newEvaluation->order_id=$orderId;
$newEvaluation->parent_eva_id="-1";
$newEvaluation->user_name=$curName;
$newEvaluation->reply_user_name="";
$newEvaluation->content=$detail;
$eid = $newEvaluation->save();
// $eid = \DB::table('evaluation')
// ->insertGetId(
// array(
// 'order_id' => $orderId,
// 'parent_eva_id' => "-1",
// 'user_name' => $curName,
// 'reply_user_name' => "",
// 'content' => $detail
// )
// );

//return $detail. "#".$orderId."#".$curName;
if ($eid)
return 1;
else
return null;
return $eid;
}
}
6 changes: 5 additions & 1 deletion public/js/layouts/cpy_sidebar/cpy_sidebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,11 @@ yinjiApp.controller('cpyNavController',
$http.get("/cpy/getEvaluations")
.success(function (response)
{
console.log(response);
console.log(response.length);
console.log(response[response.length-1]);
if (response != null && response.length > 0){
var fullDateInfo = response[response.length-1].created_at.split(" ");
var fullDateInfo = response[0].created_at.split(" ");
var date = fullDateInfo[0].split("-");
date[0]=parseInt(date[0]);
date[1]=parseInt(date[1]);
Expand All @@ -88,6 +91,7 @@ yinjiApp.controller('cpyNavController',
$http.get("/cpy/getOrders")
.success(function (response)
{
console.log(response);
if (response != null && response.length > 0) {
var fullDateInfo = response[response.length - 1].order_date.split(" ");
var date = fullDateInfo[0].split("-");
Expand Down

0 comments on commit 3be3fc8

Please sign in to comment.