Browse Source

操作备注

master
nizongfeng 1 year ago
parent
commit
a806c0a8d7
5 changed files with 57 additions and 4 deletions
  1. +12
    -1
      application/admin/controller/OrderMain.php
  2. +1
    -1
      application/admin/dao/OrderHotelDao.php
  3. +1
    -1
      application/admin/dao/OrderItemDao.php
  4. +19
    -1
      application/admin/dao/OrderMainDao.php
  5. +24
    -0
      application/admin/view/order_main/index.html

+ 12
- 1
application/admin/controller/OrderMain.php View File

@@ -3,6 +3,7 @@
namespace app\admin\controller;

use app\admin\dao\GroupDao;
use app\admin\dao\OrderMainDao;
use app\admin\dao\OrderMemoDao;
use app\admin\model\Area;
use app\admin\service\OrderMainService;
@@ -19,7 +20,7 @@ use think\Loader;
*/
class OrderMain extends Backend
{
protected $noNeedRight = ['getOrderList',"save","delSubOrder","subOrderSave","getShowInfo","newAdd","insertOrderMain","addMemo","getMemoList"];
protected $noNeedRight = ['getOrderList',"save","delSubOrder","subOrderSave","getShowInfo","newAdd","insertOrderMain","addMemo","getMemoList","setHotFlag"];
/**
* OrderMain模型对象
* @var \app\admin\model\OrderMain
@@ -157,4 +158,14 @@ class OrderMain extends Backend
return json($result);
}

/**
* 添加日志记录
* @return \think\response\Json
*/
public function setHotFlag(){
$params=$this->request->post();
$model = new OrderMainDao();
$result = $model->setHotFlag($params["order_id"],$params["val"]);
return json($result);
}
}

+ 1
- 1
application/admin/dao/OrderHotelDao.php View File

@@ -333,7 +333,7 @@ class OrderHotelDao
public function getOrderListByOrderIds($orderIds){
$subOrderModel = new OrderHotel();
try {
$subOrderList = $subOrderModel->where(["order_id" => ["in",$orderIds], "del_flag" => 0])->select()->toArray();
$subOrderList = $subOrderModel->where(["order_id" => ["in",$orderIds], "del_flag" => 0])->order("id","DESC")->select()->toArray();
if (null == $subOrderList) {
return [];
}


+ 1
- 1
application/admin/dao/OrderItemDao.php View File

@@ -284,7 +284,7 @@ class OrderItemDao
public function getOrderListByOrderIds($orderIds){
$subOrderModel = new OrderItem();
try {
$subOrderList = $subOrderModel->where(["order_id" => ["in",$orderIds], "del_flag" => 0])->select()->toArray();
$subOrderList = $subOrderModel->where(["order_id" => ["in",$orderIds], "del_flag" => 0])->order("id","DESC")->select()->toArray();
if (null == $subOrderList) {
return [];
}


+ 19
- 1
application/admin/dao/OrderMainDao.php View File

@@ -359,11 +359,29 @@ class OrderMainDao
left join hbp_order_item c on c.order_id = a.id and c.del_flag=0
where {$where}
GROUP BY a.id
order by a.id desc
order by a.hot_seq desc,a.id desc
limit {$limit} offset {$offset}
";
$list = Db::query($sqlList);
$result = ["list"=>$list,"total"=>$totalRe[0]['cnt']];
return Util::returnArrSu("",$result);
}

/**
* 设置星标
* @param $params
* @return array
*/
public function setHotFlag($order_id,$val) {
try{
$data = [
"hot_seq"=>$val
];
$model = new OrderMain();
$model->save($data,["id"=>$order_id]);
return Util::returnArrSu();
}catch (Exception $e){
return Util::returnArrEr("将主订单从收款单下移除失败".$e->getMessage());
}
}
}

+ 24
- 0
application/admin/view/order_main/index.html View File

@@ -152,6 +152,12 @@
</div>
<el-table ref="multipleTable" :data="tableData" border tooltip-effect="dark"
style="font-size:12px;width: 100%;margin-top: 12px">
<el-table-column width="50">
<template slot-scope="scope" >
<i class="el-icon-star-off" style="font-size: 18px" v-if="scope.row.hot_seq == 0" @click="setHotSeq(scope.$index,10)"></i>
<i class="el-icon-star-on" style="font-size:22px;color: red" v-if="scope.row.hot_seq > 0" @click="setHotSeq(scope.$index,0)"></i>
</template>
</el-table-column>
<el-table-column prop="id" label="订单ID" min-width="30" ></el-table-column>
<el-table-column prop="commissioner" label="专员" min-width="40" ></el-table-column>
<el-table-column prop="channel_order_no" label="渠道" min-width="120" >
@@ -653,6 +659,24 @@
this.showMemo = true
this.addMemo.order_id = order_id;
this.getMemoList();
},
setHotSeq(index,val){
let info = this.tableData[index]
let param = {
order_id:info["id"],
val:val
}
axios.post("/hotel.php/order_main/setHotFlag", param).then((response) => {
let data = response.data;
if (data.flag) {
this.tableData[index].hot_seq=val
this.$message.success("设置成功");
} else {
this.$message.error(response.msg);
}
}).catch(function (error) {
console.log(error);
});
}
}
})


Loading…
Cancel
Save