|
|
|
@ -24,12 +24,10 @@ class MarketPerformanceSetController extends Controller {
|
|
|
|
|
private $settleupMarketorderModel;
|
|
|
|
|
private $taxRatio;
|
|
|
|
|
private $oldMarketPerformance;
|
|
|
|
|
/**
|
|
|
|
|
* 更新某月数据
|
|
|
|
|
*/
|
|
|
|
|
public function setFreeMonth($count_date)
|
|
|
|
|
{
|
|
|
|
|
//设置转换精度
|
|
|
|
|
private $isInit = false;
|
|
|
|
|
|
|
|
|
|
private function configInit($count_date){
|
|
|
|
|
if($this->isInit) return; //避免重复生成配置
|
|
|
|
|
ini_set('serialize_precision',14);
|
|
|
|
|
$month = $count_date;
|
|
|
|
|
if(empty($month)) die("参数错误");
|
|
|
|
@ -44,17 +42,18 @@ class MarketPerformanceSetController extends Controller {
|
|
|
|
|
$this->beginThismonth=mktime(0,0,0,$tarry[1],1,$tarry[0]);
|
|
|
|
|
$this->endThismonth=mktime(0,0,0,$tarry[1]-0+1,1,$tarry[0])-1;
|
|
|
|
|
$this->settleupMarketorderModel=SM("settleup_marketorder","tab_");
|
|
|
|
|
$this->reCount();
|
|
|
|
|
$this->setSettleupMarketorder();
|
|
|
|
|
$this->isInit = true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 强制重新聚合
|
|
|
|
|
* 更新某月毛利数据
|
|
|
|
|
*/
|
|
|
|
|
private function reCount()
|
|
|
|
|
public function setFreeMonth($count_date)
|
|
|
|
|
{
|
|
|
|
|
// $this->settleupMarketorderModel->where(['pay_time'=>$this->date])->delete();
|
|
|
|
|
echo "旧数据清理成功".PHP_EOL;
|
|
|
|
|
$this->configInit($count_date);
|
|
|
|
|
$this->setSettleupMarketorder();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 计算公司毛利
|
|
|
|
|
*/
|
|
|
|
@ -455,7 +454,8 @@ class MarketPerformanceSetController extends Controller {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if($tempArr['promote_amount'] != 0){
|
|
|
|
|
//下游流水不等于就要算毛利
|
|
|
|
|
if($v['promote_pay_amount'] != 0){
|
|
|
|
|
$this->adddata[]= $tempArr;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -468,8 +468,19 @@ class MarketPerformanceSetController extends Controller {
|
|
|
|
|
private function settleupMarketorderDbSave()
|
|
|
|
|
{
|
|
|
|
|
//删除旧数据
|
|
|
|
|
// dd($this->adddata);
|
|
|
|
|
$this->settleupMarketorderModel->where(['pay_time'=>$this->date])->delete();
|
|
|
|
|
$this->settleupMarketorderModel->addAll($this->adddata);
|
|
|
|
|
}
|
|
|
|
|
/**
|
|
|
|
|
* 市场经理计算
|
|
|
|
|
*/
|
|
|
|
|
public function marketManagerSet($count_date)
|
|
|
|
|
{
|
|
|
|
|
if(!$this->isInit) $this->configInit($count_date);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|