private function saveStatus($log, $logistic_name, $logistic_cust_code) { if (is_array($log) && count($log) > 0) { foreach ($log as $l) { $l->ts = new MongoDate(strtotime($l->timestamp)); $l->consignee_logistic_id = $logistic_name; $l->consignee_olshop_cust = $logistic_cust_code; $al = array(); foreach ($l as $k => $vl) { $al[$k] = $vl; } Threeplstatuses::insert($al); foreach ($l->pod as $p) { $p->ts = new MongoDate(strtotime($l->timestamp)); $p->consignee_logistic_id = $logistic_name; $p->consignee_olshop_cust = $logistic_cust_code; $p->awb = $l->awb; $pl = array(); foreach ($p as $pk => $pv) { $pl[$pk] = $pv; } Threeplpictures::insert($pl); } } } }