Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
Y
ypt_mgw_local
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
苏星豪
ypt_mgw_local
Commits
c8df677a
提交
c8df677a
authored
8月 02, 2024
作者:
张颂恩
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
调整
上级
3844966d
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
48 行增加
和
8 行删除
+48
-8
models.py
banquet/models.py
+5
-1
views.py
banquet/views.py
+0
-0
views.py
sales/views.py
+11
-7
apply_permit.html
templates/banquet/apply_permit.html
+7
-0
views.py
wx/views.py
+25
-0
没有找到文件。
banquet/models.py
浏览文件 @
c8df677a
...
...
@@ -164,7 +164,11 @@ class Apply(models.Model):
status
=
models
.
SmallIntegerField
(
_
(
'状态'
),
choices
=
(
(
0
,
_
(
'未审核'
)),
(
1
,
_
(
'已通过'
)),
(
2
,
_
(
'未通过'
)),
),
default
=
0
)
(
2
,
_
(
'未通过'
)),
(
3
,
_
(
'结算审核中'
)),
(
4
,
_
(
'结算中'
)),
(
5
,
_
(
'已结算'
)),
),
default
=
0
)
reason
=
models
.
CharField
(
_
(
'原因'
),
max_length
=
500
,
blank
=
True
,
null
=
True
)
annotation
=
models
.
CharField
(
_
(
'批注'
),
max_length
=
500
,
blank
=
True
,
null
=
True
)
# 冗余,为提高查询速度
...
...
banquet/views.py
浏览文件 @
c8df677a
差异被折叠。
点击展开。
sales/views.py
浏览文件 @
c8df677a
...
...
@@ -5691,6 +5691,12 @@ def do_hexiao(request):
if
agent
.
level_id
>
award
.
hexiao_level_id
:
is_in_level
=
False
if
is_in_level
:
if
company_id
==
"203634"
and
c
.
agent_id
:
if
agent
.
id
!=
c
.
agent_id
:
data
[
'e'
]
=
'非本门店销售产品'
return
JsonResponse
(
data
)
money
=
0
if
award
.
amount
:
money
=
award
.
amount
...
...
@@ -5794,7 +5800,7 @@ def do_hexiao(request):
else
:
data
[
'e'
]
=
'数据丢失'
return
JsonResponse
(
data
)
;
return
JsonResponse
(
data
)
...
...
@@ -9756,10 +9762,9 @@ def activity_person_lottery_plan_list(request):
data
[
'murl'
]
=
'/sales/activity/person_lottery_plan_edit'
dt
=
datetime
.
datetime
.
now
()
.
strftime
(
'
%
Y-
%
m-
%
d'
)
dt_fr
=
request
.
GET
.
get
(
'date_from'
,
dt
)
dt_to
=
request
.
GET
.
get
(
'
'
,
dt
)
dt_to
=
request
.
GET
.
get
(
'
date_to'
,
(
datetime
.
datetime
.
now
()
+
datetime
.
timedelta
(
days
=
1
))
.
strftime
(
"
%
Y-
%
m-
%
d"
)
)
data
[
"date_from"
]
=
dt_fr
data
[
"date_to"
]
=
dt_to
dt_to
=
(
datetime
.
datetime
.
now
()
+
datetime
.
timedelta
(
days
=
1
))
.
strftime
(
"
%
Y-
%
m-
%
d"
)
f
=
"company_id = "
+
str
(
request
.
user
.
company
.
id
)
+
" and tm>='"
+
dt_fr
+
"' and tm <='"
+
dt_to
+
"'"
cur
=
connection
.
cursor
()
...
...
@@ -9769,16 +9774,15 @@ def activity_person_lottery_plan_list(request):
"FROM sales_activity_person_lottery_plan a where "
+
f
)
rs
=
cur
.
fetchall
()
for
r
in
rs
:
lottery
=
Activity_Person_Lottery_Plan
.
objects
.
get
(
id
=
r
[
0
])
check_box
=
'<input class="checkchild" value="'
+
str
(
r
[
0
])
+
'" type="checkbox">'
print
(
'person'
,
r
,)
check_box
=
'<input class="checkchild" value="'
+
str
(
r
[
0
])
+
'" type="checkbox">'
m
=
"只中一次"
if
r
[
6
]
==
0
else
"每人都中"
data
[
'data'
]
.
append
([
check_box
,
r
[
1
],
r
[
2
],
r
[
3
],
r
[
4
],
r
[
5
],
lottery
.
get_win_method_display
()
,
m
,
r
[
7
],
r
[
8
],
"<button class='btn btn-danger btn-xs' onclick='deleteItem("
+
str
(
r
[
0
])
+
")'>删除</button>"
...
...
templates/banquet/apply_permit.html
浏览文件 @
c8df677a
...
...
@@ -45,6 +45,13 @@
})
});
var
status
=
{{
status
}}
if
(
status
>=
3
){
$
(
"#status_select"
).
html
(
`
<option value="2">驳回</option>
<option value="4">通过</option>
`
)
}
})
</script>
...
...
wx/views.py
浏览文件 @
c8df677a
...
...
@@ -2435,6 +2435,31 @@ def ajax_get_activity(request):
if
r
and
r
[
0
]:
cur
.
execute
(
"update sales_activity_lottery_plan set is_win = true where id = "
+
str
(
r
[
1
]))
activity_award
=
ActivityAwards
.
objects
.
get
(
id
=
r
[
0
])
if
company_id
==
"145564"
and
not
activity_award
:
cur
.
execute
(
f
"""
SELECT award_id, win_method, win_consumer_ids, id FROM sales_activity_person_lottery_plan where activity_id = {str(act_id)}
AND tm_start < now()
AND tm_end > now()
AND ARRAY[{consumer_id}] <@ consumer_ids
limit 1
"""
)
r
=
cur
.
fetchone
()
if
r
:
win_award_id
=
r
[
0
]
win_method
=
r
[
1
]
win_consumer_ids
=
r
[
2
]
win
=
False
if
win_method
==
0
and
not
win_consumer_ids
:
win
=
True
elif
win_method
==
1
and
int
(
consumer_id
)
not
in
win_consumer_ids
:
win
=
True
if
win
:
win_consumer_ids
.
append
(
int
(
consumer_id
))
activity_award
=
ActivityAwards
.
objects
.
get
(
id
=
win_award_id
)
cur
.
execute
(
"update sales_activity_person_lottery_plan set win_consumer_ids = '{"
+
(
','
.
join
(
map
(
str
,
win_consumer_ids
)))
+
"}' where id = "
+
str
(
r
[
3
]))
if
not
activity_award
:
activity_award
=
d
[
'activity'
]
.
draw
(
agent
,
lng
,
lat
,
phone
=
phone
,
label_code
=
label_code
)
activity_award_id
=
None
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论