stat_buying.html 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184
  1. {include file="public/header" /}
  2. <div class="page">
  3. <div class="fixed-bar">
  4. <div class="item-title">
  5. <div class="subject">
  6. <h3>{$Think.lang.ds_statmember}</h3>
  7. <h5></h5>
  8. </div>
  9. {include file="public/admin_items" /}
  10. </div>
  11. </div>
  12. <form method="get" action="" name="formSearch" id="formSearch">
  13. <div class="ds-search-form">
  14. <dl>
  15. <dd>
  16. <select name="search_type" id="search_type" class="querySelect">
  17. <option value="day" {if isset($search_arr.search_type) && $search_arr.search_type == 'day'}selected{/if}>{$Think.lang.search_type_day}</option>
  18. <option value="week" {if isset($search_arr.search_type) && $search_arr.search_type == 'week'}selected{/if}>{$Think.lang.search_type_week}</option>
  19. <option value="month" {if isset($search_arr.search_type) && $search_arr.search_type == 'month'}selected{/if}>{$Think.lang.search_type_month}</option>
  20. </select>
  21. </dd>
  22. <dd id="searchtype_day" style="display:none;">
  23. <input class="txt date" type="text" value="{:date('Y-m-d',$search_arr.day.search_time)}" id="search_time" name="search_time">
  24. </dd>
  25. <dd id="searchtype_week" style="display:none;">
  26. <select name="searchweek_year" class="querySelect">
  27. {foreach name="year_arr" item="v"}
  28. <option value="{$key}" {$search_arr.week.current_year== $key ? 'selected': ''}>{$v}</option>
  29. {/foreach}
  30. </select>
  31. <select name="searchweek_month" class="querySelect">
  32. {foreach name="month_arr" item="v"}
  33. <option value="{$key}" {$search_arr.week.current_month== $key ? 'selected':''}>{$v}</option>
  34. {/foreach}
  35. </select>
  36. <select name="searchweek_week" class="querySelect">
  37. {foreach name="week_arr" item="v"}
  38. <option value="{$v.key}" {$search_arr.week.current_week==$v['key'] ? 'selected' :''}>{$v.val}</option>
  39. {/foreach}
  40. </select>
  41. </dd>
  42. <dd id="searchtype_month" style="display:none;">
  43. <select name="searchmonth_year" class="querySelect">
  44. {foreach name="year_arr" item="v"}
  45. <option value="{$key}" {$search_arr.month.current_year== $key?'selected':''}>{$v}</option>
  46. {/foreach}
  47. </select>
  48. <select name="searchmonth_month" class="querySelect">
  49. {foreach name="month_arr" item="v"}
  50. <option value="{$key}" {$search_arr.month.current_month== $key?'selected':''}>{$v}</option>
  51. {/foreach}
  52. </select>
  53. </dd>
  54. </dl>
  55. <dl>
  56. <dt>{$Think.lang.ds_member_name}</dt>
  57. <dd><input type="text" name="membername" value="{$Request.param.membername}"/></dd>
  58. </dl>
  59. <div class="btn_group">
  60. <a href="javascript:void(0);" id="dssubmit" class="btn" title="{$Think.lang.ds_query}">{$Think.lang.ds_query}</a>
  61. <a href="{:url('Statmember/buying')}" class="btn btn-default" title="{$Think.lang.ds_cancel}">{$Think.lang.ds_cancel}</a>
  62. </div>
  63. </div>
  64. </form>
  65. <div class="explanation" id="explanation">
  66. <div class="title" id="checkZoom">
  67. <h4 title="{$Think.lang.ds_explanation_tip}">{$Think.lang.ds_explanation}</h4>
  68. <span id="explanationZoom" title="{$Think.lang.ds_explanation_close}" class="arrow"></span>
  69. </div>
  70. <ul>
  71. <li>{$Think.lang.stat_validorder_explain}</li>
  72. <li>{$Think.lang.statmember_stat_buying_help1}</li>
  73. <li>{$Think.lang.statmember_stat_buying_help2}</li>
  74. <li>{$Think.lang.statmember_stat_buying_help3}</li>
  75. </ul>
  76. </div>
  77. <table class="ds-default-table">
  78. <thead class="thead">
  79. <tr class="space">
  80. <th colspan="15">{$Think.lang.statmember_per_member_price_distribution}(<a href="{:url('Statgeneral/orderprange')}" style="font-size:12px; font-weight:normal;">{$Think.lang.statgeneral_setting}</a>)</th>
  81. </tr>
  82. </thead>
  83. <tbody>
  84. <tr>
  85. <td>
  86. {if $guestprice_statjson}
  87. <div id="container_guestprice" class="w100pre close_float" style="height:400px"></div>
  88. {else /}
  89. <div class="w100pre close_float align-center h36 mt10">{$Think.lang.statmember_setting_tips}<a href="{:url('Statgeneral/orderprange')}" style="font-size:12px; font-weight:normal;">{$Think.lang.statgoods_set_now}</a></div>
  90. {/if}
  91. </td>
  92. </tr>
  93. </tbody>
  94. </table>
  95. <table class="ds-default-table">
  96. <thead class="thead">
  97. <tr class="space">
  98. <th colspan="15">{$Think.lang.buy_frequence_analyze}</th>
  99. </tr>
  100. <tr class="thead">
  101. <th class="align-center">{$Think.lang.statstore_number}</th>
  102. <th class="align-center">{$Think.lang.buy_frequence}</th>
  103. <th class="align-center">{$Think.lang.membernum}</th>
  104. <th class="align-center">{$Think.lang.membernum_percent}</th>
  105. </tr>
  106. </thead>
  107. <tbody id="datatable">
  108. {notempty name="stattimes_arr"}
  109. {foreach name="stattimes_arr" item="v"}
  110. <tr class="hover">
  111. <td class="align-center">{$key}</td>
  112. <td class="align-center">{$v.text}</td>
  113. <td class="align-center">{$v.num}</td>
  114. <td class="align-center">{$v.rate}%</td>
  115. </tr>
  116. {/foreach}
  117. {else /}
  118. <tr class="no_data">
  119. <td colspan="15">{$Think.lang.no_record}</td>
  120. </tr>
  121. {/notempty}
  122. </tbody>
  123. </table>
  124. <table class="ds-default-table">
  125. <thead class="thead">
  126. <tr class="space">
  127. <th colspan="15">{$Think.lang.statmember_time_distribution}</th>
  128. </tr>
  129. </thead>
  130. <tbody>
  131. <tr>
  132. <td><div id="container_hour" class="w100pre close_float" style="height:400px"></div></td>
  133. </tr>
  134. </tbody>
  135. </table>
  136. </div>
  137. <script src="{$Think.PLUGINS_SITE_ROOT}/highcharts/highcharts.js"></script>
  138. <script src="{$Think.PLUGINS_SITE_ROOT}/statistics.js"></script>
  139. <script>
  140. //展示搜索时间框
  141. function show_searchtime(){
  142. s_type = $("#search_type").val();
  143. $("[id^='searchtype_']").hide();
  144. $("#searchtype_"+s_type).show();
  145. }
  146. $(function () {
  147. //统计数据类型
  148. var s_type = $("#search_type").val();
  149. $('#search_time').datepicker({dateFormat: 'yy-mm-dd'});
  150. show_searchtime();
  151. $("#search_type").change(function(){
  152. show_searchtime();
  153. });
  154. //更新周数组
  155. $("[name='searchweek_month']").change(function(){
  156. var year = $("[name='searchweek_year']").val();
  157. var month = $("[name='searchweek_month']").val();
  158. $("[name='searchweek_week']").html('');
  159. $.getJSON(ADMINSITEURL+'/Common/getweekofmonth',{y:year,m:month},function(data){
  160. if(data != null){
  161. for(var i = 0; i < data.length; i++) {
  162. $("[name='searchweek_week']").append('<option value="'+data[i].key+'">'+data[i].val+'</option>');
  163. }
  164. }
  165. });
  166. });
  167. $('#container_guestprice').highcharts({$guestprice_statjson|raw});
  168. $('#container_hour').highcharts({$hour_statjson|raw});
  169. $('#dssubmit').click(function(){
  170. $('#formSearch').submit();
  171. });
  172. });
  173. </script>