Bir iş rehberi dizini yapıyorum ve yalnızca bir iş saatleri listesini yayınlamak değil, aynı zamanda bir işletmenin şu anda iş için açık olup olmadığını da yayınlamak istiyorum.Matrix kullanarak Çalışma Saatleri
Bir matriste, Cumartesi için cumartesi Sunday row_7 değerini temsil eden 7 satırı var. Yani iki sorum var.
- Bu, COULD kodu gibi mi yoksa daha iyi bir yol mu var?
Bir işletmenin şu anda açık olup olmadığını anlatan koşulda bir kusur var mı? Şu anda çalışıyor gibi görünüyor, ama çok test değil.
{!-- Hours of Operation --} {exp:stash:set name="hours-of-operation"} The Current time is: {current_time format="%g:%i%a"}<br/> {hours_of_operation} {if row_count=="1"}Sunday{/if} {if row_count=="2"}Monday{/if} {if row_count=="3"}Tuesday{/if} {if row_count=="4"}Wednesday{/if} {if row_count=="5"}Thursday{/if} {if row_count=="6"}Friday{/if} {if row_count=="7"}Saturday{/if} {open_time format="%g:%i%a"} - {close_time format="%g:%i%a"}<br/> {/hours_of_operation} {/exp:stash:set} {!-- Hours of Operation --} {!-- Are we open? --} {exp:stash:set name="are-we-open"} {exp:mx_calc expression='{current_time format="%w"}+1'} {!-- matrix --} {hours_of_operation} {if row_count=="{calc_result}"} Today is: {current_time format="%l"}<br/> <strong> {if '{open_time format="%H%i"}' <= '{current_time format="%H%i"}' && '{close_time format="%H%i"}' <= '{current_time format="%H%i"}'} We are currently open!{if:else}We are currently closed. {/if} </strong><br/> Today's Hours are:<br/> <strong>{open_time format="%g:%i%a"} - {close_time format="%g:%i%a"}</strong><br/> {/if} {/hours_of_operation} {!-- matrix --} {/exp:mx_calc} {/exp:stash:set} {!-- Are we open? --}
ne sütunları Matris alanında aslında bize gösterir misin Sadece mevcut mantığa küçük çimdik gerektirir? Ekran görüntüsü veya yapıştırma veya başka bir şey? – adrienne