uid) ->withAttr('box_img', function ($val, $data){ return getWebUrl().'/'.$val; }) ->withoutField('goods_id,box_type') ->order('id', 'desc') ->paginate($param->data['limit']) ->toArray(); // $history = self::where([ // ['uid', '=', $param->uid], // ['state', '=', 1] // ])->sum('money'); return $list['data']; return compact('list', 'history'); } public function user () { return $this->belongsTo('app\common\model\UserModel', 'uid', 'id'); } public function box () { return $this->belongsTo('app\common\model\BoxModel', 'box_id', 'id'); } }