When the thinkphp model is used for automatic completion, How can I obtain the field value just generated in the model. {Code...} Please be confused. Thank you. When the thinkphp model is used for automatic completion, How can I obtain the field value just generated in the model.
// Automatically complete protected $ _ auto = array ('rand', 'rand', self: MODEL_INSERT, 'function '), // The random number array ('Password', 'enabled', self: MODEL_INSERT, 'callback'), array ('login', 'time', 3, 'function'), // when updating the login Field, write the current timestamp array ('IP', 'Get _ client_ip ', 3, 'function '), // automatically obtain the ip address when updating the ip field); function encrypt ($ data) {// how can I call the rand random number echo 'rand random number 'Here ';}
Please try again. Thank you.
Reply content:
When the thinkphp model is used for automatic completion, How can I obtain the field value just generated in the model.
// Automatically complete protected $ _ auto = array ('rand', 'rand', self: MODEL_INSERT, 'function '), // The random number array ('Password', 'enabled', self: MODEL_INSERT, 'callback'), array ('login', 'time', 3, 'function'), // when updating the login Field, write the current timestamp array ('IP', 'Get _ client_ip ', 3, 'function '), // automatically obtain the ip address when updating the ip field); function encrypt ($ data) {// how can I call the rand random number echo 'rand random number 'Here ';}
Please try again. Thank you.
Object-oriented:
$ User = D ("User"); // instantiate the User object $ User-> create (); // generate the data object echo $ User-> rand; // obtain rand
I ('Post. rand')? Have you tried it?