select pid as 'id',pnameth 'name',if(now() between pflash_start and pflash_end,pflash_price,pprice) as 'price',pphoto 'photo',pstatus 'status'
,if( (now() between pflash_start and pflash_end) and pprice<pfullprice and pfullprice>0 ,pprice,pfullprice) 'fullprice',pcategory,psubcatogory,psscategory,pcharacter from dex_product where pactivate=1 and phide=0 and (porder_end=0 or porder_end>now()) and ( pnameth like '%%ซันจิ%%' or pnameen like '%%ซันจิ%%' or ptag like '%%ซันจิ%%' or pid='ซันจิ' or pbarcode='ซันจิ' ) and pstatus<>'Preorder' order by pid desc limit 0,30