Commit 9cd64933 authored by hujun's avatar hujun

1

parent f9cc51fa
......@@ -2205,11 +2205,11 @@ class Finance extends Basic
$where_bargain['agent_id'] = $agent_id;
$where_bargain['create_time'] = ['BETWEEN', [$date.' 00:00:00', $date.' 23:59:59']];
$receivedSum = $this->m_bargain->getReceivedGroupTimeNew($where_bargain);
$result_arr["received_sum"] = empty($receivedSum[0]["num"]) ? "" : $receivedSum[0]["num"];
$received_sum = empty($receivedSum[0]["num"]) ? "" : $receivedSum[0]["num"];
$id = $m_agent_total->getTotalEndTimeByAgentId('id', ['total_time'=>$date, 'agent_id'=>$where_bargain['agent_id']]);
if (empty($id)) {
if (empty($id[0])) {
$insert_data[] = [
'store_id' => $district_id,
'district_id' => $store_id,
......@@ -2219,7 +2219,7 @@ class Finance extends Basic
];
$m_agent_total->addTotal($insert_data);
} else {
$update_data[0]["received_sum"] = empty($result_arr["received_sum"]) ? 0 : $result_arr["received_sum"];
$update_data[0]["official_receipts"] = empty($received_sum) ? 0 : $received_sum;
$update_data[0]['id'] = $id[0]['id'];
$m_agent_total->saveTotal($update_data);
}
......
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