|
|
|
@ -115,6 +115,12 @@ class MendController extends ThinkController {
|
|
|
|
|
if ($_POST['order_time'] == '') {
|
|
|
|
|
$this->error('没有订单日期');
|
|
|
|
|
}
|
|
|
|
|
//判断是否已经结算
|
|
|
|
|
if(self::checkSettlement(strtotime($_POST['order_time']),$_POST['promote_id'])){
|
|
|
|
|
$this->error('在订单日期内含有已经结算的订单,无法补链');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$create = $_REQUEST;
|
|
|
|
|
$create['order_time'] = date($create['order_time']);
|
|
|
|
|
$params = array(
|
|
|
|
@ -150,6 +156,29 @@ class MendController extends ThinkController {
|
|
|
|
|
$this->display();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
private function checkSettlement($order_time,$prmoote_id)
|
|
|
|
|
{
|
|
|
|
|
//判断是否已经结算
|
|
|
|
|
//获取会长信息
|
|
|
|
|
$Promote = M('promote','tab_');
|
|
|
|
|
$prmootedata = $Promote->field('chain')->find($prmoote_id);
|
|
|
|
|
$chain = trim($prmootedata['chain'], '/');
|
|
|
|
|
if ($chain == '') {
|
|
|
|
|
$prmoote_id = 0;
|
|
|
|
|
} else {
|
|
|
|
|
$prmoote_id = explode('/', $chain)[0];
|
|
|
|
|
}
|
|
|
|
|
$jsres = M("Settlement","tab_")->where(array(
|
|
|
|
|
"total_money"=>array("GT",0),
|
|
|
|
|
"starttime"=>array("ELT",$order_time),
|
|
|
|
|
"endtime"=>array("EGT",$order_time),
|
|
|
|
|
"promote_id"=>$prmoote_id
|
|
|
|
|
))->find();
|
|
|
|
|
if($jsres) return true;
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
# code...
|
|
|
|
|
}
|
|
|
|
|
//补链详情
|
|
|
|
|
public function shiftInfo()
|
|
|
|
|
{
|
|
|
|
|