Stat.php 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628
  1. <?php
  2. namespace app\common\model;
  3. use think\facade\Db;
  4. /**
  5. * ============================================================================
  6. * DSMall多用户商城
  7. * ============================================================================
  8. * 版权所有 2014-2028 长沙德尚网络科技有限公司,并保留所有权利。
  9. * 网站地址: http://www.csdeshang.com
  10. * ----------------------------------------------------------------------------
  11. * 这不是一个自由软件!您只能在不用于商业目的的前提下对程序代码进行修改和使用 .
  12. * 不允许对程序代码以任何形式任何目的的再发布。
  13. * ============================================================================
  14. * 数据层模型
  15. */
  16. class Stat extends BaseModel
  17. {
  18. public $page_info;
  19. /**
  20. * 查询新增会员统计
  21. * @access public
  22. * @author csdeshang
  23. * @param array $condition 条件
  24. * @param string $field 字段
  25. * @return array
  26. */
  27. public function statByMember($where, $field = '*', $pagesize = 0, $order = '', $group = '')
  28. {
  29. if ($pagesize) {
  30. $res = Db::name('member')->field($field)->where($where)->group($group)->order($order)->paginate(['list_rows'=>$pagesize,'query' => request()->param()],false);
  31. $this->page_info = $res;
  32. return $res->items();
  33. } else {
  34. return Db::name('member')->field($field)->where($where)->page($pagesize)->order($order)->group($group)->select()->toArray();
  35. }
  36. }
  37. /**
  38. * 查询单条会员统计
  39. * @access public
  40. * @author csdeshang
  41. * @param array $where 条件
  42. * @param string $field 字段
  43. * @param string $order 排序
  44. * @param string $group 分组
  45. * @return array
  46. */
  47. public function getOneByMember($where, $field = '*', $order = '', $group = '')
  48. {
  49. return Db::name('member')->field($field)->where($where)->order($order)->group($group)->find();
  50. }
  51. /**
  52. * 查询单条店铺统计
  53. * @access public
  54. * @author csdeshang
  55. * @param type $where 条件
  56. * @param type $field 字段
  57. * @param type $order 排序
  58. * @param type $group 分组
  59. * @return type
  60. */
  61. public function getOneByStore($where, $field = '*', $order = '', $group = '')
  62. {
  63. return Db::name('store')->field($field)->where($where)->order($order)->group($group)->find();
  64. }
  65. /**
  66. * 查询店铺统计
  67. * @access public
  68. * @author csdeshang
  69. * @param type $where 条件
  70. * @param type $field 字段
  71. * @param type $order 排序
  72. * @param type $group 分组
  73. * @return type
  74. */
  75. public function statByStore($where, $field = '*', $order = '', $group = '')
  76. {
  77. return Db::name('store')->field($field)->where($where)->group($group)->order($order)->select()->toArray();
  78. }
  79. /**
  80. * 查询新增店铺统计
  81. * @access public
  82. * @author csdeshang
  83. * @param array $condition 条件
  84. * @param string $field 字段
  85. * @param int $pagesize 分页
  86. * @param string $order 排序
  87. * @param int $limit 限制
  88. * @param sting $group 分组
  89. * @return array
  90. */
  91. public function getNewStoreStatList($condition, $field = '*', $pagesize = 0, $order = 'store_id desc', $limit = 0, $group = '') {
  92. if ($pagesize) {
  93. $res = Db::name('store')->field($field)->where($condition)->group($group)->order($order)->paginate(['list_rows'=>$pagesize,'query' => request()->param()],false);
  94. $this->page_info = $res;
  95. return $res->items();
  96. } else {
  97. return Db::name('store')->field($field)->where($condition)->group($group)->order($order)->limit($limit)->select()->toArray();
  98. }
  99. }
  100. /**
  101. * 查询会员列表
  102. * @access public
  103. * @author csdeshang
  104. * @param type $where 条件
  105. * @param type $field 字段
  106. * @param type $pagesize 分页
  107. * @param type $order 排序
  108. * @return type
  109. */
  110. public function getMemberList($where, $field = '*', $pagesize = 0, $order = 'member_id desc')
  111. {
  112. if($pagesize){
  113. $res = Db::name('member')->field($field)->where($where)->order($order)->paginate(['list_rows'=>$pagesize,'query' => request()->param()],false);
  114. $this->page_info = $res;
  115. return $res->items();
  116. }else{
  117. return Db::name('member')->field($field)->where($where)->order($order)->select()->toArray();
  118. }
  119. }
  120. /**
  121. * 调取店铺等级信息
  122. * @access public
  123. * @author csdeshang
  124. * @return type
  125. */
  126. public function getStoreDegree()
  127. {
  128. $tmp = Db::name('storegrade')->field('storegrade_id,storegrade_name')->where(true)->select()->toArray();
  129. $sd_list = array();
  130. if (!empty($tmp)) {
  131. foreach ($tmp as $k => $v) {
  132. $sd_list[$v['storegrade_id']] = $v['storegrade_name'];
  133. }
  134. }
  135. return $sd_list;
  136. }
  137. /**
  138. * 查询会员统计数据记录
  139. * @access public
  140. * @author csdeshang
  141. * @param type $where 条件
  142. * @param type $field 字段
  143. * @param type $pagesize 分页
  144. * @param type $limit 限制
  145. * @param type $order 排序
  146. * @param type $group 分组
  147. * @return array
  148. */
  149. public function statByStatmember($where, $field = '*', $pagesize = 0, $limit = 0, $order = '', $group = '')
  150. {
  151. if($pagesize){
  152. $res = Db::name('statmember')->field($field)->where($where)->limit($limit)->order($order)->group($group)->paginate(['list_rows'=>$pagesize,'query' => request()->param()],false);
  153. $this->page_info = $res;
  154. return $res->items();
  155. }else{
  156. return Db::name('statmember')->field($field)->where($where)->limit($limit)->order($order)->group($group)->select()->toArray();
  157. }
  158. }
  159. /**
  160. * 查询商品数量
  161. * @access public
  162. * @author csdeshang
  163. * @param type $where 条件
  164. * @return type
  165. */
  166. public function getGoodsNum($where)
  167. {
  168. $rs = Db::name('goodscommon')->field('count(*) as allnum')->where($where)->select()->toArray();
  169. return $rs[0]['allnum'];
  170. }
  171. /**
  172. * 获取预存款数据
  173. * @access public
  174. * @author csdeshang
  175. * @param type $condition 条件
  176. * @param type $field 字段
  177. * @param type $pagesize 分页
  178. * @param type $order 排序
  179. * @param type $limit 限制
  180. * @param type $group 分组
  181. * @return type
  182. */
  183. public function getPredepositInfo($condition, $field = '*', $pagesize = 0, $order = 'lg_addtime desc', $limit = 0, $group = '')
  184. {
  185. if ($pagesize) {
  186. $res = Db::name('pdlog')->field($field)->where($condition)->group($group)->order($order)->paginate(['list_rows'=>$pagesize,'query' => request()->param()],false);
  187. $this->page_info = $res;
  188. return $res->items();
  189. } else {
  190. return Db::name('pdlog')->field($field)->where($condition)->group($group)->order($order)->limit($limit)->select()->toArray();
  191. }
  192. }
  193. /**
  194. * 获取结算数据
  195. * @access public
  196. * @author csdeshang
  197. * @param type $condition 条件
  198. * @param type $type 类型
  199. * @param type $have_page 判断分页
  200. * @return type
  201. */
  202. public function getBillList($condition, $type, $have_page = true)
  203. {
  204. switch ($type) {
  205. case 'os'://平台
  206. return Db::name('orderstatis')->field('sum(os_order_totals) as oot,sum(os_order_returntotals) as oort,sum(os_commis_totals-os_commis_returntotals) as oct,sum(os_store_costtotals) as osct,sum(os_result_totals) as ort')->where($condition)->select()->toArray();
  207. break;
  208. case 'ob'://店铺
  209. $pagesize = $have_page ? 15 : '';
  210. $result = Db::name('orderbill')->alias('order_bill')->join('store store', 'order_bill.ob_store_id=store.store_id', 'left')->field('order_bill.*,store.member_name')->where($condition)->order('ob_no desc');
  211. if($have_page){
  212. $result=$result->paginate(['list_rows'=>$pagesize,'query' => request()->param()],false);
  213. $this->page_info = $result;
  214. return $result->items();
  215. }else{
  216. $result=$result->select()->toArray();
  217. return $result;
  218. }
  219. break;
  220. }
  221. }
  222. /**
  223. * 查询订单及订单商品的统计
  224. * @access public
  225. * @author csdeshang
  226. * @param type $where 条件
  227. * @param type $field 字段
  228. * @param type $pagesize 分页
  229. * @param type $limit 限制
  230. * @param type $order 排序
  231. * @param type $group 分组
  232. * @return type
  233. */
  234. public function statByOrderGoods($where, $field = '*', $pagesize = 0, $limit = 0, $order = '', $group = '')
  235. {
  236. if($pagesize){
  237. $res = Db::name('ordergoods')->alias('ordergoods')->field($field)->join('order order', 'ordergoods.order_id=order.order_id', 'left')->where($where)->group($group)->order($order)->paginate(['list_rows'=>$pagesize,'query' => request()->param()],false);
  238. $this->page_info = $res;
  239. return $res->items();
  240. }else{
  241. return Db::name('ordergoods')->alias('ordergoods')->field($field)->join('order order', 'ordergoods.order_id=order.order_id', 'left')->where($where)->group($group)->order($order)->select()->toArray();
  242. }
  243. }
  244. /**
  245. * 查询订单及订单商品的统计
  246. * @access public
  247. * @author csdeshang
  248. * @param type $where 条件
  249. * @param type $field 字段
  250. * @param type $pagesize 分页
  251. * @param type $limit 限制
  252. * @param type $order 排序
  253. * @param type $group 分组
  254. * @return type
  255. */
  256. public function statByOrderLog($where, $field = '*', $pagesize = 0, $limit = 0, $order = '', $group = '')
  257. {
  258. if($pagesize){
  259. $res = Db::name('orderlog')->alias('orderlog')->field($field)->join('order order', 'orderlog.order_id = order.order_id', 'left')->where($where)->group($group)->order($order)->paginate(['list_rows'=>$pagesize,'query' => request()->param()],false);
  260. $this->page_info = $res;
  261. return $res->items();
  262. }else{
  263. return Db::name('orderlog')->alias('orderlog')->field($field)->join('order order', 'orderlog.order_id = order.order_id', 'left')->where($where)->group($group)->order($order)->select()->toArray();
  264. }
  265. }
  266. /**
  267. * 查询退款退货统计
  268. * @access public
  269. * @author csdeshang
  270. * @param type $where 条件
  271. * @param type $field 字段
  272. * @param type $pagesize 分页
  273. * @param type $limit 限制
  274. * @param type $order 排序
  275. * @param type $group 分组
  276. * @return type
  277. */
  278. public function statByRefundreturn($where, $field = '*', $pagesize = 0, $limit = 0, $order = '', $group = '')
  279. {
  280. if ($pagesize) {
  281. $res = Db::name('refundreturn')->field($field)->where($where)->group($group)->order($order)->paginate(['list_rows'=>$pagesize,'query' => request()->param()],false);
  282. $this->page_info = $res;
  283. return $res->items();
  284. } else {
  285. return Db::name('refundreturn')->field($field)->where($where)->group($group)->order($order)->limit($limit)->select()->toArray();
  286. }
  287. }
  288. /**
  289. * 查询店铺动态评分统计
  290. * @access public
  291. * @author csdeshang
  292. * @param type $where 条件
  293. * @param type $field 字段
  294. * @param type $pagesize 分页
  295. * @param type $limit 限制
  296. * @param type $order 排序
  297. * @param type $group 分组
  298. * @return type
  299. */
  300. public function statByStoreAndEvaluatestore($where, $field = '*', $pagesize = 0, $limit = 0, $order = '', $group = '')
  301. {
  302. if($pagesize){
  303. $res = Db::name('evaluatestore')->alias('evaluatestore')->field($field)->join('store store', 'evaluatestore.seval_storeid=store.store_id', 'left')->where($where)->group($group)->order($order)->paginate(['list_rows'=>$pagesize,'query' => request()->param()],false);
  304. $this->page_info = $res;
  305. return $res->items();
  306. }else{
  307. return Db::name('evaluatestore')->alias('evaluatestore')->field($field)->join('store store', 'evaluatestore.seval_storeid=store.store_id', 'left')->where($where)->group($group)->order($order)->select()->toArray();
  308. }
  309. }
  310. /**
  311. * 处理搜索时间
  312. * @access public
  313. * @author csdeshang
  314. * @param type $search_arr 搜索数组
  315. * @return type
  316. */
  317. public function dealwithSearchTime($search_arr)
  318. {
  319. //初始化时间
  320. //天
  321. if (!isset($search_arr['search_time'])) {
  322. $search_arr['search_time'] = date('Y-m-d', TIMESTAMP - 86400);
  323. }
  324. $search_arr['day']['search_time'] = strtotime($search_arr['search_time']); //搜索的时间
  325. //周
  326. if (!isset($search_arr['searchweek_year'])) {
  327. $search_arr['searchweek_year'] = date('Y', TIMESTAMP);
  328. }
  329. if (!isset($search_arr['searchweek_month'])) {
  330. $search_arr['searchweek_month'] = date('m', TIMESTAMP);
  331. }
  332. if (!isset($search_arr['searchweek_week'])) {
  333. $search_arr['searchweek_week'] = implode('|', getWeek_SdateAndEdate(TIMESTAMP));
  334. }
  335. $weekcurrent_year = $search_arr['searchweek_year'];
  336. $weekcurrent_month = $search_arr['searchweek_month'];
  337. $weekcurrent_week = $search_arr['searchweek_week'];
  338. $search_arr['week']['current_year'] = $weekcurrent_year;
  339. $search_arr['week']['current_month'] = $weekcurrent_month;
  340. $search_arr['week']['current_week'] = $weekcurrent_week;
  341. //月
  342. if (!isset($search_arr['searchmonth_year'])) {
  343. $search_arr['searchmonth_year'] = date('Y', TIMESTAMP);
  344. }
  345. if (!isset($search_arr['searchmonth_month'])) {
  346. $search_arr['searchmonth_month'] = date('m', TIMESTAMP);
  347. }
  348. $monthcurrent_year = $search_arr['searchmonth_year'];
  349. $monthcurrent_month = $search_arr['searchmonth_month'];
  350. $search_arr['month']['current_year'] = $monthcurrent_year;
  351. $search_arr['month']['current_month'] = $monthcurrent_month;
  352. return $search_arr;
  353. }
  354. /**
  355. * 获得查询的开始和结束时间
  356. * @access public
  357. * @author csdeshang
  358. * @param type $search_arr 搜索数组
  359. * @return type
  360. */
  361. public function getStarttimeAndEndtime($search_arr)
  362. {
  363. $stime=array();
  364. $etime=array();
  365. if (isset($search_arr['search_type'])&&$search_arr['search_type'] == 'day') {
  366. $stime = $search_arr['day']['search_time']; //今天0点
  367. $etime = $search_arr['day']['search_time'] + 86400 - 1; //今天24点
  368. }
  369. if (isset($search_arr['search_type'])&&$search_arr['search_type'] == 'week') {
  370. $current_weekarr = explode('|', $search_arr['week']['current_week']);
  371. $stime = strtotime($current_weekarr[0]);
  372. $etime = strtotime($current_weekarr[1]) + 86400 - 1;
  373. }
  374. if (isset($search_arr['search_type'])&&$search_arr['search_type'] == 'month') {
  375. $stime = strtotime($search_arr['month']['current_year'] . '-' . $search_arr['month']['current_month'] . "-01 0 month");
  376. $etime = getMonthLastDay($search_arr['month']['current_year'], $search_arr['month']['current_month']) + 86400 - 1;
  377. }
  378. return array($stime, $etime);
  379. }
  380. /**
  381. * 查询会员统计数据单条记录
  382. * @access public
  383. * @author csdeshang
  384. * @param type $where 条件
  385. * @param type $field 字段
  386. * @param type $order 排序
  387. * @param type $group 分组
  388. * @return type
  389. */
  390. public function getOneStatmember($where, $field = '*', $order = '', $group = '')
  391. {
  392. return Db::name('statmember')->field($field)->where($where)->group($group)->order($order)->find();
  393. }
  394. /**
  395. * 更新会员统计数据单条记录
  396. * @access public
  397. * @author csdeshang
  398. * @param type $where 条件
  399. * @param type $update_arr 更新数据
  400. * @return type
  401. */
  402. public function editStatmember($where, $update_arr)
  403. {
  404. return Db::name('statmember')->where($where)->update($update_arr);
  405. }
  406. /**
  407. * 查询订单的统计
  408. * @access public
  409. * @author csdeshang
  410. * @param array $where 条件
  411. * @param string $field 字段
  412. * @param int $pagesize 分页
  413. * @param int $limit 限制
  414. * @param string $order 排序
  415. * @return array
  416. */
  417. public function statByOrder($where, $field = '*', $pagesize = 0, $limit = 0, $order = '')
  418. {
  419. if($pagesize){
  420. $res = Db::name('order')->field($field)->where($where)->order($order)->paginate(['list_rows'=>$pagesize,'query' => request()->param()],false);
  421. $this->page_info = $res;
  422. return $res->items();
  423. }else{
  424. return Db::name('order')->field($field)->where($where)->order($order)->select()->toArray();
  425. }
  426. }
  427. /**
  428. * 查询积分的统计
  429. * @access public
  430. * @author csdeshang
  431. * @param array $where 条件
  432. * @param string $field 字段
  433. * @param int $pagesize 分页
  434. * @param int $limit 限制
  435. * @param string $order 排序
  436. * @param string $group 分组
  437. */
  438. public function statByPointslog($where, $field = '*', $pagesize = 0, $limit = 0, $order = '', $group = '')
  439. {
  440. if($pagesize){
  441. $res = Db::name('pointslog')->field($field)->where($where)->group($group)->order($order)->paginate(['list_rows'=>$pagesize,'query' => request()->param()],false);
  442. $this->page_info = $res;
  443. return $res->items();
  444. }else{
  445. return Db::name('pointslog')->field($field)->where($where)->group($group)->order($order)->select()->toArray();
  446. }
  447. }
  448. /**
  449. * 删除会员统计数据记录
  450. * @access public
  451. * @author csdeshang
  452. * @param type $where 条件数组
  453. */
  454. public function delByStatmember($where = array())
  455. {
  456. Db::name('statmember')->where($where)->delete();
  457. }
  458. /**
  459. * 查询订单商品缓存的统计
  460. * @access public
  461. * @author csdeshang
  462. * @param type $where 条件
  463. * @param type $field 字段
  464. * @param type $order 排序
  465. * @param type $group 分组
  466. * @return type
  467. */
  468. public function getoneByStatordergoods($where, $field = '*', $order = '', $group = '')
  469. {
  470. return Db::name('statordergoods')->field($field)->where($where)->group($group)->order($order)->find();
  471. }
  472. /**
  473. * 查询订单商品缓存的统计
  474. * @access public
  475. * @author csdeshang
  476. * @param type $where 条件
  477. * @param type $field 字段
  478. * @param type $pagesize 分页
  479. * @param type $limit 限制
  480. * @param type $order 排序
  481. * @param type $group 分组
  482. * @return type
  483. */
  484. public function statByStatordergoods($where, $field = '*', $pagesize = 0, $limit = 0, $order = '', $group = '')
  485. {
  486. if ($pagesize) {
  487. $res = Db::name('statordergoods')->field($field)->where($where)->group($group)->order($order)->paginate(['list_rows'=>$pagesize,'query' => request()->param()],false);
  488. $this->page_info = $res;
  489. return $res->items();
  490. } else {
  491. return Db::name('statordergoods')->field($field)->where($where)->group($group)->order($order)->limit($limit)->select()->toArray();
  492. }
  493. }
  494. /**
  495. * 查询订单缓存的统计
  496. * @access public
  497. * @author csdeshang
  498. * @param array $where 条件
  499. * @param string $field 字段
  500. * @param string $order 排序
  501. * @param string $group 分组
  502. * @return array
  503. */
  504. public function getoneByStatorder($where, $field = '*', $order = '', $group = '')
  505. {
  506. return Db::name('statorder')->field($field)->where($where)->group($group)->order($order)->find();
  507. }
  508. /**
  509. * 查询订单缓存的统计
  510. * @access public
  511. * @author csdeshang
  512. * @param type $where 条件
  513. * @param type $field 字段
  514. * @param type $pagesize 分页
  515. * @param type $limit 限制
  516. * @param type $order 排序
  517. * @param type $group 分组
  518. * @return type
  519. */
  520. public function statByStatorder($where, $field = '*', $pagesize = 0, $limit = 0, $order = '', $group = '') {
  521. if ($pagesize) {
  522. $res = Db::name('statorder')->field($field)->where($where)->group($group)->order($order)->paginate(['list_rows'=>$pagesize,'query' => request()->param()],false);
  523. $this->page_info = $res;
  524. return $res->items();
  525. } else {
  526. return Db::name('statorder')->field($field)->where($where)->group($group)->order($order)->limit($limit)->select()->toArray();
  527. }
  528. }
  529. /**
  530. * 查询商品列表
  531. * @access public
  532. * @author csdeshang
  533. * @param type $where 条件
  534. * @param type $field 字段
  535. * @param type $pagesize 分页
  536. * @param type $limit 限制
  537. * @param type $order 排序
  538. * @param type $group 分组
  539. * @return type
  540. */
  541. public function statByGoods($where, $field = '*', $pagesize = 0, $limit = 0, $order = '', $group = '')
  542. {
  543. if($pagesize){
  544. $res = Db::name('goods')->field($field)->where($where)->group($group)->order($order)->paginate(['list_rows'=>$pagesize,'query' => request()->param()],false);
  545. $this->page_info = $res;
  546. return $res->items();
  547. }else{
  548. return Db::name('goods')->field($field)->where($where)->group($group)->order($order)->select()->toArray();
  549. }
  550. }
  551. /**
  552. * 查询流量统计单条记录
  553. * @access public
  554. * @author csdeshang
  555. * @param type $tablename 表名
  556. * @param type $where 条件
  557. * @param type $field 字段
  558. * @param type $order 排序
  559. * @param type $group 分组
  560. * @return type
  561. */
  562. public function getoneByFlowstat($tablename = 'flowstat', $where, $field = '*', $order = '', $group = '')
  563. {
  564. return Db::name($tablename)->field($field)->where($where)->group($group)->order($order)->find();
  565. }
  566. /**
  567. * 查询流量统计记录
  568. * @access public
  569. * @author csdeshang
  570. * @param string $tablename 表名
  571. * @param array $where 条件
  572. * @param string $field 字段
  573. * @param int $pagesize 分页
  574. * @param int $limit 限制
  575. * @param string $order 排序
  576. * @param string $group 分组
  577. * @return array
  578. */
  579. public function statByFlowstat($tablename = 'flowstat', $where, $field = '*', $pagesize = 0, $limit = 0, $order = '', $group = '')
  580. {
  581. if ($pagesize) {
  582. $res = Db::name($tablename)->field($field)->where($where)->group($group)->order($order)->paginate(['list_rows'=>$pagesize,'query' => request()->param()],false);
  583. $this->page_info = $res;
  584. return $res->items();
  585. } else {
  586. return Db::name($tablename)->field($field)->where($where)->group($group)->order($order)->limit($limit)->select()->toArray();
  587. }
  588. }
  589. }