* @return HasMany */ public function orders(): HasMany { return $this->hasMany(Order::class); } /** * Notes: 是否可以申请提货 * * @Author: 玄尘 * @Date : 2021/10/22 14:13 * @return bool */ public function canPick(): bool { return $this->case && $this->identities()->where('order', '>', 1)->count() > 0 && $this->userStock->stock > $this->userStock->hold; } /** * Notes: 提货 * * @Author: 玄尘 * @Date: 2022/7/27 16:18 */ public function pickGoods() { if (! $this->canPick()) { return '不可提货'; } } }