作者 郭文星

'123'

... ... @@ -57,7 +57,7 @@ class Holdactivity extends Backend
->paginate($limit);
foreach ($list as $row) {
$row->visible(['id','name','phone','industry','address']);
$row->visible(['id','name','phone','user_id','verification_store_id','verification_activity_id','industry','address']);
$row->visible(['user']);
$row->getRelation('user')->visible(['nickname']);
$row->visible(['store']);
... ...
... ... @@ -8,13 +8,13 @@ use think\Model;
class Holdactivity extends Model
{
// 表名
protected $name = 'verification_hold_activity';
// 自动写入时间戳字段
protected $autoWriteTimestamp = false;
... ... @@ -27,9 +27,9 @@ class Holdactivity extends Model
protected $append = [
];
... ... @@ -43,14 +43,15 @@ class Holdactivity extends Model
}
public function store()
{
return $this->belongsTo('Store', 'id', 'id', [], 'LEFT')->setEagerlyType(0);
return $this->belongsTo('Store', 'verification_store_id', 'id', [], 'LEFT')->setEagerlyType(0);
}
public function activity()
{
return $this->belongsTo('Activity', 'id', 'id', [], 'LEFT')->setEagerlyType(0);
return $this->belongsTo('Activity', 'verification_activity_id', 'id', [], 'LEFT')->setEagerlyType(0);
}
}
... ...
... ... @@ -68,15 +68,13 @@ class Client extends Base
*/
public function participate_activitie(){
$activity_id=$this->postParam['id'];
$page = $this->request->post('page', 1);
$total = $this->request->post('total', 10);
$where['type']=1;
$where['verification_activity_id']=$activity_id;
$user=Db::name("verification_order")
->where($where)
->field('name,createtime')
->paginate($total, false, ['page' => $page])
->select()
->toArray();
if(!empty($user['data'])){
for ($i=0;$i<count($user['data']);$i++){
... ... @@ -112,7 +110,6 @@ class Client extends Base
$industry=$this->postParam['industry'];
$address=$this->postParam['address'];
$verification_activity_id=$this->postParam['id'];
$user_id=$this->auth->id;
$data=[
'verification_store_id'=>$verification_store_id,
'name'=>$name,
... ... @@ -120,7 +117,7 @@ class Client extends Base
'industry'=>$industry,
'address'=>$address,
'verification_activity_id'=>$verification_activity_id,
'user_id'=>$user_id
'user_id'=>$this->auth->id
];
$res=Db::name('verification_hold_activity')->insertGetId($data);
if($res){
... ... @@ -296,7 +293,7 @@ class Client extends Base
->where($where)
->field($field)
->find();
if(!empty($receive)){
$receive['qr_code'] = !empty($receive['qr_code'])?request()->domain().$receive['qr_code']:'';
$receive['image'] = !empty($receive['image'])?request()->domain().$receive['image']:'';
... ... @@ -384,7 +381,7 @@ class Client extends Base
$item['closetime'] = date("Y-m-d",$item['closetime']);
return $item;
});
return $this->success('',$data);
}
... ...