store_id = get_store_id(); $form->md_id = $this->md_id; return $this->asJson($form->indexData()); } /** * 获取扫码商品列表 * @return \yii\web\Response * @author: hankaige * @Time: 2024/12/4 下午1:47 */ public function actionGetGoodsByCode():\yii\web\Response { $form = new IndexForm(); $form->store_id = get_store_id(); $form->md_id = $this->md_id; $form->attributes = get_params(); return $this->asJson($form->getGoods()); } public function actionGetActionLog() { $day = get_params('day'); if(empty($day)){ $day = date('Y-m-d'); $startTime = strtotime(date($day.' 00:00:00')); $endTime = strtotime(date($day.' 23:59:59')); }else{ $startTime = strtotime(date($day.' 00:00:00')); $endTime = strtotime(date($day.' 23:59:59')); } $query = CashierActionLog::find()->with(['user'])->where(['store_id' => get_store_id(), 'md_id' => $this->md_id])->andWhere(['and',['>','created_at',$startTime],['<','created_at',$endTime]])->orderBy('created_at DESC'); $result = pagination_make($query,true); foreach($result['list'] as &$item){ $item['created_at'] = date('Y-m-d H:i:s',$item['created_at']); $item['action_text'] = CashierActionLog::TEXT[$item['action']]; } return $this->asJson(['code' => 0,'data' => $result]); } }