javascript - How to pass this kind of parameter interface?
给我你的怀抱
给我你的怀抱 2017-06-28 09:22:19
0
3
868

There are four quarters in total. In what form are parameters passed through the interface?
2017-1-1~2017-3-31?
please help

给我你的怀抱
给我你的怀抱

reply all(3)
洪涛

It’s just transmitted like this, and the backend will process it and make a mapping.

淡淡烟草味

Method 1, you can use 1, 2, 3, and 4 to represent the first to fourth quarters respectively. Then let the background process and return the data of which quarter according to the value you passed, and then display it. For example, pass 1. The background returns the first quarter data.
Method 2, the start and end time of the first quarter: '2017-1-1 0:0:0', '2017-3-31 23:59:59', the second quarter: '2017-4-1 0: 0:0','2017-6-30 23:59:59',. . . Then analyze it in the background.
Method 3, based on method 2, convert the start and end times of the first quarter (2017-1-1 0:0:0 and 2017-3-31 23:59:59) into timestamps, Passed to the background.
Method 1 and 3 are used more often. I personally think that method 1 is the most used, and then method 3

女神的闺蜜爱上我

I think this can be adapted to the backend, and it can be used as conveniently as possible. If the interface needs to achieve finer granularity (for example, it needs to be accurate to "year, month, day to year, month, day"), then pass it. Timestamp, if all the interfaces are Q1Q2Q3Q4 and there is unlikely to be additional demand, it is OK to replace it with a string...

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!