xsdata.inc.php 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. <?php
  2. global $_GPC, $_W;
  3. $GLOBALS['frames'] = $this->getMainMenu();
  4. $storeid = $_COOKIE["storeid"];
  5. $time = date("Y-m-d");
  6. $where = " and time like '%{$time}%'";
  7. $where3 = " and a.time like '%{$time}%'";
  8. $where2 = " where time like '%{$time}%'";
  9. if (!empty($_GPC['time'])) {
  10. $start = strtotime($_GPC['time']['start']);
  11. $end = strtotime($_GPC['time']['end']);
  12. $where = " and UNIX_TIMESTAMP(time)>=" . $start . " and UNIX_TIMESTAMP(time)<=" . $end;
  13. $where3 = " and UNIX_TIMESTAMP(a.time)>=" . $start . " and UNIX_TIMESTAMP(a.time)<=" . $end;
  14. $where2 = " where UNIX_TIMESTAMP(time)>=" . $start . " and UNIX_TIMESTAMP(time)<=" . $end;
  15. }
  16. $jrtmoney = 0;
  17. //今日销售金额
  18. //今日订单销售金额
  19. $sql7 = " select sum(a.money) as ordermoney from (select id,money,FROM_UNIXTIME(time) as time from" . tablename('zhtc_order') . " where uniacid={$_W['uniacid']} and state in (2,3,4,5,7)) a " . $where2;
  20. $ordermoney = pdo_fetch($sql7);
  21. //商家入驻的钱
  22. $sql8 = " select sum(money) as storemoney from" . tablename('zhtc_storepaylog') . " where uniacid={$_W['uniacid']} " . $where;
  23. $storemoney = pdo_fetch($sql8);
  24. //帖子入驻加置顶
  25. $sql9 = " select sum(money) as tzmoney from" . tablename('zhtc_tzpaylog') . " where uniacid={$_W['uniacid']} " . $where . " and note!='红包福利' ";
  26. $tzmoney = pdo_fetch($sql9);
  27. // //红包
  28. // $sql13=" select sum(money) as hbmoney from".tablename('zhtc_tzpaylog')." where uniacid={$_W['uniacid']} ".$where." and note='红包福利' ";
  29. // $hbmoney=pdo_fetch($sql13);
  30. $sql5 = " select a.* from (select id,hb_money,hb_num,hb_type,hb_random,FROM_UNIXTIME(sh_time) as time from" . tablename('zhtc_information') . " where uniacid={$_W['uniacid']} and state=2) a " . $where2;
  31. $tzinfo = pdo_fetchall($sql5);
  32. $jrtz = count($tzinfo);
  33. $hbmoney = 0;
  34. if ($tzinfo) {
  35. foreach ($tzinfo as $v) {
  36. if ($v['hb_random'] == 1) {
  37. $hbmoney += $v['hb_money'];
  38. }
  39. if ($v['hb_random'] == 2) {
  40. $hbmoney += $v['hb_money'] * $v['hb_num'];
  41. }
  42. }
  43. }
  44. //拼车发布的钱
  45. $sql10 = " select sum(money) as pcmoney from" . tablename('zhtc_carpaylog') . " where uniacid={$_W['uniacid']} " . $where . " ";
  46. $pcmoney = pdo_fetch($sql10);
  47. //114入驻的钱
  48. $sql11 = " select sum(money) as hymoney from" . tablename('zhtc_yellowpaylog') . " where uniacid={$_W['uniacid']} " . $where . " ";
  49. $hymoney = pdo_fetch($sql11);
  50. //合伙人的钱
  51. $zttime = strtotime(date("Y-m-d", strtotime("+1 day")));
  52. $jttime = strtotime(date("Y-m-d"));
  53. $sql12 = " select sum(a.money) as hhrmoney from" . tablename('zhtc_fxlog') . " a" . " left join " . tablename("zhtc_user") . " b on b.id=a.user_id where b.uniacid={$_W['uniacid']} and a.state=2" . $where3;
  54. $hhrmoney = pdo_fetch($sql12);
  55. if (!empty($_GPC['time'])) {
  56. $start = strtotime($_GPC['time']['start']);
  57. $end = strtotime($_GPC['time']['end']);
  58. $sql13 = " select sum(money) as callmoney from" . tablename('zhtc_call') . " where uniacid={$_W['uniacid']} AND state=2 AND time>=" . $start . " and time<=" . $end;
  59. $callmoney = pdo_fetch($sql13);
  60. } else {
  61. $start = strtotime(date('Y-m-d', time()));
  62. $end = strtotime(date('Y-m-d', time())) + 3600 * 24;
  63. $sql13 = " select sum(money) as callmoney from" . tablename('zhtc_call') . " where uniacid={$_W['uniacid']} AND state=2 AND time>=" . $start . " and time<=" . $end;
  64. $callmoney = pdo_fetch($sql13);
  65. }
  66. //今日总金额
  67. $jrtmoney = $ordermoney['ordermoney'] + $storemoney['storemoney'] + $tzmoney['tzmoney'] + $pcmoney['pcmoney'] + $hymoney['hymoney'] + $hhrmoney['hhrmoney'] + $hbmoney;
  68. include $this->template('web/xsdata');