正在显示
9 个修改的文件
包含
232 行增加
和
30 行删除
| @@ -29,6 +29,7 @@ class Order extends Backend | @@ -29,6 +29,7 @@ class Order extends Backend | ||
| 29 | parent::_initialize(); | 29 | parent::_initialize(); |
| 30 | $this->model = new \app\admin\model\Order; | 30 | $this->model = new \app\admin\model\Order; |
| 31 | $this->view->assign("isPayList", $this->model->getIsPayList()); | 31 | $this->view->assign("isPayList", $this->model->getIsPayList()); |
| 32 | + $this->view->assign("typeList", $this->model->gettypeList()); | ||
| 32 | } | 33 | } |
| 33 | 34 | ||
| 34 | 35 | ||
| @@ -235,6 +236,8 @@ class Order extends Backend | @@ -235,6 +236,8 @@ class Order extends Backend | ||
| 235 | $row['pay_type']="微信"; | 236 | $row['pay_type']="微信"; |
| 236 | }elseif($row['pay_type']=="offlinepay"){ | 237 | }elseif($row['pay_type']=="offlinepay"){ |
| 237 | $row['pay_type']="线下"; | 238 | $row['pay_type']="线下"; |
| 239 | + }elseif($row['pay_type']=="background"){ | ||
| 240 | + $row['pay_type']="后台下单"; | ||
| 238 | } | 241 | } |
| 239 | $route=Db::name("route")->find($row['route_id']); | 242 | $route=Db::name("route")->find($row['route_id']); |
| 240 | $row['route_name']=$route['name']; | 243 | $row['route_name']=$route['name']; |
| @@ -271,4 +274,101 @@ class Order extends Backend | @@ -271,4 +274,101 @@ class Order extends Backend | ||
| 271 | return $res; | 274 | return $res; |
| 272 | } | 275 | } |
| 273 | } | 276 | } |
| 274 | -} | 277 | + |
| 278 | + /** | ||
| 279 | + * 检查是否有新订单 | ||
| 280 | + * @return void | ||
| 281 | + */ | ||
| 282 | + public function chackordershow(){ | ||
| 283 | + $res=Db::name("order")->where("is_show",0)->select(); | ||
| 284 | + $isreturn=0; | ||
| 285 | + if(!empty($res)){ | ||
| 286 | + $isreturn=1; | ||
| 287 | + $updateres=Db::name("order")->where("is_show",0)->update(["is_show"=>1]); | ||
| 288 | + return $isreturn; | ||
| 289 | + }else{ | ||
| 290 | + return $isreturn; | ||
| 291 | + } | ||
| 292 | + } | ||
| 293 | + /** | ||
| 294 | + * 添加 | ||
| 295 | + * | ||
| 296 | + * @return string | ||
| 297 | + * @throws \think\Exception | ||
| 298 | + */ | ||
| 299 | + public function add() | ||
| 300 | + { | ||
| 301 | + if (false === $this->request->isPost()) { | ||
| 302 | + return $this->view->fetch(); | ||
| 303 | + } | ||
| 304 | + $params = $this->request->post('row/a'); | ||
| 305 | + if (empty($params)) { | ||
| 306 | + $this->error(__('Parameter %s can not be empty', '')); | ||
| 307 | + } | ||
| 308 | + $params = $this->preExcludeFields($params); | ||
| 309 | + $params['pay_type']="background"; | ||
| 310 | + $params['is_pay']=1; | ||
| 311 | + $driver=Db::name("driver")->where("id",$params['driver_id'])->find(); | ||
| 312 | + $params['driver_name']=$driver['name']; | ||
| 313 | + $params['order_no']=$this->getOrderSn(); | ||
| 314 | + if ($this->dataLimit && $this->dataLimitFieldAutoFill) { | ||
| 315 | + $params[$this->dataLimitField] = $this->auth->id; | ||
| 316 | + } | ||
| 317 | + $result = false; | ||
| 318 | + Db::startTrans(); | ||
| 319 | + try { | ||
| 320 | + //是否采用模型验证 | ||
| 321 | + if ($this->modelValidate) { | ||
| 322 | + $name = str_replace("\\model\\", "\\validate\\", get_class($this->model)); | ||
| 323 | + $validate = is_bool($this->modelValidate) ? ($this->modelSceneValidate ? $name . '.add' : $name) : $this->modelValidate; | ||
| 324 | + $this->model->validateFailException()->validate($validate); | ||
| 325 | + } | ||
| 326 | + | ||
| 327 | + $passenger=Db::name("passenger")->insertGetId(['name'=>$params['user_name'],'IDcard'=>$params['IDcard'],'phone'=>$params['phone']]); | ||
| 328 | + $params['passengers']=$passenger; | ||
| 329 | + //判断总表 | ||
| 330 | + $time = strtotime(date("Y-m-d", time())); | ||
| 331 | + $order_review = Db::name("order_review") | ||
| 332 | + ->where("car_id", $params['car_id']) | ||
| 333 | + ->where("route_id", $params['route_id']) | ||
| 334 | + ->where("driver_id", $params['driver_id']) | ||
| 335 | + ->where("createtime", ">", $time) | ||
| 336 | + ->find(); | ||
| 337 | + | ||
| 338 | + if (!$order_review) { | ||
| 339 | + $order_review_id = Db::name("order_review") | ||
| 340 | + ->insertGetId([ | ||
| 341 | + "car_id" => $params['car_id'], | ||
| 342 | + "route_id" => $params['route_id'], | ||
| 343 | + "driver_id" => $params['driver_id'], | ||
| 344 | + "type" => 1, | ||
| 345 | + "order_status" => 1, | ||
| 346 | + "createtime" => time() | ||
| 347 | + ]); | ||
| 348 | + } else { | ||
| 349 | + $order_review_id = $order_review['id']; | ||
| 350 | + } | ||
| 351 | + $params['order_review_id']=$order_review_id; | ||
| 352 | + $result = $this->model->allowField(true)->save($params); | ||
| 353 | + Db::commit(); | ||
| 354 | + } catch (ValidateException|PDOException|Exception $e) { | ||
| 355 | + Db::rollback(); | ||
| 356 | + $this->error($e->getMessage()); | ||
| 357 | + } | ||
| 358 | + if ($result === false) { | ||
| 359 | + $this->error(__('No rows were inserted')); | ||
| 360 | + } | ||
| 361 | + $this->success(); | ||
| 362 | + } | ||
| 363 | + function getOrderSn() | ||
| 364 | + { | ||
| 365 | + $orderid = date("YmdHis") . mt_rand(1000, 999999); | ||
| 366 | + $odcks = \think\Db::name('order') | ||
| 367 | + ->where(['order_no' => $orderid]) | ||
| 368 | + ->find(); | ||
| 369 | + while (!empty($odcks)) { | ||
| 370 | + $orderid = date("YmdHis") . mt_rand(1000, 999999); | ||
| 371 | + } | ||
| 372 | + return $orderid; | ||
| 373 | + } | ||
| 374 | +} |
| @@ -12,25 +12,31 @@ return [ | @@ -12,25 +12,31 @@ return [ | ||
| 12 | 'Type' => '订单类型', | 12 | 'Type' => '订单类型', |
| 13 | 'Type 1' => '计票', | 13 | 'Type 1' => '计票', |
| 14 | 'Type 2' => '城际', | 14 | 'Type 2' => '城际', |
| 15 | + 'Type 3' => '包车', | ||
| 15 | 'Pay_type' => '支付类型', | 16 | 'Pay_type' => '支付类型', |
| 16 | 'passenger' => '乘车人信息', | 17 | 'passenger' => '乘车人信息', |
| 17 | 'Pay_type wxpay' => '微信支付', | 18 | 'Pay_type wxpay' => '微信支付', |
| 18 | 'Pay_type offlinepay' => '线下支付', | 19 | 'Pay_type offlinepay' => '线下支付', |
| 20 | + 'Pay_type background' => '后台下单', | ||
| 19 | 'Type 3' => '包车', | 21 | 'Type 3' => '包车', |
| 20 | 'Starting_point' => '出发位置', | 22 | 'Starting_point' => '出发位置', |
| 21 | 'End_point' => '到达位置', | 23 | 'End_point' => '到达位置', |
| 22 | 'Car_id' => '订单车辆', | 24 | 'Car_id' => '订单车辆', |
| 23 | 'User_id' => '乘车人', | 25 | 'User_id' => '乘车人', |
| 24 | 'User_name' => '乘车人姓名', | 26 | 'User_name' => '乘车人姓名', |
| 25 | - 'Driver_id' => '运行路线', | ||
| 26 | - 'Driver_name' => '运行路线名称', | 27 | + 'Route_id' => '选择线路', |
| 28 | + 'Driver_id' => '司机名称', | ||
| 29 | + //'Driver_name' => '运行路线名称', | ||
| 27 | 'phone' => '联系电话', | 30 | 'phone' => '联系电话', |
| 28 | 'route_name' => '线路名称', | 31 | 'route_name' => '线路名称', |
| 29 | 'Pay_time' => '支付时间', | 32 | 'Pay_time' => '支付时间', |
| 30 | 'Refund_time' => '退款时间', | 33 | 'Refund_time' => '退款时间', |
| 31 | 'Reservation_time' => '预约时间', | 34 | 'Reservation_time' => '预约时间', |
| 32 | 'Create_time' => '创建时间', | 35 | 'Create_time' => '创建时间', |
| 36 | + 'IDcard' => '身份证', | ||
| 33 | 'Driver.name' => '司机名称', | 37 | 'Driver.name' => '司机名称', |
| 34 | 'Car.license_plate' => '车牌号', | 38 | 'Car.license_plate' => '车牌号', |
| 39 | + 'Starting_point' => '出发位置', | ||
| 40 | + 'end_point' => '结束位置', | ||
| 35 | 'User.username' => '用户名' | 41 | 'User.username' => '用户名' |
| 36 | ]; | 42 | ]; |
| @@ -38,6 +38,11 @@ class Order extends Model | @@ -38,6 +38,11 @@ class Order extends Model | ||
| 38 | return ['1' => __('Is_pay 1'), '2' => __('Is_pay 2'), '3' => __('Is_pay 3')]; | 38 | return ['1' => __('Is_pay 1'), '2' => __('Is_pay 2'), '3' => __('Is_pay 3')]; |
| 39 | } | 39 | } |
| 40 | 40 | ||
| 41 | + public function gettypeList() | ||
| 42 | + { | ||
| 43 | + return ['1' => __('Type 1'), '2' => __('Type 2'), '3' => __('Type 3')]; | ||
| 44 | + } | ||
| 45 | + | ||
| 41 | 46 | ||
| 42 | public function getIsPayTextAttr($value, $data) | 47 | public function getIsPayTextAttr($value, $data) |
| 43 | { | 48 | { |
| @@ -266,6 +266,19 @@ | @@ -266,6 +266,19 @@ | ||
| 266 | }// 使用ajax交互,那么后端返回的数据会被data接收,不在直接影响整个浏览器页面 | 266 | }// 使用ajax交互,那么后端返回的数据会被data接收,不在直接影响整个浏览器页面 |
| 267 | 267 | ||
| 268 | }) | 268 | }) |
| 269 | + $.ajax({ // 定义ajax发送请求 | ||
| 270 | + url: 'order/chackordershow', // 请求发送的地址 有三种填写方式,与form标签的action一致 | ||
| 271 | + method: 'post', // 请求发送的方式 | ||
| 272 | + success: function (data) { // 异步等待,当后端响应成功会回调执行匿名函数,并将数据传递给data参数 | ||
| 273 | + console.log("chackordershowchackordershowchackordershowchackordershow") | ||
| 274 | + console.log(data) | ||
| 275 | + if(data>0){ | ||
| 276 | + var audio = new Audio('/ttsmaker-file-2024-6-11-12-0-51.mp3'); | ||
| 277 | + audio.play(); | ||
| 278 | + } | ||
| 279 | + }// 使用ajax交互,那么后端返回的数据会被data接收,不在直接影响整个浏览器页面 | ||
| 280 | + | ||
| 281 | + }) | ||
| 269 | 282 | ||
| 270 | $.ajax({ // 定义ajax发送请求 | 283 | $.ajax({ // 定义ajax发送请求 |
| 271 | url: 'order/notselectedorder', // 请求发送的地址 有三种填写方式,与form标签的action一致 | 284 | url: 'order/notselectedorder', // 请求发送的地址 有三种填写方式,与form标签的action一致 |
| 1 | <form id="add-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action=""> | 1 | <form id="add-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action=""> |
| 2 | 2 | ||
| 3 | <div class="form-group"> | 3 | <div class="form-group"> |
| 4 | - <label class="control-label col-xs-12 col-sm-2">{:__('Order_no')}:</label> | ||
| 5 | - <div class="col-xs-12 col-sm-8"> | ||
| 6 | - <input id="c-order_no" class="form-control" name="row[order_no]" type="text"> | ||
| 7 | - </div> | ||
| 8 | - </div> | ||
| 9 | - <div class="form-group"> | ||
| 10 | <label class="control-label col-xs-12 col-sm-2">{:__('Price')}:</label> | 4 | <label class="control-label col-xs-12 col-sm-2">{:__('Price')}:</label> |
| 11 | <div class="col-xs-12 col-sm-8"> | 5 | <div class="col-xs-12 col-sm-8"> |
| 12 | <input id="c-price" class="form-control" step="0.01" name="row[price]" type="number"> | 6 | <input id="c-price" class="form-control" step="0.01" name="row[price]" type="number"> |
| 13 | </div> | 7 | </div> |
| 14 | </div> | 8 | </div> |
| 15 | - <div class="form-group"> | ||
| 16 | - <label class="control-label col-xs-12 col-sm-2">{:__('Is_pay')}:</label> | ||
| 17 | - <div class="col-xs-12 col-sm-8"> | ||
| 18 | - | ||
| 19 | - <select id="c-is_pay" class="form-control selectpicker" name="row[is_pay]"> | ||
| 20 | - {foreach name="isPayList" item="vo"} | ||
| 21 | - <option value="{$key}" {in name="key" value=""}selected{/in}>{$vo}</option> | ||
| 22 | - {/foreach} | ||
| 23 | - </select> | ||
| 24 | 9 | ||
| 25 | - </div> | ||
| 26 | - </div> | ||
| 27 | <div class="form-group"> | 10 | <div class="form-group"> |
| 28 | <label class="control-label col-xs-12 col-sm-2">{:__('Car_id')}:</label> | 11 | <label class="control-label col-xs-12 col-sm-2">{:__('Car_id')}:</label> |
| 29 | <div class="col-xs-12 col-sm-8"> | 12 | <div class="col-xs-12 col-sm-8"> |
| 30 | - <input id="c-car_id" data-rule="required" data-source="car/index" class="form-control selectpage" name="row[car_id]" type="text" value=""> | 13 | + <input id="c-car_id" data-rule="required" data-source="car/index" class="form-control selectpage" data-field="license_plate" name="row[car_id]" type="text" value=""> |
| 31 | </div> | 14 | </div> |
| 32 | </div> | 15 | </div> |
| 33 | <div class="form-group"> | 16 | <div class="form-group"> |
| @@ -43,15 +26,51 @@ | @@ -43,15 +26,51 @@ | ||
| 43 | </div> | 26 | </div> |
| 44 | </div> | 27 | </div> |
| 45 | <div class="form-group"> | 28 | <div class="form-group"> |
| 46 | - <label class="control-label col-xs-12 col-sm-2">{:__('Driver_id')}:</label> | 29 | + <label class="control-label col-xs-12 col-sm-2">{:__('Phone')}:</label> |
| 30 | + <div class="col-xs-12 col-sm-8"> | ||
| 31 | + <input id="c-phone" class="form-control" name="row[phone]" type="text"> | ||
| 32 | + </div> | ||
| 33 | + </div> | ||
| 34 | + <div class="form-group"> | ||
| 35 | + <label class="control-label col-xs-12 col-sm-2">{:__('IDcard')}:</label> | ||
| 36 | + <div class="col-xs-12 col-sm-8"> | ||
| 37 | + <input id="c-IDcard" class="form-control" name="row[IDcard]" type="text"> | ||
| 38 | + </div> | ||
| 39 | + </div> | ||
| 40 | + <div class="form-group"> | ||
| 41 | + <label class="control-label col-xs-12 col-sm-2">{:__('Driver_id')}:</label> | ||
| 47 | <div class="col-xs-12 col-sm-8"> | 42 | <div class="col-xs-12 col-sm-8"> |
| 48 | <input id="c-driver_id" data-rule="required" data-source="driver/index" class="form-control selectpage" name="row[driver_id]" type="text" value=""> | 43 | <input id="c-driver_id" data-rule="required" data-source="driver/index" class="form-control selectpage" name="row[driver_id]" type="text" value=""> |
| 49 | </div> | 44 | </div> |
| 50 | </div> | 45 | </div> |
| 51 | <div class="form-group"> | 46 | <div class="form-group"> |
| 52 | - <label class="control-label col-xs-12 col-sm-2">{:__('Driver_name')}:</label> | 47 | + <label class="control-label col-xs-12 col-sm-2">{:__('Route_id')}:</label> |
| 48 | + <div class="col-xs-12 col-sm-8"> | ||
| 49 | + <input id="c-route_id" data-rule="required" data-source="route/index" class="form-control selectpage" name="row[route_id]" type="text" value=""> | ||
| 50 | + </div> | ||
| 51 | + </div> | ||
| 52 | + <div class="form-group"> | ||
| 53 | + <label class="control-label col-xs-12 col-sm-2">{:__('Type')}:</label> | ||
| 53 | <div class="col-xs-12 col-sm-8"> | 54 | <div class="col-xs-12 col-sm-8"> |
| 54 | - <input id="c-driver_name" class="form-control" name="row[driver_name]" type="text"> | 55 | + |
| 56 | + <select id="c-type" class="form-control selectpicker" name="row[type]"> | ||
| 57 | + {foreach name="typeList" item="vo"} | ||
| 58 | + <option value="{$key}" {in name="key" value=""}selected{/in}>{$vo}</option> | ||
| 59 | + {/foreach} | ||
| 60 | + </select> | ||
| 61 | + | ||
| 62 | + </div> | ||
| 63 | + </div> | ||
| 64 | + <div class="form-group"> | ||
| 65 | + <label class="control-label col-xs-12 col-sm-2">{:__('Starting_point')}:</label> | ||
| 66 | + <div class="col-xs-12 col-sm-8"> | ||
| 67 | + <input id="c-starting_point" class="form-control" name="row[starting_point]" type="text"> | ||
| 68 | + </div> | ||
| 69 | + </div> | ||
| 70 | + <div class="form-group"> | ||
| 71 | + <label class="control-label col-xs-12 col-sm-2">{:__('End_point')}:</label> | ||
| 72 | + <div class="col-xs-12 col-sm-8"> | ||
| 73 | + <input id="c-end_point" class="form-control" name="row[end_point]" type="text"> | ||
| 55 | </div> | 74 | </div> |
| 56 | </div> | 75 | </div> |
| 57 | <div class="form-group"> | 76 | <div class="form-group"> |
| @@ -72,6 +91,12 @@ | @@ -72,6 +91,12 @@ | ||
| 72 | <input id="c-create_time" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[create_time]" type="text" value="{:date('Y-m-d H:i:s')}"> | 91 | <input id="c-create_time" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[create_time]" type="text" value="{:date('Y-m-d H:i:s')}"> |
| 73 | </div> | 92 | </div> |
| 74 | </div> | 93 | </div> |
| 94 | + <div class="form-group"> | ||
| 95 | + <label class="control-label col-xs-12 col-sm-2">{:__('Reservation_time')}:</label> | ||
| 96 | + <div class="col-xs-12 col-sm-8"> | ||
| 97 | + <input id="c-reservation_time" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[reservation_time]" type="text" value="{:date('Y-m-d H:i:s')}"> | ||
| 98 | + </div> | ||
| 99 | + </div> | ||
| 75 | <div class="form-group layer-footer"> | 100 | <div class="form-group layer-footer"> |
| 76 | <label class="control-label col-xs-12 col-sm-2"></label> | 101 | <label class="control-label col-xs-12 col-sm-2"></label> |
| 77 | <div class="col-xs-12 col-sm-8"> | 102 | <div class="col-xs-12 col-sm-8"> |
| @@ -199,7 +199,6 @@ if (!function_exists('getOrderSn')) { | @@ -199,7 +199,6 @@ if (!function_exists('getOrderSn')) { | ||
| 199 | * @throws \think\exception\DbException | 199 | * @throws \think\exception\DbException |
| 200 | */ | 200 | */ |
| 201 | function refundSendMessage($order_id){ | 201 | function refundSendMessage($order_id){ |
| 202 | - print_r($$order_id);return; | ||
| 203 | $order=\think\Db::name("order")->find($order_id); | 202 | $order=\think\Db::name("order")->find($order_id); |
| 204 | $wxxcxpush=new WxxcxPush(); | 203 | $wxxcxpush=new WxxcxPush(); |
| 205 | $user=new User(); | 204 | $user=new User(); |
| @@ -1646,11 +1646,58 @@ class Car extends Base | @@ -1646,11 +1646,58 @@ class Car extends Base | ||
| 1646 | 1646 | ||
| 1647 | 1647 | ||
| 1648 | /** | 1648 | /** |
| 1649 | - * | 1649 | + *司机退款 |
| 1650 | * @return void | 1650 | * @return void |
| 1651 | */ | 1651 | */ |
| 1652 | public function drivercancelorder(){ | 1652 | public function drivercancelorder(){ |
| 1653 | - $order_id = $this->request->param("order_id"); | ||
| 1654 | - $this->success("取消成功"); | 1653 | + $id = $this->request->param("order_id"); |
| 1654 | + //查询订单 | ||
| 1655 | + $order = Db::name("order")->where("id", $id)->find(); | ||
| 1656 | + if ($order['is_pay'] == 1) { | ||
| 1657 | + if ($order['order_status'] != 1) { | ||
| 1658 | + $this->error("该订单无法退款"); | ||
| 1659 | + } | ||
| 1660 | + if ($order['pay_type'] == "offlinepay") { | ||
| 1661 | + $relogs['update_time'] = time(); | ||
| 1662 | + $relogs['is_pay'] = 4; | ||
| 1663 | + $relogs['refund_time'] = time(); | ||
| 1664 | + $rs2 = Db::name('order') | ||
| 1665 | + ->where(['id' => $order['id']]) | ||
| 1666 | + ->update($relogs); | ||
| 1667 | + } | ||
| 1668 | + //$this->error("该订单无法退款"); | ||
| 1669 | + //拼接退款参数 | ||
| 1670 | + $pay_fee = $order['price']; | ||
| 1671 | + $refund_fee = $pay_fee; | ||
| 1672 | + $order_sn = $order['order_no']; | ||
| 1673 | + $pay_type = 'wechat'; | ||
| 1674 | + $reason = '订单退款'; | ||
| 1675 | + $notifyurl = 'https://wyc.tenyes.cn/api/index/refundNotifyx';//退款回调地址 | ||
| 1676 | + //直接调用退款方法传参即可 | ||
| 1677 | + $response = \addons\epay\library\Service::submitRefund($pay_fee, $refund_fee, $order_sn, getRefundSn($order['user_id']), $pay_type, $reason, $notifyurl, '', 'miniapp'); | ||
| 1678 | + $response = json_encode($response); | ||
| 1679 | + $response = json_decode($response, true); | ||
| 1680 | + file_put_contents("pcl_repay_v2.log", date("Y-m-d H:i:s") . "::" . json_encode($response, JSON_UNESCAPED_UNICODE) . PHP_EOL, FILE_APPEND); | ||
| 1681 | + if (!empty($response['return_code'] == 'SUCCESS')) { | ||
| 1682 | + refundSendMessage($id);//发送订阅消息 | ||
| 1683 | + //退款成功,更新退款记录 | ||
| 1684 | + $relogs['update_time'] = time(); | ||
| 1685 | + $relogs['is_pay'] = 3; | ||
| 1686 | + $relogs['out_refund_no'] = $response['out_refund_no']; | ||
| 1687 | + $relogs['refund_time'] = time(); | ||
| 1688 | + $rs2 = Db::name('order') | ||
| 1689 | + ->where(['id' => $order['id']]) | ||
| 1690 | + ->update($relogs); | ||
| 1691 | + } else { | ||
| 1692 | + $this->error('退款失败'); | ||
| 1693 | + } | ||
| 1694 | + $this->success("退款成功"); | ||
| 1695 | + } else { | ||
| 1696 | + $relogs['is_pay'] = 4; | ||
| 1697 | + $rs2 = Db::name('order') | ||
| 1698 | + ->where(['id' => $order['id']]) | ||
| 1699 | + ->update($relogs); | ||
| 1700 | + $this->success("取消成功"); | ||
| 1701 | + } | ||
| 1655 | } | 1702 | } |
| 1656 | } | 1703 | } |
| @@ -57,7 +57,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'template'], function | @@ -57,7 +57,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'template'], function | ||
| 57 | { | 57 | { |
| 58 | field: 'pay_type', | 58 | field: 'pay_type', |
| 59 | title: __('Pay_type'), | 59 | title: __('Pay_type'), |
| 60 | - searchList: {"wxpay": __('Pay_type wxpay'), "offlinepay": __('Pay_type offlinepay')}, | 60 | + searchList: {"wxpay": __('Pay_type wxpay'), "offlinepay": __('Pay_type offlinepay'), "background": __('Pay_type background')}, |
| 61 | formatter: Table.api.formatter.normal | 61 | formatter: Table.api.formatter.normal |
| 62 | }, | 62 | }, |
| 63 | { | 63 | { |
| @@ -119,7 +119,14 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'template'], function | @@ -119,7 +119,14 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'template'], function | ||
| 119 | classname: 'btn btn-xs btn-warning btn-magic btn-ajax', | 119 | classname: 'btn btn-xs btn-warning btn-magic btn-ajax', |
| 120 | icon: 'fa fa-paper-plane', | 120 | icon: 'fa fa-paper-plane', |
| 121 | confirm: function (row) { | 121 | confirm: function (row) { |
| 122 | - return "确认退款" | 122 | + return "确认退款" |
| 123 | + }, | ||
| 124 | + visible: function (row) { | ||
| 125 | + //未生成过计划的数据就显示按钮 | ||
| 126 | + if (row.is_pay == 1 ) { | ||
| 127 | + return true; | ||
| 128 | + } | ||
| 129 | + return false; | ||
| 123 | }, | 130 | }, |
| 124 | url: 'order/refund?id={id}', | 131 | url: 'order/refund?id={id}', |
| 125 | 132 |
public/ttsmaker-file-2024-6-11-12-0-51.mp3
0 → 100644
不能预览此文件类型
-
请 注册 或 登录 后发表评论