Commit 098faefe by 张恒

j

parent a123d541
......@@ -56,8 +56,8 @@
<file leaf-file-name="IndexController.class.php" pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/Application/Home/Controller/IndexController.class.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="190">
<caret line="130" column="21" lean-forward="true" selection-start-line="130" selection-start-column="21" selection-end-line="130" selection-end-column="21" />
<state relative-caret-position="178">
<caret line="133" column="19" lean-forward="true" selection-start-line="133" selection-start-column="19" selection-end-line="133" selection-end-column="19" />
<folding>
<element signature="e#34#44#0#PHP" expanded="true" />
</folding>
......@@ -466,12 +466,12 @@
<option name="presentableId" value="Default" />
<updated>1562502557206</updated>
<workItem from="1562502558877" duration="2926000" />
<workItem from="1562505554364" duration="7197000" />
<workItem from="1562505554364" duration="7469000" />
</task>
<servers />
</component>
<component name="TimeTrackingManager">
<option name="totallyTimeSpent" value="10123000" />
<option name="totallyTimeSpent" value="10395000" />
</component>
<component name="ToolWindowManager">
<frame x="0" y="23" width="1440" height="817" extended-state="6" />
......@@ -638,8 +638,8 @@
</entry>
<entry file="file://$PROJECT_DIR$/Application/Home/Controller/IndexController.class.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="190">
<caret line="130" column="21" lean-forward="true" selection-start-line="130" selection-start-column="21" selection-end-line="130" selection-end-column="21" />
<state relative-caret-position="178">
<caret line="133" column="19" lean-forward="true" selection-start-line="133" selection-start-column="19" selection-end-line="133" selection-end-column="19" />
<folding>
<element signature="e#34#44#0#PHP" expanded="true" />
</folding>
......
......@@ -69,7 +69,7 @@ class IndexController extends Controller
$now = time();
$req_type = array();
$type_list = array(1);
$type_list = array(1,2,3,4,5,6,7,8,9,10);
foreach ($type_list as $type) {
$c = M('prize')->where(array(
'type' => $type,
......@@ -77,11 +77,10 @@ class IndexController extends Controller
))->count();
if ($type == 1) {
if ($c >= 10) {
if ($c >= 1) {
continue;
}
}
$req_type[] = $type;
}
if (empty($req_type)) {
......@@ -122,11 +121,25 @@ class IndexController extends Controller
));
return;
}
$type_list = array(1,2,3,4,5,6,7,8,9,10);
$channel_urt=$_POST['channel'];
foreach ($type_list as $type) {
if ($type != $channel_urt) {
$this->ajaxReturn(array(
'errcode' => 1,
'errmsg' => null,
'data' => array(
'prize' => 0
)
));
return;
}
}
$prize = M('Prize')->where(array(
'user_id' => $user['id']
))->find();
$channel=M('Prize')->where(array(
'channel'=>$_POST['channel']
'channel'=>$channel_urt
))->find();
if($channel){
$this->ajaxReturn(array(
......@@ -150,7 +163,7 @@ class IndexController extends Controller
return;
}
$prize = $this->get_random_prize($user,$_POST['channel']);
$prize = $this->get_random_prize($user,$channel_urt);
if ($prize) {
$this->ajaxReturn(array(
'errcode' => 0,
......@@ -176,7 +189,7 @@ class IndexController extends Controller
public function ceshi()
{
for ($i = 0; $i < 40; $i++) {
for ($i = 0; $i < 10; $i++) {
M('Prize')->add(array(
'prize_url' => 'https://www.baidu.com/',
......
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 sign in to comment