Commit ff288d3d by 冷斌

add

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