function($query)を使って条件しぼってwhereInにぶっこむ
public function getArticleEditors() { return $this->model->whereIn('staff.id', function($qu...
24 search resultsShowing 1~20 results
You need to log-in
public function getArticleEditors() { return $this->model->whereIn('staff.id', function($qu...
grep "#AAAAAA" ./file_XXX | grep -B30 '"XXXX_id"=>"0"'
macにbrewなどで新しいアプリ(rbenv等)をインストールする時、あまり良く考えずにそのアプリのコマンドのPATHを通していましたが、「そもそもコマンドのPATHを通すってどういうことか」...
①既存の「やまだクリエイティブ・エージェンシー」・「やまだクリエイティブエージェンシー」の件数を確認 SELECT COUNT(*) FROM artist_profile WHERE genr...
delegateをしっかり理解しないまま使っていたので、調べようと思います。 solidus内のdelegate solidusのmodelからdelegateが使われている場所を抜粋してみます...
記事数デイリー推移 select genre, DATE_FORMAT(`published_at`, '%Y-%m-%d') as date, count(id) from news wher...
class AAController extends BaseController { protected $externalImageRepository; /** * Create a ne...
/** * 関連アーティストリレーション */ public function related_artist() { return $this->belongsToMany(Artist:...
$assignedUsersList = $this->repository->getList()->unique('assigned_user_id'); $assigned...
[ec2-user@dev-1a ~]$ df -h ファイルシス サイズ 使用 残り 使用% マウント位置 devtmpfs 1.9G 56K 1.9G 1...
デリートインサートしたくない(一旦削除してまた紐付けると、sort_orderが変わってしまう) Laravel の collection $this->model->related...
ダブルクオートを使う必要がある場合 # htmlタグの属性指定 <a href="hogehogegohe">aaa</a> # シングルクオートを表示したいとき $te...
* アーティストエイリアス属性 */ public function getAliasStrAttribute() { $aliasArray = json_decode($this['alia...
.php //関連アーティスト更新 // dd((int)$request->artist_id[0]); if (isset($request->artist...
Final Ruby project 2 - Text follow-up Section 2, Lecture 54 We created a crud.rb file and filled ...
Attributes, getters, setters - Text directions, references and code Section 2, Lecture 50 .rb cla...
Dial book solution code: dial_book = { "newyork" => "212", "newbrunswick" => "732", "edison...
1, URLにselectboxを使ってuserにparamsを送る 2, ついでにselectboxで選んだらすぐsubmitしたい。 [_filter.html.erb] <%= fo...
user一覧など、インスタンス変数をloopさせて表示させるようなviewをリファクタリングする。 まずpartialを切る。 app/views/users/index.erb <% @...
options_for_select ヘルパーで規定値(selectedの値)を設定したい時は次のようにする # 女性をデフォルトにする場合 options_select_for({"male"...
24 search resultsShowing 1~20 results
Qiita is a knowledge sharing service for engineers.