作者 郭文星

123

... ... @@ -50,5 +50,7 @@
<path value="$PROJECT_DIR$/vendor/karsonzhang/fastadmin-addons" />
</include_path>
</component>
<component name="PhpProjectSharedConfiguration" php_language_level="7.2" />
<component name="PhpProjectSharedConfiguration" php_language_level="8.0">
<option name="suggestChangeDefaultLanguageLevel" value="false" />
</component>
</project>
\ No newline at end of file
... ...
... ... @@ -61,7 +61,8 @@ class Dashboard extends Backend
'todayusersignup' => User::whereTime('jointime', 'today')->count(),
'todayuserlogin' => User::whereTime('logintime', 'today')->count(),
'sevendau' => User::whereTime('jointime|logintime|prevtime', '-7 days')->count(),
'thirtydau' => User::whereTime('jointime|logintime|prevtime', '-30 days')->count(),
//'thirtydau' => User::whereTime('jointime|logintime|prevtime', '-30 days')->count(),
'newadditionorder' => \app\admin\model\Order::where("is_check",0)->count(),
'threednu' => User::whereTime('jointime', '-3 days')->count(),
'sevendnu' => User::whereTime('jointime', '-7 days')->count(),
'dbtablenums' => count($dbTableList),
... ...
... ... @@ -59,6 +59,7 @@ class Order extends Backend
->where($where)
->order($sort, $order)
->paginate($limit);
$res=$this->model->where("id",">",0)->update(["is_check"=>1]);
foreach ($list as $row) {
$row->visible(['id', 'order_no', 'type','intended_driver_id', 'pay_type', 'price', 'is_pay', 'user_name', 'driver_name', 'pay_time', 'refund_time', 'create_time']);
... ... @@ -194,5 +195,43 @@ class Order extends Backend
$this->success();
}
public function orderinfo($ids){
$row = Db::name("order")->field("id,order_no,pay_type,price,route_id,is_pay,phone,type")->find(['id' => $ids]);
if($row['is_pay']==1){
$row['is_pay']="已支付";
}elseif($row['is_pay']==2){
$row['is_pay']="未支付";
}elseif($row['is_pay']==3){
$row['is_pay']="已退款";
}elseif($row['is_pay']==4){
$row['is_pay']="已取消";
}
if($row['type']==1){
$row['type']="计票";
}elseif($row['type']==2){
$row['type']="城际";
}elseif($row['type']==3){
$row['type']="包车";
}
if($row['pay_type']=="wxpay"){
$row['pay_type']="微信";
}elseif($row['pay_type']=="offlinepay"){
$row['pay_type']="线下";
}
$route=Db::name("route")->find($row['route_id']);
$row['route_name']=$route['name'];
unset($row['route_id']);
if (!$row) {
$this->error(__('No Results were found'));
}
$this->view->assign("row", $row);
return $this->view->fetch();
}
public function chackorder(){
print_r(123);return;
$newadditionorder= \app\admin\model\Order::where("is_check",0)->count();
return $newadditionorder;
}
}
... ...
... ... @@ -18,6 +18,7 @@ return [
'Seven dnu' => '七日新增',
'Seven dau' => '七日活跃',
'Thirty dau' => '月活跃',
'New additionorder' => '新增订单',
'Custom zone' => '这里是你的自定义数据',
'Register user' => '注册用户数',
'Real time' => '实时',
... ...
... ... @@ -21,6 +21,8 @@ return [
'User_name' => '乘车人姓名',
'Driver_id' => '运行路线',
'Driver_name' => '运行路线名称',
'phone' => '联系电话',
'route_name' => '线路名称',
'Pay_time' => '支付时间',
'Refund_time' => '退款时间',
'Create_time' => '创建时间',
... ...
... ... @@ -233,8 +233,8 @@
<div class="col-xs-6 stat-col">
<div class="stat-icon"><i class="fa fa-user-circle-o"></i></div>
<div class="stat">
<div class="value"> {$thirtydau}</div>
<div class="name"> {:__('Thirty dau')}</div>
<div class="value" id="newadditionorder" name="newadditionorder"> {$newadditionorder}</div>
<div class="name"> {:__('New additionorder')}</div>
</div>
<div class="progress">
<div class="progress-bar progress-bar-success" style="width: 20%"></div>
... ... @@ -252,3 +252,20 @@
</div>
</div>
</div>
<script>
setInterval(() => {
console.log("=============")
$.ajax({ // 定义ajax发送请求
url: 'order/chackorder', // 请求发送的地址 有三种填写方式,与form标签的action一致
method: 'post', // 请求发送的方式
success: function (data) { // 异步等待,当后端响应成功会回调执行匿名函数,并将数据传递给data参数
var divValue = document.getElementById("newadditionorder").innerHTML;
console.log(divValue)
document.getElementById("newadditionorder").innerHTML = data;
}// 使用ajax交互,那么后端返回的数据会被data接收,不在直接影响整个浏览器页面
})
}, 5000); // 1000毫秒为间隔
</script>
\ No newline at end of file
... ...
<style>
.table-adminlog tr td {
word-break: break-all;
}
</style>
<table class="table table-striped table-adminlog">
<thead>
<tr>
<th width="100">{:__('Title')}</th>
<th>{:__('Content')}</th>
</tr>
</thead>
<tbody>
{volist name="row" id="vo" }
<tr>
<td>{:__($key)}</td>
<td>{if $key=='createtime'}{$vo|datetime}{else/}{$vo|htmlentities}{/if}</td>
</tr>
{/volist}
</tbody>
</table>
<div class="hide layer-footer">
<label class="control-label col-xs-12 col-sm-2"></label>
<div class="col-xs-12 col-sm-8">
<button type="reset" class="btn btn-primary btn-embossed btn-close" onclick="Layer.closeAll();">{:__('Close')}</button>
</div>
</div>
... ...
... ... @@ -93,6 +93,9 @@ class Car extends Base
{
$number = $this->request->param("number");//乘车人数
$phone = $this->request->param("phone");//联系手机号码
$starting_point = $this->request->param("starting_point");//出发位置
$end_point = $this->request->param("end_point");//到达位置
$passengers = $this->request->param("passengers");//乘车人
$user_name = $this->request->param("user_name");//联系人
$position = $this->request->param("position");//上车地址
$specificaddress_id = $this->request->param("specificaddress_id");//上车地址
... ... @@ -154,6 +157,9 @@ class Car extends Base
$data = [
"order_no" => getOrderSn(),
"price" => $price,
"starting_point" => $starting_point,//未支付
"end_point" => $end_point,//未支付
"passengers" => $passengers,//未支付
"is_pay" => "2",//未支付
"car_id" => $car_id,
"order_review_id" => $order_review_id,
... ... @@ -1134,6 +1140,9 @@ class Car extends Base
$route_id = $this->request->param("route_id");//线路
$position = $this->request->param("position");//上车地址
$lat = $this->request->param("lat");//经度
$starting_point = $this->request->param("starting_point");//出发位置
$end_point = $this->request->param("end_point");//到达位置
$passengers = $this->request->param("passengers");//乘车人
$specificaddress_id = $this->request->param("specificaddress_id");//区域id
$lng = $this->request->param("lng");//维度
$number = $this->request->param("number");//乘车人数
... ... @@ -1181,6 +1190,9 @@ class Car extends Base
"order_no" => getOrderSn(),
"price" => $price,
"position" => $position,
"starting_point" => $starting_point,
"end_point" => $end_point,
"passengers" => $passengers,
"driver_id" => $driver['id'],
"is_qrcode" => $is_qrcode,
"order_review_id" => $order_review_id,
... ... @@ -1202,6 +1214,9 @@ class Car extends Base
"order_no" => getOrderSn(),
"price" => $price,
"position" => $position,
"starting_point" => $starting_point,
"end_point" => $end_point,
"passengers" => $passengers,
"is_qrcode" => $is_qrcode,
"specificaddress_id" => $specificaddress_id,
"reservation_time" => $reservation_time,
... ...
... ... @@ -50,4 +50,6 @@ return array (
'notice' => '<p><span style="background-color: rgb(249, 249, 249);">通知公告</span><span style="background-color: rgb(249, 249, 249);">通知公告</span><span style="background-color: rgb(249, 249, 249);">通知公告</span><span style="background-color: rgb(249, 249, 249);">通知公告</span><span style="background-color: rgb(249, 249, 249);">通知公告</span><span style="background-color: rgb(249, 249, 249);">通知公告</span><br></p>',
'driver_authentication' => '<p>司机认证司机认证司机认证司机认证司机认证司机认证<br></p>',
'aboutwe' => '<p><span style="background-color: rgb(249, 249, 249);">关于我们</span><span style="background-color: rgb(249, 249, 249);">关于我们</span><span style="background-color: rgb(249, 249, 249);">关于我们</span><span style="background-color: rgb(249, 249, 249);">关于我们</span><br></p>',
'ordering_notice' => '<p class="MsoNormal"><span style="font-family: 微软雅黑; color: rgb(0, 0, 0); letter-spacing: 0pt; font-size: 10.5pt;">暴力恐怖犯罪线索举报办法:</span><span style="font-family: 微软雅黑; color: rgb(0, 0, 0); letter-spacing: 0pt; font-size: 10.5pt;"><br></span><span style="font-family: 微软雅黑; color: rgb(0, 0, 0); letter-spacing: 0pt; font-size: 10.5pt;">1、拨打“110”或公安机关公开的其他报警电话;</span><span style="font-family: 微软雅黑; color: rgb(0, 0, 0); letter-spacing: 0pt; font-size: 10.5pt;"><br></span><span style="font-family: 微软雅黑; color: rgb(0, 0, 0); letter-spacing: 0pt; font-size: 10.5pt;">2、手机用户发送短信至“12110”举报;</span><span style="font-family: 微软雅黑; color: rgb(0, 0, 0); letter-spacing: 0pt; font-size: 10.5pt;"><br></span><span style="font-family: 微软雅黑; color: rgb(0, 0, 0); letter-spacing: 0pt; font-size: 10.5pt;">3、通过信件向公安机关举报;</span><span style="font-family: 微软雅黑; color: rgb(0, 0, 0); letter-spacing: 0pt; font-size: 10.5pt;"><br></span><span style="font-family: 微软雅黑; color: rgb(0, 0, 0); letter-spacing: 0pt; font-size: 10.5pt;">4、到公安机关或向执勤民警当面举报;</span><span style="font-family: 微软雅黑; color: rgb(0, 0, 0); letter-spacing: 0pt; font-size: 10.5pt;"><br></span><span style="font-family: 微软雅黑; color: rgb(0, 0, 0); letter-spacing: 0pt; font-size: 10.5pt;">5、通过其他有效方式举报。</span><span style="mso-spacerun:\'yes\';font-family:宋体;font-size:14.0000pt;
mso-font-kerning:1.0000pt;"><o:p></o:p></span></p>',
);
... ...
... ... @@ -115,16 +115,16 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'template'], function
url: 'order/refund?id={id}',
},
// {
// name: 'selectiondriver',
// title: __('选择司机'),
// classname: 'btn btn-xs btn-primary btn-dialog',
// icon: 'fa fa-list',
// url: 'order/selectiondriver?id={id}',
// callback: function (data) {
// Layer.alert("接收到回传数据:" + JSON.stringify(data), {title: "回传数据"});
// }
// },
{
name: 'orderinfo',
title: __('订单详情'),
classname: 'btn btn-xs btn-primary btn-dialog',
icon: 'fa fa-list',
url: 'order/orderinfo?id={id}',
callback: function (data) {
Layer.alert("接收到回传数据:" + JSON.stringify(data), {title: "回传数据"});
}
},
// {
// name: 'selectiondriver',
// text:"选择司机",
... ...