|
|
@@ -16,8 +16,10 @@ namespace app\adminapi\lists\effective;
|
|
|
|
|
|
|
|
|
use app\adminapi\lists\BaseAdminDataLists;
|
|
|
-use app\common\model\effective\OrderEffectiveLog;
|
|
|
+use app\adminapi\logic\effective\OrderEffectiveLogLogic;
|
|
|
+use app\common\model\orders\OrderEffectiveLog;
|
|
|
use app\common\lists\ListsSearchInterface;
|
|
|
+use app\common\model\works\ServiceWork;
|
|
|
|
|
|
|
|
|
/**
|
|
|
@@ -55,12 +57,22 @@ class OrderEffectiveLogLists extends BaseAdminDataLists implements ListsSearchIn
|
|
|
*/
|
|
|
public function lists(): array
|
|
|
{
|
|
|
- return OrderEffectiveLog::where($this->searchWhere)
|
|
|
+ $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;
|
|
|
}
|
|
|
|
|
|
|