作者 郭文星

123

... ... @@ -2,6 +2,8 @@
namespace app\admin\controller;
use app\admin\model\User;
use app\api\controller\v1\WxxcxPush;
use app\common\controller\Backend;
use think\Db;
use think\exception\DbException;
... ... @@ -62,7 +64,7 @@ class Order extends Backend
$res=$this->model->where("id",">",0)->update(["is_check"=>1]);
foreach ($list as $row) {
$row->visible(['id', 'order_no','phone', 'type','intended_driver_id', 'pay_type', 'price', 'is_pay', 'user_name', 'driver_name', 'pay_time', 'refund_time', 'create_time']);
$row->visible(['id', 'order_no','phone', 'type','intended_driver_id', 'pay_type', 'price', 'is_pay', 'user_name', 'driver_name', 'pay_time', 'refund_time','reservation_time', 'create_time']);
$row->visible(['driver']);
$row->getRelation('driver')->visible(['name']);
$row->visible(['car']);
... ... @@ -80,6 +82,8 @@ class Order extends Backend
public function refund($id)
{
$res=$this->refundSendMessage($id);
print_r($res);return;
//查询订单
$order = Db::name("order")->where("id", $id)->find();
if ($order['is_pay'] != 1) {
... ... @@ -242,5 +246,21 @@ class Order extends Backend
$newadditionorder= \app\admin\model\Order::where("driver_id",null)->count();
return $newadditionorder;
}
/**
* 发送模板消息
* @return void
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
function refundSendMessage($order_id){
$order=\think\Db::name("order")->find($order_id);
$wxxcxpush=new WxxcxPush();
$user=new User();
$user=$user->find($order['user_id']);
$res=$wxxcxpush->refundMessage($user['wx_xcx_openid'],$order_id);
if ($res !== false) {
return $res;
}
}
}
... ...
... ... @@ -28,6 +28,7 @@ return [
'route_name' => '线路名称',
'Pay_time' => '支付时间',
'Refund_time' => '退款时间',
'Reservation_time' => '预约时间',
'Create_time' => '创建时间',
'Driver.name' => '司机名称',
'Car.license_plate' => '车牌号',
... ...
... ... @@ -176,6 +176,7 @@ if (!function_exists('getOrderSn')) {
* @throws \think\exception\DbException
*/
function refundSendMessage($order_id){
print_r($$order_id);return;
$order=\think\Db::name("order")->find($order_id);
$wxxcxpush=new WxxcxPush();
$user=new User();
... ...
... ... @@ -46,7 +46,7 @@ return array (
'wxxcx_AppSecret' => 'baf744d21875280a5e98611f66adaf91',
'content' => '111111111111111111111222222222',
'alarm_phone' => '13528348347',
'riding_instructions' => '<p>乘车须知乘车须知乘车须知乘车须知乘车须知乘车须知<br></p>',
'riding_instructions' => '<p><span style="font-size: 10.5pt; letter-spacing: 0pt; font-family: 微软雅黑; color: rgb(0, 0, 0);">暴力恐怖犯罪线索举报办法:</span><span style="font-size: 10.5pt; letter-spacing: 0pt; font-family: 微软雅黑; color: rgb(0, 0, 0);"><br></span><span style="font-size: 10.5pt; letter-spacing: 0pt; font-family: 微软雅黑; color: rgb(0, 0, 0);">1、拨打“110”或公安机关公开的其他报警电话;</span><span style="font-size: 10.5pt; letter-spacing: 0pt; font-family: 微软雅黑; color: rgb(0, 0, 0);"><br></span><span style="font-size: 10.5pt; letter-spacing: 0pt; font-family: 微软雅黑; color: rgb(0, 0, 0);">2、手机用户发送短信至“12110”举报;</span><span style="font-size: 10.5pt; letter-spacing: 0pt; font-family: 微软雅黑; color: rgb(0, 0, 0);"><br></span><span style="font-size: 10.5pt; letter-spacing: 0pt; font-family: 微软雅黑; color: rgb(0, 0, 0);">3、通过信件向公安机关举报;</span><span style="font-size: 10.5pt; letter-spacing: 0pt; font-family: 微软雅黑; color: rgb(0, 0, 0);"><br></span><span style="font-size: 10.5pt; letter-spacing: 0pt; font-family: 微软雅黑; color: rgb(0, 0, 0);">4、到公安机关或向执勤民警当面举报;</span><span style="font-size: 10.5pt; letter-spacing: 0pt; font-family: 微软雅黑; color: rgb(0, 0, 0);"><br></span><span style="font-size: 10.5pt; letter-spacing: 0pt; font-family: 微软雅黑; color: rgb(0, 0, 0);">5、通过其他有效方式举报。</span><br></p>',
'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>',
... ...
... ... @@ -84,6 +84,14 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'template'], function
autocomplete: false,
formatter: Table.api.formatter.datetime
},
{
field: 'reservation_time',
title: __('Reservation_time'),
operate: 'RANGE',
addclass: 'datetimerange',
autocomplete: false,
formatter: Table.api.formatter.datetime
},
{field: 'user.username', title: __('User.username'), operate: 'LIKE'},
{field: 'phone', title: __('Phone'), operate: 'LIKE'},
{
... ...