|
|
|
@ -632,19 +632,25 @@ class MarketPercentageController extends ThinkController
|
|
|
|
|
$data['time'] = strtotime($data['timestart']);
|
|
|
|
|
$data['create_time'] = time();
|
|
|
|
|
|
|
|
|
|
$is_save = M("tax_radio","tab_")->add($data);
|
|
|
|
|
$is_hav = M("tax_radio","tab_")
|
|
|
|
|
->where(['time'=>strtotime($data['timestart'])])
|
|
|
|
|
->find();
|
|
|
|
|
|
|
|
|
|
if ($is_save) {
|
|
|
|
|
$this->success("保存成功",U("index"));
|
|
|
|
|
if ($is_hav) {
|
|
|
|
|
$is_save = M("tax_radio","tab_")
|
|
|
|
|
->where(['time'=>strtotime($data['timestart'])])
|
|
|
|
|
->add($data);
|
|
|
|
|
} else {
|
|
|
|
|
$this->error("保存失败");
|
|
|
|
|
$is_save = M("tax_radio","tab_")->add($data);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$this->success("保存成功",U("index"));
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
|
|
$data = M("tax_radio","tab_")
|
|
|
|
|
->field("tax_radio,time timestart")
|
|
|
|
|
->order("time DESC")
|
|
|
|
|
->order("create_time DESC")
|
|
|
|
|
->find();
|
|
|
|
|
|
|
|
|
|
$data['timestart'] = Date("Y-m",$data['timestart']);
|
|
|
|
|