Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
tl_estate
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
hujun
tl_estate
Commits
5339858e
Commit
5339858e
authored
Mar 23, 2018
by
clone
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
生成图片
parent
0c20cc60
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
65 additions
and
73 deletions
+65
-73
Statement.php
application/api_broker/controller/Statement.php
+65
-5
agentindex.js
public/resource/js/agentindex.js
+0
-68
No files found.
application/api_broker/controller/Statement.php
View file @
5339858e
...
...
@@ -28,11 +28,11 @@ class Statement extends Basic
public
function
dayStatement
()
{
$params
=
$this
->
params
;
/* $params = array(
"agent_id" => 1,
"time_start" => date("Y-m-d", time()),
"time_end" => date("Y-m-d", time()) . " 23:59:59",
);*/
/* $params = array(
"agent_id" => 1,
"time_start" => date("Y-m-d", time()),
"time_end" => date("Y-m-d", time()) . " 23:59:59",
);*/
if
(
!
isset
(
$params
[
"agent_id"
])
||
!
isset
(
$params
[
"time_start"
])
||
!
isset
(
$params
[
"time_end"
]))
{
return
$this
->
response
(
"101"
,
"请求参数错误"
);
}
...
...
@@ -49,4 +49,63 @@ class Statement extends Basic
}
function
weekwork_img
()
{
$params
=
array
(
"agent_id"
=>
1
,
"img"
=>
"12313"
,
"is_square"
=>
"123123"
,
"start_time"
=>
"2018-03-20 12:11:21"
,
"end_time"
=>
"2018-03-21 12:11:21"
,
"type"
=>
1
,
//0日报 1周报
);
if
(
empty
(
$params
[
"agent_id"
])
||
empty
(
$params
[
"img"
])
||
empty
(
$params
[
"table"
]))
{
return
$this
->
response
(
"101"
,
"参数错误"
);
}
$img_title
=
""
;
$img
=
""
;
//单图
$base64_image_content
=
$params
[
"img"
];
if
(
preg_match
(
'/^(data:\s*image\/(\w+);base64,)/'
,
$base64_image_content
,
$array
))
{
$img_title
=
$array
[
2
];
//jpeg
$img
=
base64_decode
(
str_replace
(
$array
[
1
],
''
,
$base64_image_content
));
//返回文件流
}
$tmp_file
=
time
();
$img_name
=
md5
(
uniqid
(
$tmp_file
))
.
'.'
.
$img_title
;
//图片名
$url
=
"week_work_img/"
.
$img_name
;
file_put_contents
(
$url
,
$img
);
$data
[
'id'
]
=
''
;
$data
[
'house_id'
]
=
$this
->
request
->
data
[
'house_id'
];
$data
[
'start_time'
]
=
$this
->
request
->
data
[
'start_time'
];
$data
[
'end_time'
]
=
$this
->
request
->
data
[
'end_time'
];
$data
[
'img'
]
=
$img_name
;
$data
[
'agent_id'
]
=
$params
[
"agent_id"
];
$data
[
'table'
]
=
$this
->
request
->
data
[
'table'
];
if
(
empty
(
$this
->
request
->
data
[
'type'
]))
{
$data
[
'type'
]
=
0
;
//周报
}
else
{
$data
[
'type'
]
=
1
;
//日报
}
$result1
=
$this
->
Weekwork
->
save
(
$data
);
if
(
$result1
)
{
$result
[
"status"
]
=
"1"
;
$result
[
"imgname"
]
=
$imgname
;
$result
[
"msg"
]
=
"成功"
;
}
else
{
$result
[
"msg"
]
=
"上传失败"
;
}
echo
json_encode
(
$result
);
exit
;
}
}
\ No newline at end of file
public/resource/js/agentindex.js
deleted
100644 → 0
View file @
0c20cc60
/**
* Created by 刘丹 on 2018/3/1.
*/
define
([
'doT'
,
'text!temp/agentIndex_template_tpl.html'
,
'css!style/home.css'
,
'ckfinder'
,
'ckfinderStart'
,
'pagination'
,
'bootstrapJs'
],
function
(
doT
,
template
)
{
agentIndex
=
{
pageNo
:
1
,
/*第几页*/
pageSize
:
10
,
/*每页显示多少条*/
id
:
''
,
house_id
:
''
,
type
:
''
,
valueCurrent
:
''
,
ajaxObj
:
''
,
stopstatus
:
true
,
boxphoto
:
''
,
init
:
function
()
{
//初始化dot
$
(
"body"
).
append
(
template
);
agentIndex
.
getList
();
agentIndex
.
event
();
},
event
:
function
()
{
$
(
"#search"
).
click
(
function
()
{
agentIndex
.
getList
(
1
);
});
$
(
"#reset"
).
click
(
function
()
{
//重置
document
.
getElementById
(
"form_search"
).
reset
();
});
},
getList
:
function
(
pageNo
)
{
agentIndex
.
pageNo
=
pageNo
;
var
params
=
{};
params
.
pageNo
=
agentIndex
.
pageNo
;
params
.
pageSize
=
agentIndex
.
pageSize
;
params
.
agents_name
=
$
(
'#industry_type'
)
.
val
();
//经纪人姓名
params
.
phone
=
$
(
'#dish'
)
.
val
();
//经纪人手机号
params
.
start_date
=
$
(
'#start_date'
)
.
val
();
//时间1
params
.
end_date
=
$
(
'#end_date'
)
.
val
();
//时间2
$
.
ajax
({
url
:
'/index/callCollectList'
,
//获取列表
type
:
'GET'
,
async
:
true
,
data
:
params
,
dataType
:
'json'
,
success
:
function
(
data
)
{
var
temp
=
document
.
getElementById
(
'agentIndex_list_tpl'
).
innerHTML
;
var
doTtmpl
=
doT
.
template
(
temp
);
$
(
"#agentIndex_list"
).
html
(
doTtmpl
(
data
.
data
.
list
));
/*分页代码*/
$
(
"#pagediv"
).
pagination
({
length
:
data
.
data
.
total
,
current
:
pageNo
,
every
:
agentIndex
.
pageSize
,
onClick
:
function
(
el
)
{
agentIndex
.
getList
(
el
.
num
.
current
);
}
});
}
});
}
};
return
agentIndex
;
});
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment