|
@@ -26,12 +26,15 @@ class GetKennelDetailWorkCommand extends CConsoleCommand {
|
|
|
$cursor = JRecord::model()->findAll($criteria);
|
|
|
$rows = CommonFn::getRowsFromCursor($cursor);
|
|
|
$parsedRows = JRecord::model()->parse($rows);
|
|
|
- foreach ($cursor as $item) {
|
|
|
- $item->status = 2;
|
|
|
- $item->save();
|
|
|
+
|
|
|
+ $data = [];
|
|
|
+ foreach ($parsedRows as &$row) {
|
|
|
+ if ($row['type'] == 0) {
|
|
|
+ $data[] = $row;
|
|
|
+ }
|
|
|
}
|
|
|
$type_name = 'all';
|
|
|
- $res=Service::factory('JRecordService')->push($parsedRows,$type_name,['start' => $start_time, 'end' => $end_time],1);
|
|
|
+ $res=Service::factory('JRecordService')->push($data,$type_name,['start' => $start_time, 'end' => $end_time],1);
|
|
|
$mail = Yii::app()->mailer;
|
|
|
try {
|
|
|
$mail->SMTPDebug = 2; // Enable verbose debug output
|
|
@@ -45,6 +48,7 @@ class GetKennelDetailWorkCommand extends CConsoleCommand {
|
|
|
|
|
|
$mail->setFrom('insur_zhq1@163.com', 'JinGuo365');
|
|
|
$mail->AddAddress('sh.zhq@163.com');
|
|
|
+ $mail->AddAddress('511276154@qq.com');
|
|
|
$mail->addAttachment(Yii::app()->basePath.'/export/'.$res); // Add attachments
|
|
|
|
|
|
$mail->isHTML(true); // Set email format to HTML
|