God asks for solution
……
…… 2019-03-24 20:33:07
0
7
1481

protected $pk = 'user_id';What does it mean

……
……

reply all(2)
Martin Huang

$pk here defines the primary key of the model associated with the data table

薛伟健

protected Protected is this $user_id. You can call it but you cannot assign it to change it. and public (representing public), and one called private, the first two of which can be inherited

  • reply God, I have another question
    …… author 2019-03-24 21:25:27
  • reply Since it needs to be associated with the user table of the database in order to be added, TP5 has already done the processing internally and only needs to create a new application/index/model/User.php file. Did he say that he should go to TP5 to handle it himself?
    …… author 2019-03-24 21:27:15
  • reply Failed to load resource: the server responded with a status of 500 (Internal Server Error) He gave me this reply
    …… author 2019-03-24 21:28:15
  • reply Don't mislead, protected means that it can only be called or assigned within the class or subclass, not that it cannot be assigned.
    Icetalker author 2019-03-25 15:47:37
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template