public function update(Request $request)
{
$idpawn = $request['idprestamo'];
$paynumber = $request['numeropago'];
$payqty = $request['payqty'];
$statuspawns = statuspawns::find($idpawn,$paynumber);
$updateqty = $statuspawns->totalpayment - $payqty;
if($updateqty == "0"){
$status = "Pay";
}
else{
$status = "Partial Payment";
}
$statuspawns->total = $updateqty;
$statuspawns->status = $status;
$statuspawns->save();
return redirect()->back();
}
以上代码的输出为:
package main
import "fmt"
func main() {
a := struct{}{}
b := struct{}{}
fmt.Println(a == b)
fmt.Println(&a == &b)
}
但是如果我按如下方式打印true
false
a
的指针:
b
输出为:
package main
import "fmt"
func main() {
a := struct{}{}
b := struct{}{}
fmt.Println(a == b)
fmt.Println(&a == &b)
fmt.Printf("%p\n", &a)
fmt.Printf("%p\n", &b)
}
那为什么打印后输出会改变?