This commit is contained in:
jianghanbo 2024-10-22 15:00:11 +08:00
parent 4ac35f9b6e
commit 357063025e
9 changed files with 35 additions and 27 deletions

View File

@ -182,6 +182,7 @@
handleSuccess(response, file, fileList, 1)" handleSuccess(response, file, fileList, 1)"
> >
<img v-if="item.wechat_pic" :src="item.wechat_pic" style="width: 120px; height: 120px;margin-top: 14px;"/> <img v-if="item.wechat_pic" :src="item.wechat_pic" style="width: 120px; height: 120px;margin-top: 14px;"/>
<img v-if="!item.wechat_pic" src="~@/assets/home/wechat.png" style="width: 120px; height: 120px;margin-top: 14px;"/>
<i slot="default" class="el-icon-plus"></i> <i slot="default" class="el-icon-plus"></i>
</el-upload> </el-upload>
</el-form-item> </el-form-item>
@ -246,7 +247,7 @@
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<div class="addRoutes"> <!-- <div class="addRoutes">
<el-button <el-button
class="filter-item" class="filter-item"
style="margin-left: 10px" style="margin-left: 10px"
@ -255,7 +256,7 @@
@click="handleAddRoutes" @click="handleAddRoutes"
>添加线路</el-button >添加线路</el-button
> >
</div> </div> -->
<!-- <el-form-item label="路线"> <!-- <el-form-item label="路线">
<el-select multiple v-model="item.routes" filterable placeholder="请选择"> <el-select multiple v-model="item.routes" filterable placeholder="请选择">
<el-option <el-option

View File

@ -19,10 +19,10 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column align="center" label="订单号" width="80" prop="orderInfo.sn" /> <el-table-column align="center" label="订单号" prop="orderInfo.sn" />
<el-table-column align="center" label="出游日期" width="80" prop="travel_date" /> <el-table-column align="center" label="出游日期" prop="travel_date" />
<el-table-column align="center" label="出游人数" width="80" prop="num" /> <el-table-column align="center" label="出游人数" prop="num" />
<el-table-column align="center" label="出行人名称" width="220" prop="name" /> <el-table-column align="center" label="出行人名称" width="100" prop="name" />
<el-table-column align="center" label="联系电话" prop="mobile" /> <el-table-column align="center" label="联系电话" prop="mobile" />
<el-table-column align="center" label="状态"> <el-table-column align="center" label="状态">
<template slot-scope="scope"> <template slot-scope="scope">

View File

@ -74,7 +74,7 @@
align="center" align="center"
label="所属平台" label="所属平台"
width="160" width="160"
prop="os" prop="os_name"
></el-table-column> ></el-table-column>
<el-table-column align="type" label="境内/境外" width="100" prop="type"> <el-table-column align="type" label="境内/境外" width="100" prop="type">
@ -85,15 +85,13 @@
<el-table-column <el-table-column
align="type" align="type"
label="天数" label="天数"
width="60" width="120"
prop="day" prop="day"
></el-table-column> >
<el-table-column <template slot-scope="scope">
align="type" <span>{{ scope.row.day }}{{ scope.row.night }}</span>
label="天数" </template>
width="60" </el-table-column>
prop="night"
></el-table-column>
<!-- <el-table-column <!-- <el-table-column
align="type" align="type"
label="详细行程" label="详细行程"
@ -188,7 +186,7 @@
> >
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
<el-form-item label="上传" prop="trip_info" required> <el-form-item label="详细行程" prop="trip_info" required>
<el-upload <el-upload
ref="field105" ref="field105"
action="" action=""

View File

