Commit ac177464 authored by 魏艺敏's avatar 魏艺敏

Merge branch 'hanyingyue' into 'master'

Hanyingyue

See merge request !117
parents 1de53d78 1b0ab9c5
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="BranchesTreeState">
<expand>
<path>
<item name="ROOT" type="e8cecc67:BranchNodeDescriptor" />
<item name="LOCAL_ROOT" type="e8cecc67:BranchNodeDescriptor" />
</path>
<path>
<item name="ROOT" type="e8cecc67:BranchNodeDescriptor" />
<item name="REMOTE_ROOT" type="e8cecc67:BranchNodeDescriptor" />
</path>
<path>
<item name="ROOT" type="e8cecc67:BranchNodeDescriptor" />
<item name="REMOTE_ROOT" type="e8cecc67:BranchNodeDescriptor" />
<item name="GROUP_NODE:origin" type="e8cecc67:BranchNodeDescriptor" />
</path>
</expand>
<select />
</component>
<component name="ChangeListManager">
<list default="true" id="19033445-2f8f-4eb0-b725-3c6ceb4feec5" name="Default Changelist" comment="" />
<list default="true" id="19033445-2f8f-4eb0-b725-3c6ceb4feec5" name="Default Changelist" comment="push core">
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
<option name="LAST_RESOLUTION" value="IGNORE" />
</component>
<component name="Git.Pull.Settings">
<option name="BRANCH" value="master" />
</component>
<component name="Git.Settings">
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
</component>
......@@ -18,6 +41,13 @@
</component>
<component name="PropertiesComponent">
<property name="RunOnceActivity.OpenProjectViewOnStart" value="true" />
<property name="last_opened_file_path" value="$PROJECT_DIR$/pm" />
</component>
<component name="RecentsManager">
<key name="CopyFile.RECENT_KEYS">
<recent name="$PROJECT_DIR$/pm" />
<recent name="$PROJECT_DIR$/pm/core_daily/job" />
</key>
</component>
<component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="application-level" UseSingleDictionary="true" transferred="true" />
<component name="TaskManager">
......@@ -28,6 +58,141 @@
<option name="presentableId" value="Default" />
<updated>1603184895427</updated>
</task>
<task id="LOCAL-00001" summary="push core">
<created>1605253148962</created>
<option name="number" value="00001" />
<option name="presentableId" value="LOCAL-00001" />
<option name="project" value="LOCAL" />
<updated>1605253148963</updated>
</task>
<task id="LOCAL-00002" summary="push core">
<created>1605253540341</created>
<option name="number" value="00002" />
<option name="presentableId" value="LOCAL-00002" />
<option name="project" value="LOCAL" />
<updated>1605253540342</updated>
</task>
<task id="LOCAL-00003" summary="push core">
<created>1605253780431</created>
<option name="number" value="00003" />
<option name="presentableId" value="LOCAL-00003" />
<option name="project" value="LOCAL" />
<updated>1605253780431</updated>
</task>
<task id="LOCAL-00004" summary="push core">
<created>1605255048358</created>
<option name="number" value="00004" />
<option name="presentableId" value="LOCAL-00004" />
<option name="project" value="LOCAL" />
<updated>1605255048358</updated>
</task>
<task id="LOCAL-00005" summary="push core">
<created>1605255123494</created>
<option name="number" value="00005" />
<option name="presentableId" value="LOCAL-00005" />
<option name="project" value="LOCAL" />
<updated>1605255123494</updated>
</task>
<task id="LOCAL-00006" summary="push core">
<created>1605262697754</created>
<option name="number" value="00006" />
<option name="presentableId" value="LOCAL-00006" />
<option name="project" value="LOCAL" />
<updated>1605262697754</updated>
</task>
<task id="LOCAL-00007" summary="push core">
<created>1605264570496</created>
<option name="number" value="00007" />
<option name="presentableId" value="LOCAL-00007" />
<option name="project" value="LOCAL" />
<updated>1605264570496</updated>
</task>
<task id="LOCAL-00008" summary="push core">
<created>1605265059043</created>
<option name="number" value="00008" />
<option name="presentableId" value="LOCAL-00008" />
<option name="project" value="LOCAL" />
<updated>1605265059043</updated>
</task>
<task id="LOCAL-00009" summary="push core">
<created>1605266388426</created>
<option name="number" value="00009" />
<option name="presentableId" value="LOCAL-00009" />
<option name="project" value="LOCAL" />
<updated>1605266388426</updated>
</task>
<task id="LOCAL-00010" summary="push core">
<created>1605267797787</created>
<option name="number" value="00010" />
<option name="presentableId" value="LOCAL-00010" />
<option name="project" value="LOCAL" />
<updated>1605267797787</updated>
</task>
<task id="LOCAL-00011" summary="push channel_pay_7_30.zip">
<created>1605493540644</created>
<option name="number" value="00011" />
<option name="presentableId" value="LOCAL-00011" />
<option name="project" value="LOCAL" />
<updated>1605493540644</updated>
</task>
<task id="LOCAL-00012" summary="push channel_pay_7_30.zip">
<created>1605517790430</created>
<option name="number" value="00012" />
<option name="presentableId" value="LOCAL-00012" />
<option name="project" value="LOCAL" />
<updated>1605517790430</updated>
</task>
<task id="LOCAL-00013" summary="push core">
<created>1605526719888</created>
<option name="number" value="00013" />
<option name="presentableId" value="LOCAL-00013" />
<option name="project" value="LOCAL" />
<updated>1605526719889</updated>
</task>
<option name="localTasksCounter" value="14" />
<servers />
</component>
<component name="Vcs.Log.Tabs.Properties">
<option name="TAB_STATES">
<map>
<entry key="MAIN">
<value>
<State />
</value>
</entry>
</map>
</option>
</component>
<component name="VcsManagerConfiguration">
<MESSAGE value="push channel_pay_7_30" />
<MESSAGE value="push channel_pay" />
<MESSAGE value="push channel" />
<MESSAGE value="push channel_pay_7_30.zip" />
<MESSAGE value="push core" />
<option name="LAST_COMMIT_MESSAGE" value="push core" />
</component>
<component name="WindowStateProjectService">
<state x="432" y="246" key="#com.intellij.fileTypes.FileTypeChooser" timestamp="1605183565639">
<screen x="0" y="23" width="1440" height="826" />
</state>
<state x="432" y="246" key="#com.intellij.fileTypes.FileTypeChooser/0.23.1440.826/-1920.-73.1920.1057@0.23.1440.826" timestamp="1605183565639" />
<state x="392" y="210" key="Vcs.Push.Dialog.v2" timestamp="1605526793024">
<screen x="0" y="23" width="1440" height="827" />
</state>
<state x="392" y="209" key="Vcs.Push.Dialog.v2/0.23.1440.823/-1920.-73.1920.1057@0.23.1440.823" timestamp="1605267801757" />
<state x="-1113" y="166" key="Vcs.Push.Dialog.v2/0.23.1440.825/-1920.-73.1920.1057@-1920.-73.1920.1057" timestamp="1605253159928" />
<state x="392" y="209" key="Vcs.Push.Dialog.v2/0.23.1440.825/-1920.-73.1920.1057@0.23.1440.825" timestamp="1605517797061" />
<state x="-1113" y="166" key="Vcs.Push.Dialog.v2/0.23.1440.826/-1920.-73.1920.1057@-1920.-73.1920.1057" timestamp="1605253785848" />
<state x="392" y="210" key="Vcs.Push.Dialog.v2/0.23.1440.827/-1920.-73.1920.1057@0.23.1440.827" timestamp="1605526793024" />
<state x="392" y="210" key="Vcs.Push.Dialog.v2/0.23.1440.828/-1920.-73.1920.1057@0.23.1440.828" timestamp="1605493545759" />
<state x="-1113" y="151" key="Vcs.Push.Dialog.v2/0.23.1440.877/-1920.-73.1920.991@-1920.-73.1920.991" timestamp="1605255135718" />
<state x="418" y="69" width="604" height="735" key="find.popup" timestamp="1605184781826">
<screen x="0" y="23" width="1440" height="826" />
</state>
<state x="418" y="69" width="604" height="735" key="find.popup/0.23.1440.826/-1920.-73.1920.1057@0.23.1440.826" timestamp="1605184781826" />
<state x="391" y="170" width="670" height="676" key="search.everywhere.popup" timestamp="1605267681561">
<screen x="0" y="23" width="1440" height="823" />
</state>
<state x="391" y="170" width="670" height="676" key="search.everywhere.popup/0.23.1440.823/-1920.-73.1920.1057@0.23.1440.823" timestamp="1605267681561" />
</component>
</project>
\ No newline at end of file
channel_pay_7_30=新增用户支付数据-分渠道
#step1_1.job
type=command
command=sh /home/bi/bi-report/lib/shell/waitsuccess.sh hive online ml_device_day_active_status
\ No newline at end of file
#step1_2.job
type=command
command=sh /home/bi/bi-report/lib/shell/waitsuccess.sh hive online ml_trade_order_detail_day
#step2.job
type=command
dependencies=step1_1,step1_2
command=curl -X GET http://localhost:8553/api/report/email/channel_pay_7_30/hanyingyue@igengmei.com/weiyimin@igengmei.com
\ No newline at end of file
--新增用户支付分渠道数据
SELECT partition_date as `日期`
,device_os_type as `设备`
,channel as `渠道`
,sum(order_num_7)`7天内支付订单量`
,sum(order_num_30)`30天内支付订单量`
-- ,sum(order_num_90)`90天内支付订单量`
-- ,sum(dev_num_30)`30天内支付设备数(设备数当天去重,按月加总时不去重)`
-- ,sum(dev_num_60)`60天内支付设备数(设备数当天去重,按月加总时不去重)`
-- ,sum(dev_num_90)`90天内支付设备数(设备数当天去重,按月加总时不去重)`
,sum(gmv_7)`7天内支付订单额`
,sum(gmv_30)`30天内支付订单额`
-- ,sum(gmv_90)`90天内支付订单额`
FROM
(
SELECT mas.partition_date,device_os_type,channel
,nvl(sum(case when a.pay_date>=mas.partition_date and a.pay_date<=date_add(mas.partition_date,7) then order_num end),0) as order_num_7
,nvl(sum(case when a.pay_date>=mas.partition_date and a.pay_date<=date_add(mas.partition_date,30) then order_num end),0) as order_num_30
,nvl(sum(case when a.pay_date>=mas.partition_date and a.pay_date<=date_add(mas.partition_date,90) then order_num end),0) as order_num_90
,nvl(count(distinct case when a.pay_date>=mas.partition_date and a.pay_date<=date_add(mas.partition_date,7) then a.device_id end),0) as dev_num_7
,nvl(count(distinct case when a.pay_date>=mas.partition_date and a.pay_date<=date_add(mas.partition_date,30) then a.device_id end),0) as dev_num_30
,nvl(count(distinct case when a.pay_date>=mas.partition_date and a.pay_date<=date_add(mas.partition_date,90) then a.device_id end),0) as dev_num_90
,nvl(sum(case when a.pay_date>=mas.partition_date and a.pay_date<=date_add(mas.partition_date,7) then service_price end),0) as gmv_7
,nvl(sum(case when a.pay_date>=mas.partition_date and a.pay_date<=date_add(mas.partition_date,30) then service_price end),0) as gmv_30
,nvl(sum(case when a.pay_date>=mas.partition_date and a.pay_date<=date_add(mas.partition_date,90) then service_price end),0) as gmv_90
FROM
(
SELECT concat_ws('-',substr(partition_date,1,4),substr(partition_date,5,2),substr(partition_date,7,2)) as partition_date
,a.device_id,device_os_type
,case when ios_device.idfa is not null then ios_device.channel else a.first_channel_source_type END as channel
FROM
(
select partition_date,device_id,device_os_type
,first_channel_source_type
from online.ml_device_day_active_status
where partition_date>=regexp_replace(date_sub(current_date(),30),'-','')
AND partition_date<= regexp_replace(date_sub(current_date(),1),'-','')
and active_type in ('1','2')
)a
LEFT JOIN
(
SELECT channel,idfa
FROM
(
SELECT channel,idfa,row_number () over (PARTITION BY idfa ORDER BY active_time asc) rn--,substr(active_time,1,7) as new_month
FROM online.tl_hdfs_ios_idfa_tmp --设备表,区分App Store 明细渠道名字
)a
WHERE rn = 1
)ios_device
on ios_device.idfa=a.device_id
)mas
left join
(
SELECT device_id,SUBSTR(pay_date,1,10) as pay_date
,count(distinct order_id) as order_num
,sum(service_price) as service_price
FROM online.ml_trade_order_detail_day
WHERE PARTITION_DATE = regexp_replace(date_sub(current_date(),1),'-','')
and is_pure_user='true'
AND regexp_replace(SUBSTR(pay_date,1,10),'-','') >=regexp_replace(date_sub(current_date(),30),'-','')
AND regexp_replace(SUBSTR(pay_date,1,10),'-','')<=REGEXP_REPLACE(date_sub(current_date(),1),'-','')
group by device_id,SUBSTR(pay_date,1,10)
)a
on mas.device_id=a.device_id
group by mas.partition_date,device_os_type,channel
)t
group by partition_date
,device_os_type
,channel
\ No newline at end of file
......@@ -124,7 +124,7 @@ FROM
and partition_date<=regexp_replace(DATE_SUB(current_date,1) ,'-','')
and action='on_click_card'
and page_name='home'
and params['card_type']='card'
and params['card_type'] in ('card','video','search_word')
group by partition_date
,cl_id
,params['card_id']
......@@ -143,7 +143,8 @@ FROM
and (referrer in ('home') or
(params['referrer_link'] like '%[%' and
json_split(params['referrer_link'])[size(json_split(params['referrer_link']))-1] in ('home')))
and page_name in ('diary_detail','topic_detail','post_detail','user_post_detail','doctor_post_detail','question_detail','answer_detail','question_answer_detail')
and (page_name in ('diary_detail','topic_detail','post_detail','user_post_detail','doctor_post_detail','question_detail','answer_detail','question_answer_detail',
'video_steep','article_detail') or page_name like 'search_result_%')
group by partition_date
,cl_id
,params['business_id']
......@@ -164,8 +165,9 @@ FROM
and (referrer='home' or
(params['referrer_link'] like '%[%' and
json_split(params['referrer_link'])[size(json_split(params['referrer_link']))-1]='home'))
and page_name in ('diary_detail','topic_detail','post_detail','user_post_detail','doctor_post_detail','question_detail','answer_detail','question_answer_detail',
'video_steep','article_detail')
and (page_name in ('diary_detail','topic_detail','post_detail','user_post_detail','doctor_post_detail','question_detail','answer_detail','question_answer_detail',
'video_steep','article_detail') or page_name like 'search_result_%')
--and (params['is_push']=0 or params['is_push'] is null)
)a
left join
(--评论的埋点有缺失,所以用业务库数据来补充
......@@ -224,7 +226,8 @@ FROM
or (action='on_click_favor' and params['motion']='do')--点击收藏
or action='page_click_share'--点击分享
or (action='on_click_vote' and params['motion']='vote')--点击点赞
or b.user_id is not null )--当天有针对内容的评论
or b.user_id is not null --当天有针对内容的评论
or page_name like 'search_result_%' and action not in ('upload_page','report_status','popup_view','refresh_page','on_app_session_over'))--在搜索结果页有点击行为
group by a.partition_date,a.cl_id,a.business_id
)t5
on t4.partition_date=t5.partition_date and t4.device_id=t5.cl_id and t4.card_id=t5.business_id
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment