作者 郭文星

'123'

@@ -57,7 +57,7 @@ class Holdactivity extends Backend @@ -57,7 +57,7 @@ class Holdactivity extends Backend
57 ->paginate($limit); 57 ->paginate($limit);
58 58
59 foreach ($list as $row) { 59 foreach ($list as $row) {
60 - $row->visible(['id','name','phone','industry','address']); 60 + $row->visible(['id','name','phone','user_id','verification_store_id','verification_activity_id','industry','address']);
61 $row->visible(['user']); 61 $row->visible(['user']);
62 $row->getRelation('user')->visible(['nickname']); 62 $row->getRelation('user')->visible(['nickname']);
63 $row->visible(['store']); 63 $row->visible(['store']);
@@ -8,13 +8,13 @@ use think\Model; @@ -8,13 +8,13 @@ use think\Model;
8 class Holdactivity extends Model 8 class Holdactivity extends Model
9 { 9 {
10 10
11 -  
12 11
13 - 12 +
  13 +
14 14
15 // 表名 15 // 表名
16 protected $name = 'verification_hold_activity'; 16 protected $name = 'verification_hold_activity';
17 - 17 +
18 // 自动写入时间戳字段 18 // 自动写入时间戳字段
19 protected $autoWriteTimestamp = false; 19 protected $autoWriteTimestamp = false;
20 20
@@ -27,9 +27,9 @@ class Holdactivity extends Model @@ -27,9 +27,9 @@ class Holdactivity extends Model
27 protected $append = [ 27 protected $append = [
28 28
29 ]; 29 ];
30 -  
31 30
32 - 31 +
  32 +
33 33
34 34
35 35
@@ -43,14 +43,15 @@ class Holdactivity extends Model @@ -43,14 +43,15 @@ class Holdactivity extends Model
43 } 43 }
44 44
45 45
  46 +
46 public function store() 47 public function store()
47 { 48 {
48 - return $this->belongsTo('Store', 'id', 'id', [], 'LEFT')->setEagerlyType(0); 49 + return $this->belongsTo('Store', 'verification_store_id', 'id', [], 'LEFT')->setEagerlyType(0);
49 } 50 }
50 51
51 -  
52 public function activity() 52 public function activity()
53 { 53 {
54 - return $this->belongsTo('Activity', 'id', 'id', [], 'LEFT')->setEagerlyType(0); 54 + return $this->belongsTo('Activity', 'verification_activity_id', 'id', [], 'LEFT')->setEagerlyType(0);
55 } 55 }
  56 +
56 } 57 }
@@ -68,15 +68,13 @@ class Client extends Base @@ -68,15 +68,13 @@ class Client extends Base
68 */ 68 */
69 public function participate_activitie(){ 69 public function participate_activitie(){
70 $activity_id=$this->postParam['id']; 70 $activity_id=$this->postParam['id'];
71 - $page = $this->request->post('page', 1);  
72 - $total = $this->request->post('total', 10);  
73 $where['type']=1; 71 $where['type']=1;
74 $where['verification_activity_id']=$activity_id; 72 $where['verification_activity_id']=$activity_id;
75 73
76 $user=Db::name("verification_order") 74 $user=Db::name("verification_order")
77 ->where($where) 75 ->where($where)
78 ->field('name,createtime') 76 ->field('name,createtime')
79 - ->paginate($total, false, ['page' => $page]) 77 + ->select()
80 ->toArray(); 78 ->toArray();
81 if(!empty($user['data'])){ 79 if(!empty($user['data'])){
82 for ($i=0;$i<count($user['data']);$i++){ 80 for ($i=0;$i<count($user['data']);$i++){
@@ -112,7 +110,6 @@ class Client extends Base @@ -112,7 +110,6 @@ class Client extends Base
112 $industry=$this->postParam['industry']; 110 $industry=$this->postParam['industry'];
113 $address=$this->postParam['address']; 111 $address=$this->postParam['address'];
114 $verification_activity_id=$this->postParam['id']; 112 $verification_activity_id=$this->postParam['id'];
115 - $user_id=$this->auth->id;  
116 $data=[ 113 $data=[
117 'verification_store_id'=>$verification_store_id, 114 'verification_store_id'=>$verification_store_id,
118 'name'=>$name, 115 'name'=>$name,
@@ -120,7 +117,7 @@ class Client extends Base @@ -120,7 +117,7 @@ class Client extends Base
120 'industry'=>$industry, 117 'industry'=>$industry,
121 'address'=>$address, 118 'address'=>$address,
122 'verification_activity_id'=>$verification_activity_id, 119 'verification_activity_id'=>$verification_activity_id,
123 - 'user_id'=>$user_id 120 + 'user_id'=>$this->auth->id
124 ]; 121 ];
125 $res=Db::name('verification_hold_activity')->insertGetId($data); 122 $res=Db::name('verification_hold_activity')->insertGetId($data);
126 if($res){ 123 if($res){
@@ -296,7 +293,7 @@ class Client extends Base @@ -296,7 +293,7 @@ class Client extends Base
296 ->where($where) 293 ->where($where)
297 ->field($field) 294 ->field($field)
298 ->find(); 295 ->find();
299 - 296 +
300 if(!empty($receive)){ 297 if(!empty($receive)){
301 $receive['qr_code'] = !empty($receive['qr_code'])?request()->domain().$receive['qr_code']:''; 298 $receive['qr_code'] = !empty($receive['qr_code'])?request()->domain().$receive['qr_code']:'';
302 $receive['image'] = !empty($receive['image'])?request()->domain().$receive['image']:''; 299 $receive['image'] = !empty($receive['image'])?request()->domain().$receive['image']:'';
@@ -384,7 +381,7 @@ class Client extends Base @@ -384,7 +381,7 @@ class Client extends Base
384 $item['closetime'] = date("Y-m-d",$item['closetime']); 381 $item['closetime'] = date("Y-m-d",$item['closetime']);
385 return $item; 382 return $item;
386 }); 383 });
387 - 384 +
388 return $this->success('',$data); 385 return $this->success('',$data);
389 } 386 }
390 387