@ -21,7 +21,7 @@ class OrderBooksController extends base {
if($status = $request->get('status')) { if($status = $request->get('status')) {
$query->where('status', $status); $query->where('status', $status);
} }
if($is_order = $request->get('is_order')) { if($is_order = $request->get('sn')) {
$query->where('is_order', $is_order); $query->where('is_order', $is_order);
} }

View File

@ -31,7 +31,7 @@ class ProductsController extends base {
$query->where('is_order', $is_order); $query->where('is_order', $is_order);
} }
$list = $query->paginate($request->get('limit',1000)); $list = $query->append(['os_name'])->paginate($request->get('limit',1000));
return $this->success($list,null,['oss' => array_values(array_map(function ($os, $k) { return $this->success($list,null,['oss' => array_values(array_map(function ($os, $k) {
return ['id' => $k, 'os' => $os]; return ['id' => $k, 'os' => $os];
}, Orders::OSS, array_keys(Orders::OSS)))]); }, Orders::OSS, array_keys(Orders::OSS)))]);
@ -83,15 +83,11 @@ class ProductsController extends base {
return $this->error(2001, '请选择商品'); return $this->error(2001, '请选择商品');
} }
$date = $request->get('date', date('Y-m')); $date = $request->get('date', date('Y-m'));
$firstDay = strtotime(date('Y-m-01'), strtotime($date)); $firstDay = date('Y-m-01', strtotime($date));
$lastDay = strtotime(date('Y-m-t'), strtotime($date)); $lastDay = date('Y-m-t', strtotime($date));
// 用来存储日期的数组
$dates = [];
// 排期列表 // 排期列表
$productSchedules = ProductSchedules::where('product_id', $request->get('id')) $productSchedules = ProductSchedules::where('product_id', $request->get('id'))
->whereBetweenTime('date', $firstDay, $lastDay) ->whereBetween('date', [$firstDay, $lastDay])
->select() ->select()
->toArray(); ->toArray();
$productSchedules = array_column($productSchedules, null, 'date'); $productSchedules = array_column($productSchedules, null, 'date');
@ -107,6 +103,8 @@ class ProductsController extends base {
// 遍历日期范围 // 遍历日期范围
$dates = []; $dates = [];
$firstDay = strtotime($firstDay);
$lastDay = strtotime($lastDay);
for ($currentDay = $firstDay; $currentDay <= $lastDay; $currentDay = strtotime('+1 day', $currentDay)) { for ($currentDay = $firstDay; $currentDay <= $lastDay; $currentDay = strtotime('+1 day', $currentDay)) {
$date = date('Y-m-d', $currentDay); $date = date('Y-m-d', $currentDay);
$current = [ $current = [

View File

@ -7,7 +7,9 @@ use support\Redis;
use support\Request; use support\Request;
class SettingController extends base { class SettingController extends base {
// 境内
const SETTING_DOMESTIC = 'setting:domestic'; const SETTING_DOMESTIC = 'setting:domestic';
// 境外
const SETTING_ABROAD = 'setting:abroad'; const SETTING_ABROAD = 'setting:abroad';
/** /**
* 配置合同获取 * 配置合同获取

View File

@ -1,10 +1,12 @@
<?php <?php
namespace app\api\controller; namespace app\api\controller;
use app\admin\controller\SettingController;
use app\model\OrderBooks; use app\model\OrderBooks;
use app\model\Orders; use app\model\Orders;
use app\model\ProductSchedules; use app\model\ProductSchedules;
use Respect\Validation\Validator; use Respect\Validation\Validator;
use support\Redis;
use support\Request; use support\Request;
/** /**
@ -27,6 +29,7 @@ class OrderController extends base
$os = [1, 7]; $os = [1, 7];
$query = Orders::where($where) $query = Orders::where($where)
->whereLike('mobile', $mobile) ->whereLike('mobile', $mobile)
->fieldRaw('*, (select 1 from order_books where order_id = orders.id limit 1) as is_book')
->whereIn('os', $os) ->whereIn('os', $os)
->order('create_at','desc') ->order('create_at','desc')
->order('id','desc'); ->order('id','desc');
@ -58,7 +61,10 @@ class OrderController extends base
$orderDetail->admin->job = '金牌旅行管家'; $orderDetail->admin->job = '金牌旅行管家';
$orderDetail->admin->service_promise = '我以真诚、热情、专业的态度服务好每一位顾客,全力确保您的旅行体验美好、愉快、安全。'; $orderDetail->admin->service_promise = '我以真诚、热情、专业的态度服务好每一位顾客,全力确保您的旅行体验美好、愉快、安全。';
// 旅游合同 // 旅游合同
$orderDetail->travel_contract = 'http://192.168.0.100:8787/%E6%8A%96%E9%9F%B3%E6%96%B0%E5%9B%BD%E6%97%85%E6%B7%BB%E5%8A%A0%E5%88%86%E5%8D%95%E7%B3%BB%E7%BB%9F%E7%9A%84%E5%95%86%E5%93%81.xlsx'; $orderDetail->travel_contract = Redis::get(SettingController::SETTING_DOMESTIC) ?? '';
if ($orderDetail->product->type == 2) {
$orderDetail->travel_contract = Redis::get(SettingController::SETTING_DOMESTIC) ?? '';
}
return $this->success($orderDetail); return $this->success($orderDetail);
} }

View File

@ -84,7 +84,7 @@ class Orders extends base
public function getCanBookAttr($val) public function getCanBookAttr($val)
{ {
$canBook = false; $canBook = false;
if (in_array($this->os, [1, 7]) && $this->order_status == 3) { if (in_array($this->os, [1, 7]) && $this->order_status == 3 && !$this->is_book) {
$canBook = true; $canBook = true;
} }
return $canBook; return $canBook;

View File

@ -2,4 +2,7 @@
namespace app\model; namespace app\model;
class Products extends base { class Products extends base {
public function getOsNameAttr() {
return Orders::OSS[$this->os];
}
} }