Order.php 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589
  1. <?php
  2. /**
  3. * Author: luzheng.liu
  4. * Time: 2020/12/16 23:06
  5. */
  6. namespace app\api\controller;
  7. use app\api\BaseController;
  8. use app\api\exception\ApiException;
  9. use app\api\model\BrandModel;
  10. use app\api\model\CartProductModel;
  11. use app\api\model\CartModel;
  12. use app\api\model\GroupModel;
  13. use app\api\model\OrderModel;
  14. use app\api\model\ProductModel;
  15. use app\api\model\UserModel;
  16. use app\api\model\WriteOffModel;
  17. use app\common\service\OrderService;
  18. use app\common\until\Until;
  19. use think\App;
  20. use think\Db;
  21. class Order extends BaseController {
  22. public function __construct(App $app) {
  23. parent::__construct($app);
  24. if ($this->userId == '123456789') {
  25. throw new ApiException(
  26. '网络繁忙'
  27. );
  28. }
  29. }
  30. /**
  31. * @OA\Get(path="/api/Order/index",
  32. * tags={"订单管理"},
  33. * summary="订单列表",
  34. * @OA\Parameter(name="token", in="header", description="token", @OA\Schema(type="string")),
  35. * @OA\Parameter(name="page", in="query", description="页码", @OA\Schema(type="ineger",default="1")),
  36. * @OA\Parameter(name="pageSize", in="query", description="页尺寸", @OA\Schema(type="integer",default="10")),
  37. * @OA\Parameter(name="orderStatus", in="query", description="订单状态 1未支付 2已支付 ", @OA\Schema(type="integer")),
  38. * @OA\Parameter(name="writeOffStatus", in="query", description="核销状态 1未核销 2已核销 ", @OA\Schema(type="integer")),
  39. * @OA\Parameter(name="discussStatus", in="query", description="评价状态 1未评价 2已评价 ", @OA\Schema(type="integer")),
  40. * @OA\Parameter(name="orderSn", in="query", description="订单号", @OA\Schema(type="string")),
  41. * @OA\Parameter(name="mobile", in="query", description="手机号", @OA\Schema(type="string")),
  42. * @OA\Parameter(name="storeId", in="query", description="门店id", @OA\Schema(type="integer")),
  43. * @OA\Parameter(name="appointmentTime", in="query", description="预约时间", @OA\Schema(type="2020-01-02,2021-12-30")),
  44. * @OA\Parameter(name="createTime", in="query", description="订单时间", @OA\Schema(type="2020-01-02,2021-12-30")),
  45. * @OA\Parameter(name="orderType", in="query", description="订单类型 1小程序下单 2后台增加", @OA\Schema(type="string")),
  46. * @OA\RequestBody(
  47. * ),
  48. * @OA\Response(response="200", description="请求成功")
  49. * )
  50. */
  51. public function index() {
  52. $input = request()->get();
  53. $model = new OrderModel();
  54. $model->setPage($input['page'] ?? 1);
  55. $model->setPageSize($input['pageSize'] ?? 10);
  56. $where = [];
  57. $model::where([['status', '=', 1], ['create_time', '<',
  58. date('Y-m-d H:i:s', strtotime('-15minutes'))]])
  59. ->update(['status' => OrderModel::IS_CLOSE]);
  60. if (!empty($input['orderSn'])) {
  61. $where[] = ['o.order_sn', 'like', "%{$input['orderSn']}%"];
  62. }
  63. if (!empty($input['mobile'])) {
  64. $where[] = ['o.mobile', 'like', "%{$input['mobile']}%"];
  65. }
  66. if (!empty($input['writeOffStatus'])) {
  67. $where[] = ['wo.write_off_status', '=', (int)$input['writeOffStatus']];
  68. }
  69. if (!empty($input['orderStatus'])) {
  70. $where[] = ['o.status', '=', (int)$input['orderStatus']];
  71. }
  72. if (!empty($input['discussStatus'])) {
  73. $where[] = ['discussOrder.id', '=', null];
  74. }
  75. if (!empty($input['storeId'])) {
  76. $where[] = ['store.id', '=', $input['storeId']];
  77. }
  78. if (!empty($input['appointmentTime'])) {
  79. $data = explode(',', $input['appointmentTime']);
  80. $where[] = ['o.appointment_time', 'between', [$data[0], $data[1] . ' 23:59:59']];
  81. }
  82. if (!empty($input['createTime'])) {
  83. $data = explode(',', $input['createTime']);
  84. $where[] = ['o.create_time', 'between', [$data[0], $data[1] . ' 23:59:59']];
  85. }
  86. if (!empty($input['orderType'])) {
  87. $where[] = ['store.order_type', '=', $input['orderType']];
  88. }
  89. if (!$this->isAdmin()) {
  90. $where[] = ['o.user_id', '=', $this->userId];
  91. if (empty($input['orderStatus'])) {
  92. $where[] = ['o.status', '<>', OrderModel::IS_DELETE];
  93. }
  94. }
  95. $model->setWhere($where);
  96. $data = $model->getOrderList();
  97. $statusFilter = [1 => '未支付', 2 => '已支付', 3 => '已关闭'];
  98. foreach ($data['list'] as &$one) {
  99. $one['statusText'] = $statusFilter[$one['status']];
  100. if ($one['status'] === OrderModel::IS_PAY) {
  101. if ($one['write_off_status'] == 1) {
  102. $one['statusText'] = '待消费';
  103. } else if ($one['write_off_status'] == 2) {
  104. if (empty($one['discuss_id']) && !empty($input['discussStatus'])) {
  105. $one['statusText'] = '未评价';
  106. }
  107. $one['statusText'] = '已消费';
  108. }
  109. }
  110. }
  111. Until::output($data);
  112. }
  113. public function save() {
  114. $input = Until::getInput();
  115. $rule = [
  116. 'name|品牌名称' => 'require',
  117. 'groupId|集团id' => 'require',
  118. ];
  119. Until::check($rule, $input);
  120. $model = new BrandModel();
  121. if (!empty($input['id'])) {
  122. $id = (int)$input['id'];
  123. $model::where(['id' => $id])->update([
  124. 'brand_name' => $input['name'],
  125. 'group_id' => $input['groupId']
  126. ]);
  127. } else {
  128. $id = $model->insertGetId([
  129. 'brand_name' => $input['name'],
  130. 'group_id' => $input['groupId']
  131. ]);
  132. }
  133. $info = $model::get($id);
  134. Until::output(['info' => Until::modelToArray($info)]);
  135. }
  136. /**
  137. * @OA\GET(path="/api/Order/read",
  138. * tags={"订单管理"},
  139. * summary="查看订单信息",
  140. * @OA\Parameter(name="token", in="header", description="token", @OA\Schema(type="string")),
  141. * @OA\Parameter(name="id", in="query", description="订单id", @OA\Schema(type="ineger",default="1")),
  142. * @OA\RequestBody(
  143. * ),
  144. * @OA\Response(response="200", description="请求成功")
  145. * )
  146. */
  147. public function read($id) {
  148. $model = new OrderModel();
  149. $where[] = ['o.id', '=', (int)$id];
  150. $model->setWhere($where);
  151. $info = $model->getOrderInfo();
  152. Until::output(['info' => $info]);
  153. }
  154. /**
  155. * @OA\GET(path="/api/Order/delete",
  156. * tags={"订单管理"},
  157. * summary="删除品牌信息",
  158. * @OA\Parameter(name="token", in="header", description="token", @OA\Schema(type="string")),
  159. * @OA\Parameter(name="id", in="query", description="品牌id", @OA\Schema(type="ineger",default="1")),
  160. * @OA\Parameter(name="status", in="query", description="1正常 2删除", @OA\Schema(type="ineger",default="1")),
  161. * @OA\RequestBody(
  162. * ),
  163. * @OA\Response(response="200", description="请求成功")
  164. * )
  165. */
  166. public function delete($id, $status) {
  167. $model = new BrandModel();
  168. $where[] = ['id', '=', (int)$id];
  169. $data = ['status' => (int)$status];
  170. $isSuccess = $model::where($where)->update($data);
  171. Until::output(['isSuccess' => $isSuccess]);
  172. }
  173. /**
  174. * @OA\Post(path="/api/Order/createOrder",
  175. * tags={"订单管理"},
  176. * summary="创建订单信息",
  177. * @OA\Parameter(name="token", in="header", description="token", @OA\Schema(type="string")),
  178. * @OA\RequestBody(
  179. * @OA\MediaType(
  180. * mediaType="multipart/form-data",
  181. * @OA\Schema(
  182. * @OA\Property(description="商品id", property="productId", type="integer", default="1"),
  183. * @OA\Property(description="门店id", property="storeId", type="integer", default="1"),
  184. * @OA\Property(description="预约时间", property="appointmentTime", type="string", default="2020-12-12 16:30"),
  185. * @OA\Property(description="预约结束时间", property="endTime", type="string", default="2020-12-12 16:30"),
  186. * @OA\Property(description="商品数量", property="num", type="integer", default="1"),
  187. * @OA\Property(description="手机号", property="mobile", type="string", default="15623655623"),
  188. * required={"productId","storeId","appointmentTime","num","mobile"})
  189. * )
  190. * ),
  191. * @OA\Response(response="200", description="请求成功")
  192. * )
  193. */
  194. public function createOrder() {
  195. $input = Until::getInput();
  196. $rule = [
  197. 'productId|商品id' => 'require',
  198. 'storeId|门店id' => 'require',
  199. 'appointmentTime|预约时间' => 'require',
  200. 'num|数量' => 'require',
  201. 'mobile|手机号' => 'require'
  202. ];
  203. Until::check($rule, $input);
  204. if (empty($input['endTime'])) {
  205. $input['endTime'] = date('Y-m-d H:i', strtotime($input['appointmentTime']) + 1800);
  206. }
  207. if (strtotime($input['appointmentTime']) >= strtotime($input['endTime'])) {
  208. throw new ApiException('结束时间必须大于开始时间');
  209. }
  210. $input['productId'] = (int)$input['productId'];
  211. if ($input['num'] < 1) {
  212. throw new ApiException('数量必须大于1');
  213. }
  214. $data = (new OrderService())->payOrder($input);
  215. Until::output($data);
  216. }
  217. /**
  218. * @OA\Post(path="/api/Order/createFoodOrder",
  219. * tags={"订单管理"},
  220. * summary="创建订单信息",
  221. * @OA\Parameter(name="token", in="header", description="token", @OA\Schema(type="string")),
  222. * @OA\RequestBody(
  223. * @OA\MediaType(
  224. * mediaType="multipart/form-data",
  225. * @OA\Schema(
  226. * @OA\Property(description="商品id和数量['productId' => 1,'num' => 1]", property="productIdAndNum", type="integer", default="1"),
  227. * @OA\Property(description="门店id", property="storeId", type="integer", default="1"),
  228. * @OA\Property(description="手机号", property="mobile", type="string", default="15623655623"),
  229. * required={"productIdAndNum","storeId","mobile"})
  230. * )
  231. * ),
  232. * @OA\Response(response="200", description="请求成功")
  233. * )
  234. */
  235. public function createFoodOrder() {
  236. $input = Until::getInput();
  237. $rule = [
  238. 'productIdAndNum|商品id和数量' => 'require',
  239. 'storeId|门店id' => 'require',
  240. 'mobile|手机号' => 'require'
  241. ];
  242. Until::check($rule, $input);
  243. $data = (new OrderService())->payOrder($input);
  244. Until::output($data);
  245. }
  246. /**
  247. * @OA\Post(path="/api/Order/assignStaff",
  248. * tags={"订单管理"},
  249. * summary="分配职员",
  250. * @OA\Parameter(name="token", in="header", description="token", @OA\Schema(type="string")),
  251. * @OA\RequestBody(
  252. * @OA\MediaType(
  253. * mediaType="multipart/form-data",
  254. * @OA\Schema(
  255. * @OA\Property(description="订单id", property="orderId", type="integer", default="1"),
  256. * @OA\Property(description="职员id", property="staffId", type="integer", default="1"),
  257. * required={"orderId","staffId"})
  258. * )
  259. * ),
  260. * @OA\Response(response="200", description="请求成功")
  261. * )
  262. */
  263. public function assignStaff() {
  264. $input = Until::getInput();
  265. $rule = [
  266. 'orderId|订单id' => 'require',
  267. 'staffId|职员id' => 'require',
  268. ];
  269. Until::check($rule, $input);
  270. $model = new OrderModel();
  271. $model::where(['id' => (int)$input['orderId']])->update(['staff_id' => (int)$input['staffId']]);
  272. Until::output([]);
  273. }
  274. /**
  275. * @OA\Post(path="/api/Order/payOrder",
  276. * tags={"订单管理"},
  277. * summary="手动支付",
  278. * @OA\Parameter(name="token", in="header", description="token", @OA\Schema(type="string")),
  279. * @OA\RequestBody(
  280. * @OA\MediaType(
  281. * mediaType="multipart/form-data",
  282. * @OA\Schema(
  283. * @OA\Property(description="订单id", property="orderId", type="integer", default="1"),
  284. * required={"orderId"})
  285. * )
  286. * ),
  287. * @OA\Response(response="200", description="请求成功")
  288. * )
  289. */
  290. public function payOrder() {
  291. $input = Until::getInput();
  292. $rule = [
  293. 'orderId|订单id' => 'require',
  294. ];
  295. Until::check($rule, $input);
  296. $model = new OrderModel();
  297. $orderInfo = $model::where(['id' => (int)$input['orderId']])->find();
  298. if ($orderInfo === null) {
  299. throw new ApiException('无此订单');
  300. }
  301. if ($orderInfo['status'] === OrderModel::IS_PAY) {
  302. throw new ApiException('该订单已支付');
  303. }
  304. $model::where(['id' => (int)$input['orderId']])->update([
  305. 'status' => OrderModel::IS_PAY,
  306. 'pay_time' => date('Y-m-d H:i:s')
  307. ]);
  308. $code = random_int(10000, 99999);
  309. $wModel = new WriteOffModel();
  310. $wModel::where(['order_id' => $input['orderId']])->update([
  311. 'write_off_code' => $code,
  312. ]);
  313. Until::output([]);
  314. }
  315. public function notifyOrder() {
  316. $input = Until::getInput();
  317. $rule = [
  318. 'OrderNumber|订单号' => 'require',
  319. ];
  320. Until::check($rule, $input);
  321. if (md5('ef17f532-4661-b07c-5346-65dfa304c0d8' . $input['OrderNumber']) === $this->request->header('serchkey')) {
  322. (new OrderService())->notify($input['OrderNumber']);
  323. Until::output([]);
  324. }
  325. // (new OrderService())->notify($input['OrderNumber']);
  326. Until::output(['decode' => md5('ef17f532-4661-b07c-5346-65dfa304c0d8' . $input['OrderNumber']),
  327. 'encode' => $this->request->header('serchkey')]);
  328. }
  329. public function changeCode() {
  330. $input = Until::getInput();
  331. $rule = [
  332. 'orderId|订单号' => 'require',
  333. ];
  334. Until::check($rule, $input);
  335. $ser = new OrderService();
  336. $code = $ser->changeCode();
  337. $wModel = new WriteOffModel();
  338. $wModel::where(['order_id' => $input['orderId'], 'write_off_status' => 1])->update([
  339. 'write_off_code' => $code,
  340. 'over_time' => date('Y-m-d H:i:s', time() + 2 * 60),
  341. ]);
  342. Until::output(['code' => $code]);
  343. }
  344. /**
  345. * @OA\Post(path="/api/Order/writeOffOrder",
  346. * tags={"订单管理"},
  347. * summary="核销订单",
  348. * @OA\Parameter(name="token", in="header", description="token", @OA\Schema(type="string")),
  349. * @OA\RequestBody(
  350. * @OA\MediaType(
  351. * mediaType="multipart/form-data",
  352. * @OA\Schema(
  353. * @OA\Property(description="订单id", property="orderId", type="integer", default="1"),
  354. * @OA\Property(description="核销code", property="code", type="string", default="1"),
  355. * required={"orderId","code"})
  356. * )
  357. * ),
  358. * @OA\Response(response="200", description="请求成功")
  359. * )
  360. */
  361. public function writeOffOrder() {
  362. $input = Until::getInput();
  363. $rule = [
  364. 'orderId|订单id' => 'require',
  365. 'code|核销码' => 'require'
  366. ];
  367. Until::check($rule, $input);
  368. $rs = (new OrderModel())::where(['id' => $input['orderId']])->find();
  369. if ($rs['status'] != OrderModel::IS_PAY) {
  370. throw new ApiException('该订单未付款,不可核销');
  371. }
  372. $model = new WriteOffModel();
  373. $where = ['order_id' => $input['orderId'], 'write_off_code' => $input['code']];
  374. $writeOff = $model::where($where)->find();
  375. if ($writeOff === null) {
  376. throw new ApiException('核销码错误');
  377. }
  378. if ($writeOff['write_off_status'] == 2) {
  379. throw new ApiException('该订单已经核销了');
  380. }
  381. $userModel = new UserModel();
  382. $userModel::where([['id', '=', $rs['user_id']], ['first_store_id', '=', 0]])->update(['first_store_id' => $rs['store_id']]);
  383. $model::where($where)
  384. ->update([
  385. 'write_off_status' => 2,
  386. 'write_off_time' => date('Y-m-d H:i:s'),
  387. 'admin_id' => $this->adminId
  388. ]);
  389. Until::output();
  390. }
  391. /**
  392. * @OA\Post(path="/api/Order/closeOrder",
  393. * tags={"订单管理"},
  394. * summary="订单关闭",
  395. * @OA\Parameter(name="token", in="header", description="token", @OA\Schema(type="string")),
  396. * @OA\Parameter(name="orderId", in="query", description="订单id", @OA\Schema(type="ineger",default="1")),
  397. * @OA\RequestBody(
  398. * ),
  399. * @OA\Response(response="200", description="请求成功")
  400. * )
  401. */
  402. public function closeOrder() {
  403. $input = request()->get();
  404. $model = new OrderModel();
  405. $model::where([
  406. 'user_id' => $this->userId,
  407. 'id' => (int)$input['orderId']
  408. ])->update(['status' => OrderModel::IS_CLOSE]);
  409. Until::output([]);
  410. }
  411. /**
  412. * @OA\Post(path="/api/Order/deleteOrder",
  413. * tags={"订单管理"},
  414. * summary="订单删除",
  415. * @OA\Parameter(name="token", in="header", description="token", @OA\Schema(type="string")),
  416. * @OA\Parameter(name="orderId", in="query", description="订单id", @OA\Schema(type="ineger",default="1")),
  417. * @OA\RequestBody(
  418. * ),
  419. * @OA\Response(response="200", description="请求成功")
  420. * )
  421. */
  422. public function deleteOrder() {
  423. $input = request()->get();
  424. $model = new OrderModel();
  425. $model::where([
  426. 'user_id' => $this->userId,
  427. 'id' => (int)$input['orderId']
  428. ])->update(['status' => OrderModel::IS_DELETE]);
  429. Until::output([]);
  430. }
  431. public function payOrderAgain() {
  432. $input = Until::getInput();
  433. $rule = [
  434. 'orderId|订单id' => 'require',
  435. ];
  436. Until::check($rule, $input);
  437. $data = (new OrderService())->payAgain((int)$input['orderId']);
  438. Until::output($data);
  439. }
  440. /**
  441. * @OA\Post(path="/api/Order/updateCart",
  442. * tags={"订单管理"},
  443. * summary="加入购物车",
  444. * @OA\Parameter(name="token", in="header", description="token", @OA\Schema(type="string")),
  445. * @OA\RequestBody(
  446. * @OA\MediaType(
  447. * mediaType="multipart/form-data",
  448. * @OA\Schema(
  449. * @OA\Property(description="商品id", property="productId", type="integer", default="1"),
  450. * @OA\Property(description="商品数量", property="num", type="integer", default="1"),
  451. * @OA\Property(description="购物车id", property="cartId", type="integer", default="1"),
  452. * @OA\Property(description="类型1增加 2减少", property="type", type="integer", default="1"),
  453. * required={"productId","num","cartId","type"})
  454. * )
  455. * ),
  456. * @OA\Response(response="200", description="请求成功")
  457. * )
  458. */
  459. public function updateCart() {
  460. $input = Until::getInput();
  461. $rule = [
  462. 'productId|订单id' => 'require',
  463. 'num|数量' => 'require',
  464. 'cartId|购物车id' => 'require',
  465. ];
  466. Until::check($rule, $input);
  467. $cartModel = new CartModel();
  468. $cartInfo = $cartModel::where([
  469. 'id' => $input['cartId']
  470. ])->find();
  471. if (empty($cartInfo)) {
  472. throw new ApiException('不存在的购物车id');
  473. }
  474. $cartProductModel = new CartProductModel();
  475. $rs = $cartProductModel::where(['product_id' => $input['productId'], 'cart_id' => $input['cartId']])->find();
  476. if (empty($rs)) {
  477. $cartProductModel->insertGetId([
  478. 'product_id' => $input['productId'],
  479. 'cart_id' => $input['cartId'],
  480. 'num' => $input['num'] ?? 1
  481. ]);
  482. }else {
  483. if ($input['type'] == 1) {
  484. $cartProductModel::where(['id' => $rs['id']])->inc('num', 1)->update();
  485. }
  486. if ($input['type'] == 2) {
  487. $cartProductModel::where(['id' => $rs['id']])->dec('num', 1)->update();
  488. }
  489. }
  490. $cartInfo = Until::modelToArray($cartInfo);
  491. $rs = $cartModel->getCartList();
  492. $cartInfo['list'] = $rs;
  493. Until::output($cartInfo);
  494. Until::output();
  495. }
  496. /**
  497. * @OA\Post(path="/api/Order/getCart",
  498. * tags={"订单管理"},
  499. * summary="获取购物车",
  500. * @OA\Parameter(name="token", in="header", description="token", @OA\Schema(type="string")),
  501. * @OA\RequestBody(
  502. * @OA\MediaType(
  503. * mediaType="multipart/form-data",
  504. * @OA\Schema(
  505. * @OA\Property(description="门店id", property="storeId", type="integer", default="1"),
  506. * @OA\Property(description="桌台id", property="tableId", type="integer", default="1"),
  507. * required={"storeId","tableId"})
  508. * )
  509. * ),
  510. * @OA\Response(response="200", description="请求成功")
  511. * )
  512. */
  513. public function getCart() {
  514. $input = Until::getInput();
  515. $rule = [
  516. 'storeId|门店id' => 'require',
  517. 'tableId|桌台id' => 'require'
  518. ];
  519. Until::check($rule, $input);
  520. $model = new CartModel();
  521. $cartInfo = $model::where([
  522. 'table_id' => $input['tableId'],
  523. 'store_id' => (int)$input['storeId'],
  524. 'user_id' => $this->userId,
  525. 'status' => CartModel::NORMAL
  526. ])->find();
  527. if (empty($cartInfo)) {
  528. $model->insertGetId([
  529. 'table_id' => $input['tableId'],
  530. 'store_id' => (int)$input['storeId'],
  531. 'user_id' => $this->userId,
  532. 'status' => CartModel::NORMAL
  533. ]);
  534. }
  535. $model->setWhere([
  536. 'c.status' => CartModel::NORMAL,
  537. 'c.user_id' => $this->userId,
  538. 'c.table_id' => $input['tableId'],
  539. 'c.store_id' => $input['storeId']
  540. ]);
  541. $cartInfo = Until::modelToArray($cartInfo);
  542. $rs = $model->getCartList();
  543. $cartInfo['list'] = $rs;
  544. Until::output($cartInfo);
  545. }
  546. }