| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- <?php
- namespace app\common\model;
- use app\api\services\UserServices;
- use app\common\model\TimeModel;
- //use app\model\RedPoolModel;
- //use app\model\RedStorePoolModel;
- use app\common\model\UserDataModel;
- use services\CacheServices;
- use think\Exception;
- use think\facade\Db;
- use think\Model;
- class BoxRecordModel extends Model
- {
- protected $name = "box_record";
- public function getLog ($param)
- {
- $list = self::where('uid', $param->uid)
- ->withAttr('box_img', function ($val, $data){
- return getWebUrl().'/'.$val;
- })
- ->withoutField('goods_id,box_type')
- ->order('id', 'desc')
- ->paginate($param->data['limit'])
- ->toArray();
- 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');
- }
- }
|