# solana account -u <source cluster> --output <output format> --output-file <destination file name/path> <address of account to fetch>
solana account -u m --output json-compact --output-file jup.json JUPyiwrYJFskUPiHa7hkeR8VUtAeFoSYbKedZNsDvCN
然后通过在启动验证器时(在本地集群上)传递帐户的文件和目标地址将其加载到你的本地网络:
# solana-test-validator --account <address to load the account to> <path to account file> --reset
solana-test-validator --account JUPyiwrYJFskUPiHa7hkeR8VUtAeFoSYbKedZNsDvCN jup.json --reset
同样,也可以下载 Openbook 程序:
# solana program dump -u <source cluster> <address of account to fetch> <destination file name/path>
solana program dump -u m srmqPvymJeFKQ4zGQed1GFppgkRHL9kaELCbyksJtPX openbook.so
然后通过在启动验证器时(在本地集群上)传递程序的文件和目标地址将其加载到你的本地网络:
# solana-test-validator --bpf-program <address to load the program to> <path to program file> --reset
solana-test-validator --bpf-program srmqPvymJeFKQ4zGQed1GFppgkRHL9kaELCbyksJtPX openbook.so --reset
$topic_users = DB::table('topics')->select(DB::raw('user_id, count(*) as topic_count'))->where('created_at', '>=', Carbon::now()->subDays(60))->groupBy('user_id')->get();
或
$topic_users = DB::table('topics')->selectRaw('user_id, count(*) as topic_count')->where('created_at', '>=', Carbon::now()->subDays(60))->groupBy('user_id')->get();
但执行以下代码:
$topic_users = Topic::select(DB::raw('user_id, count(*) as topic_count'))->where('created_at', '>=', Carbon::now()->subDays(60))->groupBy('user_id')->get();
或
$topic_users = Topic::query()->select(DB::raw('user_id, count(*) as topic_count'))->where('created_at', '>=', Carbon::now()->subDays(60))->groupBy('user_id')->get();
或
$topic_users = Topic::selectRaw('user_id, count(*) as topic_count')->where('created_at', '>=', Carbon::now()->subDays(60))->groupBy('user_id')->get();
报错:
Illuminate\Database\Eloquent\MissingAttributeException The attribute [view_count] either does not exist or was not retrieved for model [App\Models\Topic].