['effective_id', 'sn', 'user_id', 'work_id', 'goods_id', 'effective_unit', 'effective_num', 'remark', 'end_effective_time'], ]; } /** * @notes 获取列表 * @return array * @throws \think\db\exception\DataNotFoundException * @throws \think\db\exception\DbException * @throws \think\db\exception\ModelNotFoundException * @author likeadmin * @date 2025/01/17 11:10 */ public function lists(): array { $list = OrderEffectiveLog::with(['goods'=>function ($query) { $query->with(['goodsCategory'=>function ($query1) { $query1->field(['name','picture']); }]); },'serviceWork','originalServiceWork'])->where('effective_status','>',0)->where($this->searchWhere) ->field(['*']) ->limit($this->limitOffset, $this->limitLength) ->order(['id' => 'desc']) ->select() ->toArray(); foreach ($list as &$value) { $value['income_fee'] = 0; if($value['originalServiceWork']) $value['income_fee'] = OrderEffectiveLogLogic::commissionAndAssuranceDeposit($value['originalServiceWork']); } return $list; } /** * @notes 获取数量 * @return int * @author likeadmin * @date 2025/01/17 11:10 */ public function count(): int { return OrderEffectiveLog::where($this->searchWhere)->count(); } }