Commit ff288d3d by 冷斌

add

parent 6ecd39cb
...@@ -28,26 +28,29 @@ class WelfareController extends AdminbaseController ...@@ -28,26 +28,29 @@ class WelfareController extends AdminbaseController
function savePrice() function savePrice()
{ {
$price=I('price'); if(IS_POST){
if ($price > 0) { echo 1;die;
$jackpot=M("welfare_rate"); $price=I('price');
$check = $jackpot->where("id=1")->find(); if ($price > 0) {
$p = [ $jackpot=M("welfare_rate");
'id' => 1, $check = $jackpot->where("id=1")->find();
'giftid' => 0, $p = [
'nums' => 0, 'id' => 1,
'rate' => $price 'giftid' => 0,
]; 'nums' => 0,
try{ 'rate' => $price
if (empty($check)) { ];
M("welfare_rate")->create($p); try{
} else { if (empty($check)) {
$b = M("welfare_rate")->where("id=1")->save($p); M("welfare_rate")->create($p);
var_dump($b); } else {
die; $b = M("welfare_rate")->where("id=1")->save($p);
} var_dump($b);
}catch (\Exception $exception){ die;
}
}catch (\Exception $exception){
}
} }
} }
} }
......
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