['store_id', 'admin_id', 'uid', 'status', 'initiation_time', 'confirmation_time', 'mark', 'money', 'remark_time','create_time'], 'between_time' => 'create_time', ]; } /** * @notes 获取列表 * @return array * @throws \think\db\exception\DataNotFoundException * @throws \think\db\exception\DbException * @throws \think\db\exception\ModelNotFoundException * @author admin * @date 2024/06/14 10:10 */ public function lists(): array { $data = FinancialTransfers::with(['store','staff','admin'])->where($this->searchWhere) ->limit($this->limitOffset, $this->limitLength) ->order(['id' => 'desc']) ->select() ->toArray(); foreach ($data as &$value){ if($value['initiation_time']){ $time=strtotime('-1 month',$value['initiation_time']); $date=date('Y-m-d',$time);//获取一个月前的日期 $value['receivable']=StoreCashFinanceFlow::whereMonth('create_time',$date)->where('status',0)->sum('receivable'); $value['initiation_time'] = date('Y-m-d H:i:s',$value['initiation_time']); } if($value['confirmation_time']){ $value['confirmation_time'] = date('Y-m-d H:i:s',$value['confirmation_time']); } } return $data; } /** * @notes 获取数量 * @return int * @author admin * @date 2024/06/14 10:10 */ public function count(): int { return FinancialTransfers::where($this->searchWhere)->count(); } }